From 324346a87c114f0991a092ac8653afecada364b5 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 5 Jul 2021 11:58:29 -0400 Subject: Added background scripts 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. --- src/map.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 7300e76..48c0223 100644 --- a/src/map.h +++ b/src/map.h @@ -28,6 +28,7 @@ struct Prototype { Direction dir = Direction::down; std::string interactionScript; std::string bumpPlayerScript; + std::string backgroundScript; bool shadow = false; bool wander = false; int movementSpeed = -1; -- cgit 1.4.1