-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Basic support for plugin scripts. #2840
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ohlidalp
force-pushed
the
AngelScript_custom
branch
from
January 5, 2022 23:37
8112e0d
to
f686d50
Compare
tritonas00
approved these changes
Jan 6, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! You may want to add the new -runscript option in -help also
I used the existing scripting subsystem, just added config/commandline options to load scripts and made them update in main menu, too. I also created an example/documentation script 'demo_script.as', find it in resources/scripts. To see it in action, run with commandline '-runscript demo_script.as'. Scripts are loaded from resources/scripts or ROR_HOME/scripts. Changes: added config cvar 'app_custom_scripts' - a comma delimited list of script names added command line argument '-runscript <scriptname>' which can be used multiple times, and underlying cvar 'cli_custom_scripts' Status: the demo script runs OK while in main menu, but stops as soon as terrain is loaded.
Until now, ScriptEngine could really accomodate just a single terrain script - all properties and callback handles were stored directly as ScriptEngine member variables. This commit factores these out to class ScriptUnit and adds enum ScriptCategory so everything can be organized well. Also, TerrainManager now cleans up it's scripts. Status: the demo script runs flawlessly both in menu, in terrain and back in menu. However, terrain scripting is broken - races don't load etc...
Terrain scripts work as usual and custom scripts work OK, too. See 'resources/scripts/demo_script.as' for usage instructions.
…utEvents'. Enum inputEvents contains all values of enum `events` in InputEngine.h. Object InputEngineClass contains only a few important functions of InputEngine, see InputEngineAngelscript.cpp for listing. InputEngine.h: just formatted the enum comments, no code change. Demo script extended to showcase new abilities. Added doxygen doc.
ohlidalp
force-pushed
the
AngelScript_custom
branch
from
January 13, 2022 10:30
f686d50
to
8852766
Compare
Good idea, done. |
Closed
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This feature branch gives you the ability to run AngelScript scripts on launch and have them running continuously until the game shutdown, in both menu and simulation (both single and multiplayer).
The game interface is the same which terrain scripts use, with new extension: global object
input
which lets you retrieve configured controls and current input states.There is an example script 'demo_script.as' in the "resources/scripts" directory (or 'resources/scripts.zip' package when installed). You can run it by 2 ways:
ror -runscript demo_script.as
(you can load multiple scripts by using-runscript
repeatedly)app_custom_scripts=demo_script.as
(you can enter multiple filenames delimited by comma).Showcase of the example script:
This is probably the least-nonsense feature I coded so far.