Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Any chance for an updated scripting guide?
New Topic New Poll Post Reply
Poster Message
Kalin
Level: Master Delver
Avatar
Rank Points: 221
Registered: 01-25-2016
IP: Logged
icon Any chance for an updated scripting guide? (+1)  
I'm interested in learning scripting, but this is 3 major versions out of date and I couldn't find anything more recent (except some stuff for _MyScript variables). Since 5.2 will add even more changes, it would probably be useful to work on a new guide during testing.

Discussion of monster roles would be very helpful too, re:
skell wrote:
There are about a billion inconsistences between monsters and their respective character roles.
(When playing Flight of the Fegundo, I was very disappointed in the lack of self-immolation.)

Results so far:
2.0 Guide (by schep)
3.0 Guide (by azb)
Player Roles (by azb)
4 - 5.0 Guide (by azb)
5.2 Help File (draft)

____________________________
he/him
~170th Skywatcher

[Last edited by Kalin at 11-22-2020 03:02 PM]
11-19-2020 at 06:41 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
azb
Level: Smiter
Rank Points: 494
Registered: 03-08-2014
IP: Logged
icon Re: Any chance for an updated scripting guide? (+2)  
I can help provide TCB and TSS scripts as well, but since that is more complicated/extensive, I think it would be easier to break everything you requested into chunks, with the first post being player roles, and the second and third posts being scripts introduced in the TCB and TSS era.


For player roles, many of them follow a similar pattern with regards to killing and being killed:

* Unarmed, floor-bound, required-for-room-clear monster roles (Roach, Queens, Evil Eyes, Spiders, Goblins, Golems etc) step on their targets to kill, except if their target is on an unreachable surface (such as water skippers, skipper nests, seep and tarstuff mothers), or is a sword-invulnerable monster, such as Golems, Wubbas, snakes, or normal Fegundoes (note ashes are still killable). Strangely, citizens can be stepped on, even though they cannot be struck by a sword.

* Wall-bound roles (Seep only currently) work the same way, except they can only move on walls, so they can only step to kill on other seep - every other monster is unreachable.

* Water-bound roles (Water skippers only currently) work like seep, except that the surface they are restricted to is water rather than wall

* Flying, sword vulnerable roles (Wraithwings only currently) work like floor-bound roles, except they can travel over pits and water as well.

* Flying, sword-invulnerable roles (Fegundoes only currently) work like their vulnerable counterpart, except they will not die to sword strikes or being eaten by other monsters. Note that adders are an exception to this.

* Wubbas cannot step on other monsters, nor can other monsters kill them with the sole exception of Adders.

* NPC-exclusive roles (Citizen 1-4, Negotiator, Tar Technician, Mud Coordinator, Goblin King) mostly work like Citizen role, with the exception of the Goblin King, who works like a regular Goblin.

* Every sworded role except for Slayers work like Beethro.

* Slayers combine sworded role properties with floor-bound monster properties.

* Halph roles work like NPC roles.

* Gunthro works like Beethro.

* Puff works like Fegundo.

* Construct works like the other floor-bound roles, except that it will die when it steps on oremites.

With regards to stealth:

* Every role except for Beethro (default), Gunthro, Soldier and Stalwart will start off as stealthy by default, and will be lost as soon as they either kill a monster or step on a power token. Notice that the killing has to be done firsthand and not using environmental hazards, so Citizen or Halph roles would not be able to lose their stealth this way because they cannot step on or smite monsters.

With regards to shallow water properties:

* Most floor-bound unarmed roles will not be able to enter by default, but Spiders, Rock Golems, and Gel Babies are the exception.

* Halph and Citizen/NPC roles will be able to wade by default.

* Most armed roles (including Slayer) will be able to wade by default, but Stalwarts will not be able to enter by default, and Beethro and Gunthro will hide by default.

* Roles that cannot fly over the water or swim through it (so every role except for Wrathwings, Fegundoes or skippers) will hide in the water once they step on a power token.

With regard to orb activation:

* Citizen/NPC roles and Halph roles will be able to activate orbs by bumping into them by default.

* Every other role will not be able to, but can once you step on a power token.

____________________________
Please feel free to test the ultimate JtRH tribute: Journey to the Fabled Kingdom today!

