Create a free account to remove all ad content.

Author Topic:  Script Command Documentation  (Read 33583 times)

0 Members and 1 Guest are viewing this topic.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #90 on: November 02, 2015, 07:04:03 PM »
IsBlockTexture: Queries the block texture id at a location.

IsBlockTexture [x,y,z] [id] [true|false]
IsBlockTexture [x,y,z] [compare] [id]

[id] - The texture id is a zero based value. Possible values are 0 - 15. The first (default) texture id is 0. If you use this command on a block that does not support multiple textures, then the texture id will equal zero.

Examples:

IsBlockTexture [150,200,300] [0]
Returns true if the texture id for the block is 0 (default texture).

IsBlockTexture [150,200,300] [3]
IsBlockTexture [150,200,300] [3] [true]
Returns true if the texture id for the block is 3.

IsBlockTexture [150,200,300] [3] [false]
Returns true if the texture id for the block is not 3.

IsBlockTexture [150,200,300] [>=] [3]
Returns true if the texture id for the block is greater than or equal to 3.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #91 on: November 02, 2015, 07:05:35 PM »
SetEventScript: Assigns a script to be executed on certain game events.

SetEventScript [event] [name]
SetEventScript [event] [item] [name]
SetEventScript [event] [text] [name]

[event] - The type of event you want the script assigned to. Currently supported events are PlayerDeath, PlayerJoin, PlayerLeave, PlayerRespawn, CustomMenu, ItemSwing, ButtonX, ButtonY, ButtonB.
[item] - Only used with the ItemSwing and ItemEquip event. Specify which item is to execute the script when it is swung. If [item] is omitted, the event script will be executed for any item.
[text] - Only used with the ButtonX, ButtonY or ButtonB events. Specify the text which is displayed next to the button icon.
[name] - The name of the script to be executed when the event occurs. If the name is omitted any previously assigned script will be unassigned from the event.

Examples:

SetEventScript [PlayerJoin] [Events\PlayerJoin]
This assigns the 'Events\PlayerJoins' script to the PlayerJoins event.

SetEventScript [PlayerJoin]
This unassigns any script that was previously assigned to the PlayerJoin event.

SetEventScript [CustomMenu] [MyCustomMenu]
Whenever someone selects the Custom menu item on the Pause menu, the MyCustomMenu script is executed.

SetEventScript [ItemSwing] [SteelSword] [Events\SteelSwordSwing]
Whenever a player swings a steel sword, the Events\SteelSwordSwing script is executed.

SetEventScript [ItemSwing] [Events\ItemSwing]
Whenever a player swings any item, the Events\ItemSwing script is executed.

SetEventScript [ItemEquip] [IronShovel] [Events\IronShovelEquip]
Whenever a player equips an Iron Shovel, the Events\IronShovelEquip script is executed.

SetEventScript [ButtonX] [Spring Trap] [Events\SpringTrap]
Message: 'X - Spring Trap' is displayed below the player reticle. When the player presses the X button, the Events\SpringTrap script is executed.
« Last Edit: August 12, 2016, 04:47:21 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #92 on: November 04, 2015, 06:57:58 PM »
HUDBar: Create custom HUD status bars, driven by history values.

HUDBar [name] [player] [history] [maxvalue] [x,y,w,h] [r,g,b,a] [label|vertical|numbers|right]
HUDBar [name] [player] [delete]

[name] - The name of the bar. This is also the label drawn on screen.
[player] - Indicates the bar is only for the player. Omit to have the bar created for all players.
[history] - Specifies which history to use as the status value.
[maxvalue] - The 'full' value. If the history value is >= maxvalue, the status bar will be full. If the history value is 30% of the maxvalue, the status bar will be 30% full.
[x,y,w,h] - The position and size of the bar on the screen. x,y specifies the screen position of the bar, w,h specify the width and height of the bar in pixels.
[r,g,b,a] - The color of the status bar.
[label|vertical|numbers|right] - Bar attributes. There are currently four attributes you can specify to change the default bar format. Multiple attributes can be specified (separated by vertical bars). If this parameter is omitted, the bars attributes use their default values (no label, horizontal, no numbers, left justified).

