Closed ohlidalp closed 9 months ago
I'm getting ahead of myself... but just a little.
BTW is it weird to run a physics sandbox game just to make and use your own text editor in there? 😅
I just tested this, and one crash that I found is that if you try and load a script from a terrain folder the game crashes
I just realized I'm not nearly done here, so I've converted this to draft.
@AnotherFoxGuy Probably an uncaught exception. I just added an exception-reporting event type, but I need to manually wrap all troublesome funcs. The save/loadStringResource()
aren't wrapped yet.
I just added an API giving script info - I need it to make nice exception window, and also to tell which exceptions belong to who - the editor needs to catch all so it can diagnose it's guest script. The thisScript
is a new automatic global var.
If this isn't cool, IDK what is 😎
@AnotherFoxGuy I can't seem to reproduce the crash you mentioned.
Latest development: :angel:script bindings of OGRE overlay system and a prototype editor script allowing you to add/edit/delete elements and export OGRE's .overlay files.. Also the editor now has tabs and autosave.
Script writing is powerful but clumsy:
loadscript ...
to console or use ScriptMonitor menu to Load/Reload the scriptTo make scripting fun, the dev/test cycle needs to be quick and comfy. So we needed an ingame editor with a "(RE)START" button and error reporting.
Behold the 'script_editor.as' AngelScript editor written in AngelScript:
At the moment it's somewhat glitchy but the START/STOP button works perfectly. It relies entirely on
ImGui::InputTextMultiline()
, errors and syntax highlight is done by overdrawing. The numbers are: line number, line length, comment offset, num errors - most are not useful but look cool, you can disable them in the View menu.Update: yes, the hyperlink opens the default browser (only tested on Win10).![obrazek](https://github.com/RigsOfRods/rigs-of-rods/assets/491088/c3b23210-66df-459d-9581-ec357563832c)
Update2: added![obrazek](https://github.com/RigsOfRods/rigs-of-rods/assets/491088/35f5d165-16e9-4feb-93f7-dd0474cde9be)
game.findResourceFileInfo()
which lists files in pre-defined resource groups. This allowed me to list up files in user's 'scripts' dir: