- Documentation
- Runtime Metadata Twiddling
Runtime Metadata Twiddling
If you want to change the
realtime_interval of your game during runtime, you can add
runtime_metadata_twiddling to your prelude.
To see log output of metadata changes, add
runtime_metadata_twiddling_debug.
After this prelude flag has been set, you can change the parameters of some prelude flags based on rule patterns like this:
[> Player | SlowBtn] -> realtime_interval 0.5
[> Player | FlickBtn] -> [> Player | ] smoothscreen flick 5x5 3x3
Any changes you make with this will be included in the undo history of the level.
Currently the prelude flags that support this are:
- zoomscreen
- flickscreen
- smoothscreen
- key_repeat_interval
- realtime_interval
- again_interval
- background_color
- text_color (for message)
- message_text_align (for message)
- noundo (set to anything to enable and wipe to disable, see below)
- norestart (set to anything to enable and wipe to disable, see below)
You can also combine these directives with rule patterns and other flags like
nosave and
again. Just like with
message, the prelude flag needs to be the rightmost argument in the rule:
[ Player ConveyorRight] -> [right Player ConveyorRight] again again_interval 0.5
Two special parameters allow you to access a previous value or completely wipe the prelude flag:
- default will return the value to how it was at the beginning of the level.
- wipe removes the option and value from the metadata (allowing you to do cool stuff like toggling realtime on and off).
You use these special keywords like this:
[> Player | WipeButton] -> realtime_interval wipe
Special case - noundo
Once a turn ends with
noundo being set, that turn becomes irreversible, meaning you can't undo back past it. This is different from using the
nosave command, which will only avoid saving the current turn to the undo stack. So if you have:
[> Player | no SkipUndo] -> noundo wipe
[> Player | SkipUndo] -> noundo yes
[> Player | SkipSave] -> nosave
It will skip each turn after you walked off a
SkipSave object when undoing, and you will be unable to rewind to any turns you did before stepping on the
SkipUndo button.
Example available here.