[Last edited by azb at 11-19-2020 11:53 PM]
11-19-2020 at 07:12 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Kalin
Level: Master Delver
Avatar
Rank Points: 221
Registered: 01-25-2016
IP: Logged
icon Re: Any chance for an updated scripting guide? (0)  
Thanks!

azb wrote: or is a sword-invulnerable monster, such as Golems, Wubbas, snakes, or normal Fegundoes
I'd like a different term here, maybe "inedible", since golems are definitely not "sword-invulnerable".

* Wall-bound roles (Seep only currently) work the same way, except they can only move on walls, so they can only step to kill on other seep - every other monster is unreachable.
Has anyone actually gotten player-seep to work? What happens if you try to leave the room?

* Flying, sword-invulnerable roles (Fegundoes only currently) work like their vulnerable counterpart, except they will not die to sword strikes or being eaten by other monsters. Note that adders are an exception to this.
Adders and waterskippers (there's at least one room in Flight of the Fegundo about this). I was very surprised that player-Fegundo could eat monsters, since normal ones clearly cannot.

Do player-queens lay eggs? Has anyone tried to get brain or tarstuff mother to work?

I know that clone potions copy your current form, but what happens with pre-placed clones?

____________________________
he/him
~170th Skywatcher

[Last edited by Kalin at 11-20-2020 12:23 AM]
11-20-2020 at 12:19 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Dragon Fogel
Level: Smitemaster
Rank Points: 2482
Registered: 06-21-2014
IP: Logged
icon Re: Any chance for an updated scripting guide? (+3)  
Player role seep can leave the room if there's a wall in the next room to move onto.

Player queens do not lay eggs. In general, the only abilities carried over from monsters to player roles are ones relating to floor tiles. So constructs drop trapdoors, tarstuff babies don't die on hot tiles, wubbas aren't harmed by spikes.

All clones take the form of the current player role. This even happens if you script a change of player role in a room with clones in it.
11-20-2020 at 01:33 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
azb
Level: Smiter
Rank Points: 494
Registered: 03-08-2014
IP: Logged
icon Re: Any chance for an updated scripting guide? (+2)  
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!
11-20-2020 at 02:09 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Kalin
Level: Master Delver
Avatar
Rank Points: 221
Registered: 01-25-2016
IP: Logged
icon Re: Any chance for an updated scripting guide? (+2)  
Wow, that was fast! Links added to first post.

azb wrote:
Comprehensive list of scripts introduced in TCB:
If we're organizing this by changes between versions, we should probably start with a list of deprecated commands. Like:
Invincibility -> Imperative Invulnerable
Strike Orb At -> Activate Item At

* Imperative:
Works immediately, except for turn 0.
Really? This is one thing I'd really want on turn 0.

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.
I've always wondered what people use this for.


____________________________
he/him
~170th Skywatcher

[Last edited by mrimer at 11-21-2020 03:47 PM]
11-20-2020 at 01:05 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
azb
Level: Smiter
Rank Points: 494
Registered: 03-08-2014
IP: Logged
icon Re: Any chance for an updated scripting guide? (+2)  
Comprehensive list of scripts introduced in 4.0 and 5.0+ eras up to now:

* Attack tile:

Works immediately for most objects, except the player on turn 0. Allows you to attack a tile, using the rules of the object selected. The options are:

Stab: Simulates a sword stab at the location.

Explosion: Simulates a bomb/fegundo/keg explosion at the location.

Damage: Damages the entity at the given coordinate. For most entities including the player, this works like "kill", but for snakes, it shortens them by one tile.

Kill: Kills/deletes the entity at the location. Note that for monsters that do not disappear when killed (rock golems, constructs and rock giants) they will leave behind what they normally leave behind when stabbed.

* Build:

Works the same as "build marker", except the specified item is built immediately in the given area.

* Challenge completed:

Works immediately. Provides a dialogue box in the upper left corner saying "Challenge completed: (your text here)". Also logs the challenge and turns plus time taken to complete it for CaravelNet players.

* Destroy Trapdoor:

Works immediately. Drops the trapdoor at the specified location, as if Beethro had stepped off of it.

* Display Filter:

Works immediately. Uses a Photoshop-style color adjustment to the room. The options are:

Normal: Removes the adjustment.

B+W: Removes all saturation/color, but the lighting values are still preserved.

Sepia: Like B+W, except all of the colors are converted to shades of brown rather than gray.

Negative: Inverts both color and lighting.

* Face towards like guard:

Works immediately except for turn 0. Uses the guard's orientation algorithm to determine the direction it should face, IE if it is directly in an orthogonal direction to its target it will face in that direction, but if it is in any degree between the four orthogonal directions, it will face the diagonal value between those, regardless of which one it is closer to. Note that this only works once by default, and you would have to script a loop to make it work like a real guard.

* Flashing message:

Works immediately. Displays a large message made of bubble letters in the center that grows slowly and then fades away. You can specify the text of the message, as well as the color of the text using hexadecimal values.

* Game effect:

Works immediately. Allows you to choose from any of the game's particle effects to put at a location, as well as the direction it should face if applicable, and whether to play sound or not if it has sound effects associated with it.

* Generate entity:

Works immediately, except for if the specified location is blocked, in which case it will make the script wait until the space is open. Allows you to choose any of the game's 1x1 entities to spawn at a specific location, including custom monsters you created, as well as the direction the entity should start facing.

* Get entity direction:

Works immediately. Returns an entity's orientation value at a specified point.

* Get natural target:

Works immediately. Returns the X and Y location of the target of the specified entity. Currently, "regular monster" is the only option.

* GoSub:

Similar to "Go to", except is used with the "Return" command for multiple scripts to happen at once.

* Image overlay:

Works immediately. Uses its own special scripting to display a custom image. In particular, these scripting options are:

CancelAll: Removes all effects from all layers.

CancelLayer (number): Removes effects from a specific layer, with 0-3 being valid numbers.

Center: Sets the image at the center coordinate of the room.

Display (ms): Displays the image for a specific amount of real-second milliseconds. Useful for custom particle effects.

DisplayRect (x) (y) (w) (h): Show a specific region of the image, with x and y controlling the x and y coordinates of the northwest point, and w and h controlling the width and height of the image in tiles starting at that point.

DisplaySize (w) (h): Shows a specific amount of the image in width and height, but this time in pixels rather than game tiles and always using the x and y coordinate of the original image (IE: the coordinates of the image in Photoshop).

DisplayTurns (number): Shows the image for a specific amount of game turns, rather than real-life milliseconds.

FadetoAlpha (alpha amount 0-255) (ms): Transitions the alpha from its current value to the specified value within the given time frame in milliseconds.

Grow (percent of current size) (ms): Resizes the image to the given percent in the given time frame in milliseconds.

Jitter (pixels) (ms): Randomly shakes the image in the given range of pixels (so more pixels equals more distance or a more stronger effect), in the given time amount of milliseconds.

Layer (layer number): Moves the image to the specified layer in the range 0-3. Note that this command only works once.

Loop (number): Loops the script a specific number of times. You can set the value to -1 to mean "endless/infinite."

Move (x pixels) (y pixels) (ms): Moves the image by a specific amount of horizontal and vertical pixels, in a given time frame in milliseconds.

MoveTo (x pixels) (y pixels) (ms): Similar to move, except that the x and y pixels are at an exact location rather than a direction relative to the current point.

Rotate (degrees) (ms): Rotates the image by the specified amount of degrees within the given time frame of milliseconds.

Scale (percent of current size): Similar to "Grow", except the scaling happens immediately rather than transitioning over time.

SetAlpha (alpha value 0-255): Similar to "FadetoAlpha", except the alpha is immediate rather than transitioning over time.

SetAngle (degrees): Similar to "Rotate", except the direction is applied immediately rather than transitioning over time. The other difference is that Rotate adds or subtracts degrees from the current position, while SetAngle is an absolute amount of degrees.

SetX (pixel): Sets the northwest corner of the image's X-coordinate.

SetY (pixel): Sets the northwest corner of the image's Y-coordinate.

SrcXY (x) (y): Similar to "DisplayRect", but does not allow you to specify a width or height, as the width and height will go until the right and bottom borders of the image in this case.

Note that the time sensitive commands may be prefixed with "p" before their name, meaning that it will run in parallel with the next commands rather than halting further execution until the effect is complete.

You can also substitute variable values rather than absolute numbers in the parameters above, using the format "$.variablename$". This last tidbit also works in any other text-based game script, such as scroll text, text for Flashing messages, text for Questions and Answer options, and text for speech dialog.

* Return:

Goes back to the most recent "GoSub" in the script. If there are multiple GoSubs and Returns, then the game will automatically sort from most to least recent to jump to. Note that this does not happen with classic "Go to" and "Label".

* Room location text:

Works immediately. Changes the text in the room banner from the default "Level name: room coordinates" to the specified text.

* Set shallow water traversal:

Works immediately except on turn 0. Changes the player role's shallow water status to the specified value. These value options are:

As player role: Uses the default rules for the current role.

Wades in water: Makes the player always wade.

Hides in water: Makes the player always hide.

Cannot enter: Makes the player unable to enter, treating it as if it were deep water.

Note that if the player steps on a power token, it will override the status with "Hides in water", except for flying and swimming roles.

* Start global script:

Works immediately. Starts the global script of a custom monster.

* Teleport Player to:

Works immediately. Teleports the player to the specified X and Y cooridnates.

* Teleport to:

Like "Teleport Player to", except teleports the NPC rather than player to the location.

* Wait for clean level:

Like "wait for clean room", but waits for the level to be considered clean rather than room.

* Wait for item:

Waits for one of the items from the "Build marker" list to be in the given area. Note that scrolls, wall lights, ceiling lights, ceiling darkness, and obstacles are also supported.

* Wait for no build marker:

Waits for no build markers to exist in the given area.

* Wait for open move:

Waits for an open space directly in front of the character in the specified direction.

* Wait for player to input:

Waits for the player to input a specific command, including the Special Command.

* Wait for someone to push me:

Waits for the NPC to be pushed, either by a weapon or a body if "Pushable by body" imperative is active.

* World Map Image Icon:

Draws an image on the world map screen at the given X and Y pixel coordinates that is linked to a specified level entrance, with the level name typically being spelled underneath it. Allows you to select from a few options for the way it is drawn:

Off: Makes the image invisible.

On: Makes the image visible and selectable.

Locked: Makes the image appear, but with a visible lock over it and not selectable.

Disabled: Makes the image appear, but not selectable and not with a visible lock indicating you cannot click it.

Image only: Makes the image appear, but without the level name underneath it and not selectable.

* World Map Music:

Sets the music of the world select screen.

* World Map Screen:

Allows you to determine from world maps which one you would like to display. Note that the world map itself is merely a PNG or JPEG image; the levels to select are all handled via scripting.

* World Map Tile Icon:

Similar to "World Map Image Icon", but uses a 1x1 character as the symbol rather than a custom image.

I can discuss how to make your own custom characters next, if you would like. Are you okay with that?

____________________________
Please feel free to test the ultimate JtRH tribute: Journey to the Fabled Kingdom today!
11-20-2020 at 01:14 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
azb
Level: Smiter
Rank Points: 494
Registered: 03-08-2014
IP: Logged
icon Re: Any chance for an updated scripting guide? (+1)  
As promised, here is the link for the posts ironing out all of the details about _MyScript commands:

https://forum.caravelgames.com/viewtopic.php?TopicID=38386&page=0#385244

This one is from the first era of DROD RPG, long before TSS, but the principles should still apply as well:

http://forum.caravelgames.com/viewtopic.php?TopicID=27158

Here is another helpful guide created by Xinadris more recently than the first guide:

http://forum.caravelgames.com/viewtopic.php?TopicID=42834

____________________________
Please feel free to test the ultimate JtRH tribute: Journey to the Fabled Kingdom today!

[Last edited by azb at 11-20-2020 01:25 PM : Added another reference]
11-20-2020 at 01:21 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3771
Registered: 12-28-2004
IP: Logged
icon Re: Any chance for an updated scripting guide? (+2)  
* 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.
Activate Item At takes a turn or not depending on what you target - activating orbs takes a turn, activated ceiling lights takes no turns. If both are on the same tile, it takes no time.

Btw, we have a lot more comprehensive help files for 5.2 and I'll also be adding an option to open help even if editing characters. Instead of spreading the knowledge in a lot of different places it might be a better idea to help improving the help files!

See here: https://github.com/CaravelGames/drod/blob/tss-5.2-dev/Data/Help/1/script.html

____________________________
My website
11-20-2020 at 01:32 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Kalin
Level: Master Delver
Avatar
Rank Points: 221
Registered: 01-25-2016
IP: Logged
icon Re: Any chance for an updated scripting guide? (0)  
skell wrote:
Btw, we have a lot more comprehensive help files for 5.2 and I'll also be adding an option to open help even if editing characters. Instead of spreading the knowledge in a lot of different places it might be a better idea to help improving the help files!

See here: https://github.com/CaravelGames/drod/blob/tss-5.2-dev/Data/Help/1/script.html
Hooray for help files!

I couldn't find a thread for 5.2 feedback, so I'll post my comments (and typos found) here.

Can we add a section explaining exactly which commands end the turn? (And under which conditions...)

Set shallow water traversal - Sets how and under what conditions the player interacts with shallow water terrain.
Have we decided yet how exactly this works for different entities?

Label - marks a location in the script to continue executing commands from (used in conjunction with Go to and Answer option commands).
And "Gosub".

Smart beelining: In addition to Normal beelining behavior, when a desired diagonal movement is blocked, choose the better of horizontal or vertical movement that will get closer to the destination (default).
Smart beelining: As flexible beelining, but also will move diagonally closer to the destination when a desired axial move is blocked.
First "Smart" should be "Flexible". Or were we going to call it something else? Also, the game uses the term "orthogonal" instead of "axial".

Pushable by weapon: Makes the NPC pushable by any weapon effectively making it invulnerable to weapon attacks.
Wait, what? So do we need to use "Default pushable" if we want both pushable and stabbable?

Push Objects: The NPC can push objects such as Mirrors and Powder Kegs.
Push Objects: The NPC can push monsters that can be pushed.
Second should be "Push Monsters".

I also have opinions about the new behaviors, but there is a thread for that.

____________________________
he/him
~170th Skywatcher
11-22-2020 at 05:25 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1593
Registered: 06-13-2015
IP: Logged
icon Re: Any chance for an updated scripting guide? (0)  
What exactly do you mean by "pushable"? "Pushable by Body" allows entities to push the NPC with their body, but if you want something to be pushed by weapons then, by definition, the weapons won't be able to stab it. Unless you're referring to the non-stabbing parts of weapons (like all of the stick), which always push regardless and aren't involved in the meaning of "pushable by weapon" at all.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text

11-22-2020 at 05:30 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Kalin
Level: Master Delver
Avatar
Rank Points: 221
Registered: 01-25-2016
IP: Logged
icon Re: Any chance for an updated scripting guide? (0)  
Xindaris wrote:
What exactly do you mean by "pushable"?
Well, that's sort of my question. We have many entities that are pushable by the non-stabby parts of weapons and die from the stabby parts. (And we have mirrors which are pushable by the sides of the sword even though that counts as stabby everywhere else.) And we have entities that are immune to pushing and stabbing. But there is very little that is pushable and immune to stabbing (gentryii and rock piles are all I can think of).

I just think being pushable should be entirely separate from whether it can be stabbed.

____________________________
he/him
~170th Skywatcher
11-22-2020 at 07:03 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1593
Registered: 06-13-2015
IP: Logged
icon Re: Any chance for an updated scripting guide? (0)  
But...it is, though?

Like, by definition, every entity can be pushed by sticks and the stick-like parts of weapons. All that the "pushable" commands are concerned with are the other possible ways of pushing things, which are just (1) with the body or (2) with the stabby or "sword-like" parts of weapons. So, obviously, "pushable by weapon" means "sword-like parts push", and also obviously, you can't push something if you've already killed it by stabbing it. Separately from that, imperative-invulnerable entities, and things like gentryii with similar-ish behavior, can't be stabbed, but don't (necessarily) respond to "sword-like" parts of weapons by being pushed either.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 11-22-2020 07:20 PM]
11-22-2020 at 07:19 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Any chance for an updated scripting guide?
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.