AngelScript: added message queue bindings. #3025
Merged
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.
There's a new script function
game.pushMessage(MsgType, dictionary@)
which allows you to do practically any state change within the game (load/unload terrain, actor, connect/disconnect multiplayer). The parameters are passed as dictionary. Documentation will be available at http://developer.rigsofrods.org/ after this PR is merged; for now here is a reprint:The demo script now displays a button "Launch simple test terrain" when in menu, as small test. To try it, open ingame console and say 'loadscript demo_script.as'.
This is an example how to spawn https://forum.rigsofrods.org/resources/1996-dodge-viper-gts-coupe.88/
This console snippet spawns Viper GTS directly in front of you:
as quaternion qrot = quaternion((radian(3.14) - game.getPersonRotation()), vector3(0,1,0)); vector3 v3pos = game.getPersonPosition() + (qrot*vector3(-5,0,0)); game.pushMessage(MSG_SIM_SPAWN_ACTOR_REQUESTED, {{'filename', 'vipergts.car'}, {'position', v3pos}, {'rotation', qrot}, {'enter', false}});