Archive 17/01/2023.

Scripting a Project

Jillinger

Hi
I’ve been playing around with the editor for a while, and I am ready to do scripting on a new project. I have three queries.

  1. I don’t see a script button in the editor. How can I add a script, and edit it in Visual Studio? Can I use the editor in this way to start a project from scratch?

  2. I was following the docs on creating a new product, but somehow my include files are missing. How can I ensure they are included when I generate a project?

  3. Can I use an main.as file instead of, or along with the main.cpp file?

Thanks

Jillinger

Okay. So I found out how to add a script, which answers my number 1 question.
So I can use the editor to develop my project, only it appears, I need to use an IDE to publish.
That’s not bad at all. Other than the lack of that feature, the editor in my opinion has some great advantages, like allowing me to customize it to my likings It updates in realtime superbly, and it’s beautiful. :sweat_smile:

It still would be nice to get questions 2 and 3 covered.

lezak

As for 3. You can use player application, here is documentation , also check out scripted samples and how are they started (in "Data/CommandLine.txt place path to Your Main.as and run player). If You want to use scripting alongside C++ check this page for some instructions.

Jillinger

Thanks lezak.
Now I just need to get number 2, and I can use this.:smile: Thanks

Jillinger

Alright! Number 2 is covered.
It seems cmakeLists was missing this piece of code:

# Find Urho3D library
find_package (Urho3D)
include_directories (${URHO3D_INCLUDE_DIRS})

Done.:smiley: