EvilEngine/SCRP

A script is essentially a timeline of events. It contains a list of events that are set to play at specific times after the script has started running.

To start running a script, send the Run event to it. When a script is finished sending its events, it will send Expired to itself. You can also send Expired to the script to manually stop it. You must send either Reset or ScriptReset to the script before you can run it again. ScriptReset is essentially a faster version of Reset, because it doesn't go through the process of resetting the entire script object, just the script's internal state.

Scripts can also be instructed to pause execution, with the WaitForInput event. When a script receives this event, it will stop executing events until the player presses the Y button (GameCube/Xbox) or Triangle button (PS2), then it will pick up sending events from where it left off.

Scripts also have a Start Time setting, which allows you to set a time offset that the script will seek to when it starts running. Any events set before the Start Time will not be run. This can be useful for debugging, other than that there's not much practical use for this setting.

AR Code for BFBB
Scripts were not officially supported in Heavy Iron games until The SpongeBob SquarePants Movie, but there is leftover code for Scripts present in Battle for Bikini Bottom. However, the game does not process SCRP assets by default. An AR code must be used for Scripts to function correctly (note that this removes support for ITEM assets, another unused asset type in BFBB):

Add SCRP support (GameCube NTSC) 0428a998 53435250 040b5590 41820044

xScriptAsset
xScriptAsset is the data structure that defines the format for SCRP assets. It inherits from xBaseAsset (8 bytes long).

SCRP assets store an array of xScriptEventAssets at offset 0x14, followed by its array of links.

xScriptEventAsset
xScriptEventAsset defines the format for timed events in SCRP assets.