[label] specifies the bar should show a text label (using the name as the label).
[vertical] changes the bar into a vertical bar (the default is horizontal).
[numbers] specifies that the bar should show the values inside the bar, e.g. 150 / 500.
[*right] specifies that the bar should use right justify (the default is left justify).

Examples:

HUDBar [Time] [syshistory:time] [100] [900,100,200,20] [255,0,0,255] [numbers]
This will create a horizontal status bar with the name and label of Time. The value used for the bar will come from the system 'time' history. The bar will be full if the history value is >= 100. The bar will be positioned at screen location 900, 100 and will be 200 pixels wide and 20 pixels high. The color will be solid red. Numbers will be shown inside the bar.

HUDBar [Time] [delete]
This will delete the HUDBar created above.

HUDBar [Radiation] [player] [history:radiation] [50] [800,200,30,150] [0,255,0,255] [label|vertical|right]
This will create a vertical status bar with the name of Radiation and it will be specific to the player who activated the script (other players will not see it). The label will not be shown. The value used for the bar will come from the player 'radiation' history. The bar will be full if the history value is >= 50. The bar will be positioned at screen location 800, 200 and will be 30 pixels wide and 150 pixels high. The color will be solid green. Numbers will not be shown. The bar is right justified.

HUDBar [Radiation] [player] [delete]
This will delete the HUDBar created above.
« Last Edit: November 11, 2015, 08:06:51 PM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #93 on: November 17, 2015, 04:38:39 PM »
MobState: Set the state of all mobs in a region.

MobState [target] [state]
MobState [zone] [state]
MobState [zone] [state] [mobtype]
MobState [x,y,z] [x,y,z] [state]
MobState [x,y,z] [x,y,z] [state] [mobtype]

[target] - Only the target mob from an Intersect command is affected.
[zone] - Only mobs inside the zone will be affected. Temp zones are searched for first, then regular zones if no temp zone is found.
[x,y,z] [x,y,z] - Only mobs inside the region will be affected.
[state] - The state to set/change the mobs to. This parameter is mandatory. Valid values are Death, Despawn and Delete.
[mobtype] - The type of mob to deactivate. Omit this parameter to deactivate all mobs in the region.

Differences between states:
Death kills the mobs instantly, their death sound plays and their death animation plays.
Despawn causes the mobs to despawn with their despawn animation.
Delete instantly removes the mobs without sound or animation.

Examples:

MobState [KillZone] [Delete]
All mobs inside the zone called KillZone are instantly deleted. No animations or sounds are played.

MobState [KillZone] [Death] [Werewolf]
All Werewolves inside the zone called KillZone are killed, their death sound plays and their death animation plays.

MobState [100,200,300] [200,210,400] [Despawn] [Goblin]
All Goblins inside the region [100,200,300] [200,210,400] are despawned, their despawn animation plays.

if
   Intersect [ray] [vrel:0,0,0] [vrel:10,0,0] [mobs]
then
   MobState [target] [Death] // change the state of the mob that the intersection hit.
« Last Edit: December 04, 2015, 06:01:45 PM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #94 on: November 17, 2015, 04:39:10 PM »
MobHealth: Manipulate mob current Health points.

MobHealth [target] [qty] [milliseconds] [duration]
MobHealth [zone] [mobtype] [qty] [milliseconds] [duration]
MobHealth [x,y,z] [x,y,z] [mobtype] [qty] [milliseconds] [duration]

[target] - Only the target mob from an Intersect command is affected.
[zone] - Only mobs inside the zone will be affected. Temp zones are searched for first, then regular zones if no temp zone is found.
[x,y,z] [x,y,z] - Only mobs inside the region will be affected.
[mobtype] - The type of mob to affect. Omit this parameter to affect all mobs in the region.

[qty] - The number of points to add/subtract from the mobs current health. A negative number will lower the mobs health (cause damage).

[milliseconds] - Apply this effect every # of milliseconds. If this parameter is omitted, the effect is a one off. Minimum value is 16.

