-
Notifications
You must be signed in to change notification settings - Fork 4
RSSE VM (Ride & Sideshow Script Engine Virtual Machine)
Theme Park World uses a stack-based VM in order to give rides and sideshows their functionality. This VM reads from the RSSE format, and includes over 100 instructions.
The following variables are part of a "common variable set" that must be contained within every ride (these do not apply to features).
-
VAR_LETMEON
(0) - First ID of visitor in ride queue -
VAR_LETMEOFF
(1) - First ID of visitor wishing to leave -
VAR_CAPACITY
(2) - How many visitors can use the ride at once -
VAR_DURATION
(3) - The time for the ride to run for -
VAR_BREAKSTAT
(4) - Whether the ride is broken (1) or not (0) -
VAR_ONRIDE
(5) - The number of visitors on the ride -
VAR_RIDECLOSED
(6) - Is the ride closed? (0/1) -
VAR_BROKEN
(7) - Is the ride broken? (0/1) -
VAR_WORN
(8) - How worn is the ride? -
VAR_RUNNING
(9) - Is the ride running? (0/1) -
VAR_PAD
(10) - Unused -
VAR_PARAM
(11) - Sideshows: Determine whether the current visitor will win (1) or lose (0)
- Sign flag
- 1 for negative value
- 0 for positive value
- Zero flag
- 1 for zero
- 0 for not zero
NOP
- This performs no operation, essentially wasting 1 cycle.
None
CRIT_LOCK
- Locks a ride, preventing visitors from accessing the ride until unlocked.
None
COPY <dest> <source>
- Copy a value from one variable to another.
COPY <dest> <value>
- Set a variable's value.
<dest>
- The destination for the instruction's result.
<value>
- The value to copy.
<source>
- The source containing the value to copy.
SETLV <unknown>
- Unknown
Unknown
SUB <value> <value> <dest>
- Subtract one value from another.
SUB <source> <value> <dest>
- Subtract a value from a variable.
SUB <value> <source> <dest>
- Subtract variable's value from a value.
SUB <source> <source> <dest>
- Subtract one variable from another.
Upon performing this calculation, the relevant flags will be set based on the calculation's result.
<dest>
- The destination for the instruction's result.
<value>
- The value to subtract.
<source>
- The source containing the value to subtract.
ENDSLICE
- Unknown
Unknown
GETTIME <dest>
- Gets the time that the ride has been alive for.
<dest>
- The destination for the instruction's result.
ADDOBJ <type> <parameter> <id> <slot>
- Add an object of a specific type to the ride.
<type>
- The type of object to add.
<parameter>
- Unknown
<id>
- The ID of the object to add.
<slot>
- The 'slot' within the current ride to add the new ride.
ADDOBJ_EXT <unknown1> <unknown2> <unknown3> <unknown4> <unknown5>
- Unknown
Unknown
KILLOBJ <slot>
- Remove an object of a specific slot type.
<slot>
- The slot of the desired object.
FADEOBJ <slot>
- Fade out an object, and then remove it.
<slot>
- The slot of the desired object.
SETOBJPARAM <slot> <parameter> <value>
- Set a sub-object's parameters.
<slot>
- The slot of the desired object.
<parameter>
- The parameter to change.
<value>
- The desired value of the parameter.
EVENT <type> <unknown> <event>
- Trigger an in-game event.
<type>
- The type of the event.
<unknown>
- Unknown
<event>
- The event?
EVENT_EXT <unknown1> <unknown2> <unknown3> <unknown4>
- Unknown
Unknown
FLUSHANIM
- Stop all active animations
None
TRIGANIM <unknown1> <unknown2> <unknown3>
- Unknown
Unknown
WAITANIM <type> <unknown>
- Start playing an animation, and wait for it to end before continuing.
<type>
- The type of animation to play
<unknown>
- Unknown
LOOPANIM <type> <unknown>
- Start playing an animation on loop
<type>
- The type of animation to play
<unknown>
- Unknown
TRIGWAITANIM <unknown1> <unknown2> <unknown3>
- Unknown
Unknown
GETANIM <unknown>
- Unknown
Unknown
TRIGANIMSPEED <unknown1> <unknown2> <unknonw3> <unknown4>
- Unknown
Unknown
FLUSHANIM_CH <unknown>
- Unknown
Unknown
TRIGANIM_CH <unknown1> <unknown2> <unknown3> <unknown4>
- Unknown
Unknown
WAITANIM_CH <unknown1> <unknown2> <unknown3>
- Unknown
Unknown
LOOPANIM_CH <unknown1> <unknown2> <unknown3>
- Unknown
Unknown
TRIGWAITANIM_CH <unknown1> <unknown2> <unknown3> <unknown4>
- Unknown
Unknown
GETANIM_CH <unknown1> <unknown2>
- Unknown
Unknown
RAND <dest> <max value>
- Generate a random number.
<dest>
- The destination for the instruction's result.
<max value>
- The highest value to generate.
JSR <subroutine>
- Jump to a subroutine.
<subroutine>
- The destination subroutine to jump to.
RETURN
- Return to the previous subroutine (after the last JSR
).
None
BRANCH <location>
- Branch to another location.
<location>
- The branch to execute.
BRANCH_Z <location>
- Branch to another location if the "zero" flag has been set.
<location>
- The branch to execute.
BRANCH_NZ <location>
- Branch to another location if the "not zero" flag has been set.
<location>
- The branch to execute.
BRANCH_NV <location>
- Branch to another location if the "negative value" flag has been set.
<location>
- The branch to execute.
BRANCH_PV <location>
- Branch to another location if the "positive value" flag has been set.
<location>
- The branch to execute.
DBGMSG <unknown>
- Unknown
Unknown
NAME <value>
- Set the current script's name (likely used for debugging purposes).
<value>
- The new name for the script.
TEST <value>
- Set flags depending on the value given.
This instruction will modify all flags, which can then be used to execute different branches depending on <value>
.
<value>
- The value to test.
CMP <value / variable> <value / variable>
- Compare two values (using a bitwise AND), and set any flags according to the result.
Upon performing this calculation, the relevant flags will be set based on the calculation's result.
<value / variable>
- A value or variable to compare.
PUSH <value>
- Push a value to the stack.
<value>
- The value to push onto the stack.
POP
- Pop a value from the stack.
None
HUSH <unknown>
- Unknown
<unknown>
- Unknown
HOP <unknown>
- Unknown
<unknown>
- Unknown
WAIT <time>
- Wait for a specified period of time.
<time>
- The length of time to wait for (cycles / slices / milliseconds?)
WAITABS <unknown>
- Unknown
Unknown
WAIT4ANIM
- Wait for all of the currently playing animations to finish.
None
ADD <source> <value>
- Add a value to the value of a variable.
Upon performing this calculation, the relevant flags will be set based on the calculation's result.
<source>
- The source containing the value to add, and the destination for the result.
<value>
- The value to add.
MULT <unknown1> <unknown2> <unknown3>
- Multiply values (not used in any existing rides)
Upon performing this calculation, the relevant flags will be set based on the calculation's result.
Unknown
DIV <value> <value> <dest>
- Divide one value by another.
DIV <source> <value> <dest>
- Divide a variable by a value.
DIV <value> <source> <dest>
- Divide a value by a variable's value.
DIV <source> <source> <dest>
- Divide one variable by another.
Upon performing this calculation, the relevant flags will be set based on the calculation's result.
<dest>
- The destination for the instruction's result.
<value>
- The value to divide.
<source>
- The source containing the value to divide.
MOD <value> <value> <dest>
- Get the remainder of a division of one value from another.
MOD <source> <value> <dest>
- Get the remainder of a division of a variable by a value.
MOD <value> <source> <dest>
- Get the remainder of a division of a value by a variable's value.
MOD <source> <source> <dest>
- Get the remainder of a division of one variable by another.
Upon performing this calculation, the relevant flags will be set based on the calculation's result.
<dest>
- The destination for the instruction's result.
<value>
- The value to perform modulo on.
<source>
- The source containing the value to perform modulo on.
TURBO <value>
- Unknown
<value>
- Unknown [0..1]
END
- Unknown
None
TOUR <command> <params>
- Call a tour ride command (with parameter if applicable)
<command>
- The command to use
<params>
- The parameter(s) to give to the command
-
1
: Set style of ride -
4
: Let off visitor -
3
: Let on visitor -
5
: Number of cars -
6
: Unused ("Unknown tour ride command") -
7
: Unused ("Unknown tour ride command") -
8
: Set time to fly for (in milliseconds) -
9
: Set ride wear status-
1
: Ok -
2
: Worn -
3
: Breaking down -
4
: Condemned
-
-
10
: Check if there is a car in the station (sets flags) -
11
: Activate launch / start flight -
12
: Set whether ride uses runway type of approach (0/1) -
14
: Set whether ride is open (0/1) -
15
: Check if there is a broken car in the station (sets flags) -
16
: Set whether the ride is running (0/1) -
17
: Set size of car (1024 == 1)
BUMP <command> <params>
- Set bumper ride properties, and set flags where appropriate.
<command>
- The ID of the property being set
<params>
- The value to assign to the property
-
1
(BUMP_PEEPON
): Add visitor to ride -
2
(BUMP_PEEPOFF
): Get visitor from ride -
3
(BUMP_STARTRACE
): Start the race -
4
(BUMP_LAUNCHCAR
): Launch car -
5
(BUMP_ISTRACKVALID
): Get whether the track is valid (sets flags) -
6
(BUMP_CLOSERIDE
): Close the ride -
7
(BUMP_OPENRIDE
): Open the ride -
8
(BUMP_SETBROKEN
): Set whether the ride is broken (0/1) -
9
(Unnamed?): Set whether the ride is worn or not -
10
(BUMP_HALTRIDE
): Eject all visitors from the ride -
11
(BUMP_CARSONRIDE
): Get whether there are cars on the ride (0/1) -
12
: Unknown -
13
: Unknown -
14
(BUMP_SETLAPS
): Set the number of laps -
15
: Unused ("Unknown bumper ride command") -
16
: Unknown -
17
(BUMP_WATERCLOSED
): Set whether water is flowing (0 - flowing / 1 - not flowing)
COAST <id> <value>
- Set coaster ride properties, and set flags where appropriate.
<id>
- The ID of the property being set
<value>
- The value to assign to the property
-
COAST_ADDPEEP
- Let on visitor -
COAST_GETQUEUE
- Gets the number of people in the ride's queue -
COAST_GETPEEP
- Gets the number of people on the ride -
COAST_SETBROKE
- Set's the coaster's broken state -
COAST_SETCLOSED
- Sets the coaster's open/closed state -
COAST_SETCAPACITY
- Sets the coaster's capacity -
COAST_SETWORN
- Sets the coaster's wear rating -
COAST_INITIALISE
- Initialises the coaster
ADDHEAD <visitor ID>
- Add a visitor (head only) to the ride.
<visitor ID>
- The ID of the visitor to add.
DELHEAD <visitor ID>
- Remove a visitor from the ride.
<visitor ID>
- The ID of the visitor to remove.
LIMBO <visitor ID> <unknown>
- Send a visitor into limbo.
<visitor ID>
- The ID of the visitor to send into limbo.
<unknown>
- Unknown (possibly related to LIMBOSPACE
, but may also be duration)
UNLIMBO <visitor ID>
- Remove a visitor from limbo.
<visitor ID>
- The ID of the visitor to remove from limbo.
FORCEUNLIMBO <visitor ID>
- Forcefully remove a visitor from limbo.
<visitor ID>
- The ID of the visitor to remove from limbo.
INLIMBO <unknown>
- Unknown
<unknown>
- Unknown.
LIMBOSPACE <unknown>
- Unknown
<unknown>
- Unknown.
SPAWNCHILD <file name>
- Add a child script to the current script (max. 1 child)
<file name>
- The path to the desired script.
SPAWNSOUND <file name>
- Add a child script to the current script (max. 1 child) - likely somewhat different from SPAWNCHILD
, but unknown.
<file name>
- The path to the desired script.
REMOVECHILD
- Remove an existing child script.
None
SETVARINCHILD <variable ID> <value>
- Set the value of a variable in the current script's child.
<variable ID>
- The ID of the desired variable.
<value>
- The desired value to set.
GETVARINCHILD <dest> <variable ID>
- Get the value of a variable in the current script's child.
<variable ID>
- The ID of the desired variable.
<dest>
- The destination for the value of the desired variable.
SETVARINPARENT <variable ID> <value>
- Set the value of a variable in the current script's parent.
<variable ID>
- The ID of the desired variable.
<value>
- The desired value to set.
GETVARINPARENT <dest> <variable ID>
- Get the value of a variable in the current script's parent.
<variable ID>
- The ID of the desired variable.
<dest>
- The destination for the value of the desired variable.
BOUNCESETNODE <node>
- Unknown
Unknown
BOUNCESETBASE <base>
- Unknown
Unknown
BOUNCE <visitor ID> <unknown>
- Unknown
Unknown
UNBOUNCE <visitor ID>
- Unknown
Unknown
FORCEUNBOUNCE <visitor ID>
- Unknown
Unknown
BOUNCING <visitor ID>
- Unknown
Unknown
WALKON <visitor ID> <unknown1> <unknown2> <unknown3> <unknown4> <action> <unknown5>
- Unknown
Unknown
WALKOFF <visitor ID>
- Unknown
Unknown
WALKGET <dest>
- Unknown
Unknown
WALKST_FLOAT <unknown1> <unknown2> <unknown3>
- Unknown
Unknown
WALKFLOATSTAT <unknown>
- Unknown
Unknown
WALKFLOATSTOP
Unknown
ENABLELIGHT <unknown>
Unknown
DISABLELIGHT <unknown>
Unknown
SETLIGHT <unknown>
Unknown
COLOURLIGHT <unknown1> <unknown2> <unknown3> <unknown4>
Unknown
STARTSCREAM <visitor ID> <unknown>
- Unknown, likely causes a visitor to scream.
Unknown
STOPSCREAM
None
SINGLESCREAM <visitor ID> <unknown>
SCREAMLEVEL <level>
<level>
- The desired ride scream level (from 0 to 100).
FINDSCRIPTRAND <ride / object name> <dest>
GETREMOTEVAR <unknown1> <unknown2> <unknown3>
Unknown
SETREMOTEVAR <script ID> <variable ID> <value>
- Set the value of another script's variable.
<script ID>
- The ID of the script containing the desired variable.
<variable ID>
- The ID of the desired variable.
<value>
- The desired value of the variable.
REPAIREFFECT <value>
- Show or hide repair effect.
<value>
- 0 or 1: 0 for hide, 1 for show.
GETCUSTPTCLCODE <unknown1> <unknown2>
- Unknown
Unknown
SETTIMER <time>
- Unknown
Unknown
GETTIMER <unknown>
- Unknown
Unknown
YEAR <dest>
- Get the current in-game year, and put it in the destination variable.
<dest>
- The destination variable for the instruction's result.
MONTH <dest>
- Get the current in-game month, and put it in the destination variable.
<dest>
- The destination variable for the instruction's result.
DAY <dest>
- Get the current in-game day, and put it in the destination variable.
<dest>
- The destination variable for the instruction's result.
HOUR <dest>
- Get the current in-game hour, and put it in the destination variable.
<dest>
- The destination variable for the instruction's result.
MIN <dest>
- Get the current in-game minute, and put it in the destination variable.
<dest>
- The destination variable for the instruction's result.
SEC <dest>
- Get the current in-game second, and put it in the destination variable.
<dest>
- The destination variable for the instruction's result.
SETREVERB <level>
- Set the reverb level used for any sounds that output from this ride.
<level>
- The desired reverb level, from 0 (no reverb) to 10 (max reverb).
DIPMUSIC <value>
- Mute or unmute music.
<value>
- 0 or 1: 0 for unmute, 1 for mute
SPARK <unknown1> <unknown2> <unknown3> <unknown4>
Unknown