summary refs log tree commit diff stats
path: root/src/script_system.h
Commit message (Collapse)AuthorAgeFilesLines
* Added background scriptsStar Rauchenberger2021-07-051-1/+4
| | | | Background scripts are scripts that are launched when a map is loaded. They differ in use from a map's init script in that they are expected to contain an infinite loop. These scripts are linked to a sprite and will be killed when that sprite is destroyed (usually when the map is unloaded, but if the sprite is made persistent then it may last longer). The thread running the script is given no warning that it is being killed; the coroutine is simply never called again, and the thread is disposed of. Because of this, background scripts MUST ensure the game is in a consistent state before coroutine yielding, because it is not guaranteed that the coroutine will ever be called again.
* Added debug info to Script objectStar Rauchenberger2021-03-131-0/+1
|
* Added map init scriptsKelly Rauchenberger2021-02-241-0/+4
| | | | Map scripts also now actually run in their own lua thread.
* Multiple scripts can be run at onceKelly Rauchenberger2021-02-211-1/+7
| | | | And they're all on their own threads again. This is mostly so debug commands can be run during execution of other scripts. But it can also be useful for map init scripts (if we want a script to run whenever a map is loaded, even though map loading is usually done by a script).
* Debug commands run inside a coroutine now yay!Kelly Rauchenberger2021-02-211-1/+0
| | | | Also it turns out you totally don't need the runner thread.
* Added a debug consoleKelly Rauchenberger2021-02-211-0/+2
| | | | | | | | Open it by pressing backtick, close it by hitting escape. Pressing backtick does not open it in release builds. Current shortcomings: opening it for the first time also types a backtick for some reason, but not on subsequent times. Also, it doesn't create a coroutine, so any script function that yields is going to fail. This also added a "is gameplay paused" flag to Game, which will be useful for adding a pause menu.
* Scripts are organised per-map nowKelly Rauchenberger2021-02-121-1/+1
|
* Created script systemKelly Rauchenberger2021-02-051-0/+32