[duration] - Apply this effect for [duration] milliseconds then automatically stop. Only valid if [milliseconds] is also specified. If a [milliseconds] parameter is included, but this parameter is omitted, then the effect runs indefinitely.

MobHealth commands can be stacked and are accumulative.

e.g. if you run these commands:

MobHealth [zone] [20] [1000]
MobHealth [zone] [-15] [1000]
The accumulative effect is +5 health points per second.

Examples:

MobHealth [Wave] [10]
Add 10 health points to every mob inside the zone called Wave.

MobHealth [Wave] [Spider] [-20]
Subtract 20 health points from every spider inside the zone called Wave. This is a one off. If the players health reaches zero, they will die.

MobHealth [100,200,300] [150, 210, 350] [-20] [1000]
Subtract 20 health points, every second (1000 milliseconds), from every mob inside the region, for an indefinate period of time.

MobHealth  [100,200,300] [150, 210, 350] [TrollChief] [-2] [500] [10000]
Subtract 2 health points every half second, from every TrollChief in the region. Apply this effect for 10 seconds then stop.

if
   Intersect [ray] [vrel:0,0,0] [vrel:10,0,0] [mobs]
then
   MobHealth [target] [-20] // damage the mob that the intersection hit.
« Last Edit: December 04, 2015, 06:01:26 PM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #95 on: November 30, 2015, 07:02:00 AM »
Intersect: Tests for an intersection with players, mobs or both.

Intersect [sphere] [x,y,z] [radius] [players|mobs] [display]
Intersect [ray|box] [x,y,z] [x,y,z] [players|mobs] [display]
Intersect [frustum] [x,y,z] [x,y,z] [fov] [players|mobs] [display]

[sphere|ray|box|frustum] - The shape used for the collision test. This parameter is mandatory and only one shape can be chosen per command.
[players|mobs] - The type of character to test against, either players or mobs. If this parameter is omitted, both players and mobs will be tested against. The script player (the player who activated the script is not included in the test).
[display] - Add this to the end of the command and the game will draw a test wireframe for a few seconds so you can visually determine if it is what you intend. This option typically would only be used for debugging the command and would be removed once the command works as you intend.

Only the [ray] shape detects if a player or mob is hidden by blocks.

Examples:

Intersect [sphere] [300,200,250] [50]
Returns true if a player or mob intersects the sphere centered at position [300,200,250], radius 50. If multiple players or mobs intersect the sphere, the player or mob that is closest to the sphere center is returned.

Intersect [sphere] [prel:0,0,0] [30] [mobs]
Returns true if a mob intersects the sphere centered at the script players feet position, radius 30. If multiple mobs intersect the sphere, the mob that is closest to the sphere center is returned.

Intersect [ray] [vrel:0,0,0] [vrel:20,0,0] [players]
Returns true if a player intersects the ray that starts at the script players eye position with a direction of the script players view direction, up to 20 blocks distance. Players hiding behind blocks won't be detected. . If multiple players intersect the ray, the player that is closest to the ray origin is returned.

Intersect [frustum] [vrel:0,0,0] [vrel:30,0,0] [20] [mobs]
Returns true if a mob intersects the frustum relative to the players view direction. The frustum reaches 30 blocks from the player and has a field of view of 20 degrees. If multiple mobs intersect the frustum, the mob that is closest to the script players position is returned.

Intersect [box] [100,200,100] [300,250,300] [display]
Returns true if a player or mob interects the box positioned at 100,200,100 to 300,250,300.  If multiple players or mobs intersect the frustum, the player or mob that is closest to the script players position is returned. The box is displayed on the screen for a few seconds.
« Last Edit: December 04, 2015, 06:00:24 PM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #96 on: November 30, 2015, 07:02:40 AM »
Context: Set the context for some command parameters.

Currently only the [player] context type can be set. This command allows scripts to change the target of all [player] based commands. i.e. the value of [player] can be changed for commands that use the [player] parameter.

Context [player] - Same as Context [player] [default].
Context [player] [default] - Set the [player] context to default - which is the player who activated the script.
Context [player] [target] - Set the [player] context to the result of an Intersect command.
Context [player] [killer] - Set the [player] context to the player who killed the [default] player. Only usable on PlayerDeath event scripts.

