Comprehensive list of scripts introduced in TCB:
* Activate item at:
Works immediately, except for turn 0. Note that this is merely an upgraded version of "
Strike orb at"
. The script was renamed because in 3.0 and after, more elements were introduced for the script to interact with, which includes bombs, pressure plates, lights (only turns on/off, cannot change color), powder kegs, tokens, and seeding beacons.
* Ambient sound:
Works immediately. Allows you to select a custom sound that is equally audible (100% volume) across the entire room. Note that you can also customize whether it plays in a loop or not, which is ideal for custom environmental ambient sounds.
* Ambient sound at:
Works immediately. Almost identical to the above command, except the volume will vary with the player's distance to the specified location, so the sound will appear quieter the farther away the distance.
* Answer option:
Does not work without a question command, and must be before it and not after. Allows you to specify the text the player will see at the top, and the label the script will jump to at the bottom.
* Appear at:
Works the same as the classic Appear command, but this time allows you to specify a coordinate location different from where the NPC currently is. Note that if the character is already visible, nothing will happen.
* Build marker (for citizens and engineers):
Works immediately. Allows to specify any of the objects from the first three tabs, except for tarstuff, scrolls, obstacles, checkpoints and lights (all types, whether obstacle, wall light, or ceiling light/ceiling darkness). Once your item is selected, you are allowed to specify the rectangular region to apply the item to. You can also specify "
remove item"
or "
remove floor layer item"
as well as "
none"
.
* Cut scene:
Works immediately. Prevents the player from moving and makes turns pass by in the specified amount of milliseconds per turn. Note that if the number is "
0"
, the cut scene ends and the player regains control.
* Else if:
Has both an Else and If condition programmed inside it. Useful for complex control blocks with multiple if conditions rather than a simple "
If"
and "
Else"
.
* Go to level entrance:
Works immediately, except during turn 0. Removes the player from the current room and teleports them to the specified entrance. The option "
End hold"
gives the player the hold ending statistics screen. Note that there is an option to skip the entrance description screen as well before you specify the entrance.
* If End:
Signifies the end of an If conditional, so the code after will run independent of the condition.
* Imperative:
Works immediately, except for turn 0. Gives the character a special trait from a drop down menu:
Vulnerable: the character can be killed by any of the usual means, including sword.
Invulnerable: The character cannot be killed by any means except being dropped from a platform or bridge, or briar.
Critical hero: The same as vulnerable, except the player fails if the character is killed (think Halph).
Required target: The character is required to be killed to complete the room. This imperative will not work if there are no required non-NPCs in the room on turn 0 (roaches, goblins, rock golems snakes etc.).
Safe: The character cannot kill the player by stepping on them (default for all).
Sword safe to player: If the character is armed, the sword will not kill the player, although it will still be an obstacle.
Deadly: The character will kill the player if the script requires them to move in the same space they occupy.
Die: The character dies immediately with a blood splatter sound and effect.
Die special: Only works for rock golems and fegundoes. Fegundoes explode and leave an ash (note that the fegundo that respawns is no longer an NPC, but a regular monster fegundo), and rock golems leave behind a rubble pile.
End when killed: The script will automatically end permanently when the NPC dies.
Direct only-beelining: Uses Rock Golem or Wubba pathfinding when navigating obstacles, so that if an obstacle is in its way it will wait rather than find a way around it.
Normal beelining: Uses roach pathfinding when navigating obstacles, meaning that it will slide vertically when it encounters a diagonal obstacle in its path, or slide horizontally if all vertical moves are blocked.
Flexible beelining: Uses seep pathfinding when navigating diagonal obstacles, meaning that it will determine whether horizontal or vertical sliding is more appropriate based on the distance to the location it wants to end at. Note that this is the default pathfinding algorithm for NPCs.
Smart beelining: Uses aumtlich or construct pathfinding, which means that it uses flexible beelining, but will also move diagonally if a vertical or horizontal obstacle is in its way.
Pathfinding (open only): Follows the shortest path possible to its destination, except if the location is blocked off from every possible path, in which case it will wait.
Pathfinding: Like open only, but if no open paths are found, it will use normal beelining rather than waiting.
Brain pathmap obstacle: Brains will treat the NPC as an obstacle when calculating paths for other monsters. Note that this does not affect pathfinding behavior of NPC's with "
Pathfinding"
imperatives, because they are separate although similar algorithms.
Not brain pathmap obstacle: Brains will attempt to guide monsters through the NPC, rather than calculating around it. This is the default imperative for NPCs.
NPC pathmap obstacle: Other NPC's will calculate around it when pathfinding.
Not NPC pathmap obstacle: Other NPC's will attempt to move through it rather than calculating around it (default imperative).
Ghost display: If the character is invisible, its image will appear at its location on the checkpoint layer, so objects from the third tab or fourth tab will be drawn over it.
No ghost display: If the character is invisible, it will not be drawn (default).
Ghost display overhead: Like ghost display, except it will be drawn at the topmost layer, so that it will be drawn over the third and fourth tab objects rather than under.
Not pushable: Weapons that push (IE: staff, caber, pickaxe front, etc) will not be able to move the NPC. Note that this means it will not be stunnable either, because stuns only work if you can push monsters.
Default pushable behavior: Weapons that push will be able to move the NPC.
Pushable by body: Uses the push algorithm of mirrors and powder kegs, so the player, mimics, constructs, and human or humanoid NPC's except for goblins and golems will be able to push it by bumping into it, provided there is an open space to move to.
Pushable by weapon: Weapon attacks that normally smite will instead push the NPC. Note that because the dagger does not physically occupy a tile the way the other weapons do, it will not push.
Stunnable: Uses the stunning rules when pushed (IE: if it is pushed against an occupied space, it will stun for only that turn, but if it is pushed into an empty space, it will stun for an extra turn after).
Not stunnable: Will not stun when pushed. However, the NPC will not move every turn that it is pushed.
* Move:
Works almost exactly like Move to. However, instead of allowing you to specify an exact location, it instead allows you to specify a relative number of spaces to move from its current location, with a negative amount in West/East meaning west, and a positive amount meaning east. and a negative amount in North/South meaning north, and a positive amount meaning south.
* Play video:
Works immediately. Plays a video file with the northwest corner of the file being at the specified x and y coordinates. Note that currently, only OGG theora formats are supported.
* Set appearance:
Works immediately. Changes the NPC's appearance to the specified character, and also assumes its hardcoded imperatives/traits (so a Goblin with set appearance Fegundo, for example, will automatically be allowed to fly, and a Fegundo that sets appearance Goblin will automatically be forbidden from going over pit and water).
* Set music:
Works about the same as JtRH, except now you can select custom WAV and OGG tracks, as well as reset the music to the default music of the location.
* Set player role:
Works immediately. Changes the player's role from the default Beethro to another role, with the traits of the player roles discussed above.
* Set player stealth:
Works immediately. Changes the player role's stealth trait to either its default state, automatically On, or automatically Off if it is On by default (Beethro, Gunthro, and Stalwarts/Soldiers). Note that power tokens will override the setting with "
On."
* Set var:
Works immediately. Allows you to specify a variable name and add it to the list, delete a variable from the list (note that the default variables beginning with _ are hardcoded and cannot be deleted), and use mathematical operations on a variable. In particular these are:
Assign: Overrides the variable's value with a specific number.
Assign text: Overrides the variable's value with a text string.
Add text: Adds a text string to the variable's value.
Add: Adds a specific number to the variable's current value.
Subtract: Subtracts a specific number form the variable's current value.
Multiply: Multiplies the variable's current value with a specific number.
Divide: Divides the variable's current value by a specific number, and returns the rounded down integer value if the result is a decimal, so the remainder is discarded.
Modulo: Like divide, except returns the remainder rather than estimated quotient.
The default variables are:
_MyWeapon, which controls the NPC's weapon type. Note that only 0-5 are recognized values.
_MyX, which controls the NPC's X-coordinate. Note that only 0-37 are recognized values, as that is how long in X-units each room is.
_MyY, which controls the NPC's Y-coordinate. Note that only 0-31 are recognized values, as that is how long in Y-units each room is.
_MyO, which controls the NPC's orientation. Note that only 0-7 are recognized values, because there are only 8 possible directions an NPC can face in DROD.
_MyScriptX, which overrides the X-coordinate of location-dependent scripts like "
Move to"
or "
Activate item at"
with the specified value. Note that it is subject to the same constraints as _MyX, and also allows you to specify -9999 as a value to delete the override.
_MyScriptY, which overrides the Y-coordinate of location-dependent scripts. Note that it is subject to the same constraints as _MyY, and allows you to specify -9999 to delete the override.
_MyScriptW, which overrides the parameter in certain scripts. I will talk more in depth about this and the next two variables later. Note that -9999 deletes the override.
_MyScriptH, which functions similar to _MyScriptW.
_MyScriptF, which functions similar to _MyScriptW and _MyScriptH.
_X, which is similar to _MyX, except specifies the player's X-coordinate instead of the NPC's.
_Y, which is similar to _MyY, except specifies the player's Y-coordinate instead of the NPC's.
_O, which similar to _MyO, except specifies the player's orientation instead of the NPC's.
_RoomImageX, which specifies the X-coordinate custom floors, walls, and pits use for the upper-left corner.
_RoomImageY, which specifies the Y-coordinate custom floors, walls and pits use for the upper-left corner.
_OverheadImageX, which is the same as _RoomImageX except for Overhead images rather than custom ground-layer tiles.
_OverheadImageY, which is the same as _RoomImageY except for Overhead images rather than custom ground-layer tiles.
_ThreatClock, which determines how the Threat Clock is displayed on the side of the screen. The values allowed are 0 for default, 1 for always hide, 2 for always show, 3 for backwards counting (so the clock goes counterclockwise each turn rather than clockwise), 100-129 making it freeze at a specific turn (0-29 respectively), and 200-229 making it freeze at a specific half-tick (0-29 respectively).
_LevelName, which allows you to change the level's name.
_PlayerLightType, which allows you to specify a number less than 0 for "
always off"
, 0 for "
default circle light"
, and 1-100 to determine the focus strength of a flashlight that goes in the same direction as the player.
_PlayerLight, which uses the algorithm "
16 * (intensity-1) + light color"
with intensity being a value from 1 to 8, and light color being a hue value from 1 to 16. This means doing the math, the lowest possible value would be 0 which the default, and the highest possible value would be 128.
_ReturnX and _ReturnY I am not sure do anything yet.
* Wait for entity type:
Allows you to specify any 1x1 living entity to wait for in the given area, rather than the more limited "
Wait for entity"
option.
* Wait until var:
Waits for a variable condition to be true before proceeding with the script. The condition options are equal to value, equal to text string, lesser than value, lesser than or equal to value, greater than value, greater than or equal to value, or not equal to value.
* Wait while entity type:
Similar to "
wait for entity type"
, except waits for the specified entity to not be in the given area.
* Wait for event:
Works the same as in JtRH, except there are many new event options to check for. In particular, these new conditions are:
Ash turns to fegundo: Waits for a fegundo ashes to turn back into a fegundo.
Briars grew: Waits for a briar root to create briar or grow existing briar.
Construct reanimated: Waits for a construct to revive.
Cut briar: Waits for a brair or root to be destroyed with a pickaxe.
Double placed: Waits for a clone, mimic, or decoy to be placed.
Fegundo turns to ash: Waits for a fegundo to explode into ashes.
Fire trap activated: Waits for a fire trap to be toggled either via orb or pressure plate.
Fire trap burning: Waits for a fire trap to be active.
Floor spikes poised: Waits for the turn before floor spikes pop.
Floor spikes sprung: Waits for the turn floor spikes pop.
Fluff destroyed: Similar to "
Tarstuff destroyed"
, except checks if any fluff in the room is destroyed.
Fluff puff destroyed: Waits for a Puff to die either from pushing or stepping on a target.
Gel baby formed: Works the same way as for Tar or Mud babies.
Gel growth: Works the same way as Tar or Mud growth.
Light toggled: Waits for an obstacle light to be toggled, either using a pressure plate or orb.
Mirror shattered: Waits for a stab to destroy a mirror.
Monster burned: Waits for a monster to burn on a hot tile.
Object built: Waits for a citizen or engineer to build an object.
Object fell: Waits for an object to fall off either a bridge or platform.
Orb damaged: Waits for a cracked orb to be struck.
Player frozen by gaze: Waits for an aumtlich gaze to stun the player.
Player uses special command: Waits for the player to hit the special command key.
Pressure plate activated: Waits for something to press on a pressure plate:
Pressure plate released: Waits for something to release a pressed pressure plate.
Puff merged into fluff: Waits for a group of puffs to form into fluff.
Roach egg hatched: Waits for roach eggs to turn into roaches.
Roach egg spawned: Waits for roach queens to spawn eggs.
Room conquered: Works the same way as "
wait for clean room"
.
Seeding beacon activated: Waits for an inactive seeding beacon to be turned on.
Seeding beacon deactivated: Waits for an active seeding beacon to be turned off.
Splash: Waits for something to fall into water.
Tar destroyed: Similar to tarstuff stabbed, except that any tarstuff removal counts, and not simply weapon strikes.
Thin ice melted: Waits for thin ice to be dropped, whether over deep or shallow water.
Token toggled: Waits for a token to be stepped on/activated.
Although this seems like a lot, I will be talking about 4.0 and 5.0 scripts in my next post on this thread, which is even more comprehensive.
____________________________
Please feel free to test the ultimate JtRH tribute:
Journey to the Fabled Kingdom today!