Context is automatically set back to default at the end of an if/endif block, so there is no need to manually set it back.

Examples:

if
   Intersect [ray] [vrel:0,0,0] [vrel:8,0,0]
then
   Health [+10] // this increases the health of the default context - the player who activated the script.
   Context [player] [target] // set context to the player or mob returned by the intersect command.
   Health [-20] // this damages the player or mob returned by the intersect command.
endif // Context is automatically set back to [default] here.

if
   Intersect [sphere] [prel:0,1,0] [15] [players]
then
   History [kills] [player] // increment the [kills] history for the default context - the player who activated the script.
   Context [player] [target] // set context to the player returned by the intersect command.
   History [killed] [player] // increment the [killed] history for the player returned by the intersect command.
endif // Context is automatically set back to [default] here.
« Last Edit: August 12, 2016, 04:33:56 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #97 on: December 03, 2015, 09:19:20 PM »
SetBlockScript: Assigns a script to blocks that can execute scripts.

SetBlockScript [x,y,z] [name]
SetBlockScript [x,y,z] [name] [type]

[x,y,z] - The coordinate of the block.
[name] - The name of the script to be assigned.
[type] - Optional parameter for blocks that can have multiple scripts attached. The value of type can be [entry|exit|poweron|poweroff].

Examples:

SetBlockScript [100,200,150] [Explode]
This assigns the 'Explode' script to the block located at location 100,200,150.

SetBlockScript [200,250,150] [close] [poweroff]
This assigns the 'Close' script as the PowerOff script to the script block located at location 200,250,150.

SetBlockScript [200,250,150] [track] [entry]
This assigns the 'Track' script as the Entry script to the proximity detector block located at location 200,250,150.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #98 on: January 20, 2016, 03:32:34 PM »
HUDCounter: Add/remove custom HUD counters, driven by history values.

HUDCounter [name] [player] [history] [x,y] [r,g,b,a] [label]
HUDCounter [name] [player] [delete]

[name] - The name of the counter. This is also the label drawn on screen.
[player] - Indicates the counter is only for the player. Omit to have the counter created for all players.
[history] - Specifies which history to use as the counter value.
[x,y] - The position of the counter on the screen.
[r,g,b,a] - The color of the counter.
[label] - Specifies whether the label for the counter should be displayed. If this parameter is omitted, no label will be displayed.

Examples:

HUDCounter [Time] [syshistory:time] [900,100] [255,0,0,255] [label]
This will create a counter with the name and label of Time. The value used for the counter will come from the system 'time' history. The counter will be positioned at screen location 900, 100. The color will be solid red. The label for the counter will be shown.

HUDCounter [Time] [delete]
This will delete the HUDCounter created above.

HUDCounter [Radiation] [player] [history:radiation] [800,200] [0,255,0,255]
This will create a counter with the name of Radiation and it will be specific to the player who activated the script (other players will not see it). The value used for the counter will come from the player 'radiation' history. The counter will be positioned at screen location 800, 200. The color will be solid green. The label will not be shown.

HUDCounter [Radiation] [player] [delete]
This will delete the HUDCounter created above.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #99 on: January 20, 2016, 03:33:09 PM »
HUDShape: Add/remove custom shapes to the HUD.

HUDShape [name] [player] [rect] [x,y,w,h] [r,g,b,a]
HUDShape [name] [player] [delete]

[name] - The name of the shape.
[player] - Indicates the shape is only for the player. Omit to have the shape created for all players.
[rect] - The type of shape. Currently only [rect] is supported (rectangle).
[x,y,w,h] - The position and size of the rectangle on the screen. x,y specifies the screen position of the rectangle, w,h specify the width and height of the rectangle in pixels.
[r,g,b,a] - The color of the shape.

Examples:

HUDShape [BloodSplat1] [rect] [900,100,50,60] [255,0,0,255]
This will create a rectangle with the name of BloodSplat1. The rectangle will be positioned at screen location 900, 100, it will be 50 pixels wide and 60 pixels high. The color will be solid red.

HUDShape [BloodSplat1] [delete]
This will delete the HUDShape created above.