Create a free account to remove all ad content.

Author Topic:  Script Command Documentation  (Read 35128 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 #80 on: July 28, 2015, 08:40:44 PM »
Unequip: Forces the player to unequip items.

Unequip [left|right|body] [item]

[left|right|body] - left hand, right hand, or body slot. Omit to unequip the item from any slot.

[item] - The item to unequip. Omit to unequip the item regardless of what it is.

Note: Hosts ought to use this command moderately and only for controlled scenario's. Players won't like their equips being changed outside their control and may leave your world as a consequence.

Examples:

Unequip
Unequips all items from all equip slots.

Unequip [RingOfIce]
Unequips the ring of ice from all slots (left hand, right hand and appropriate body slot).

Unequip [body] [RingOfIce]
Unequips the ring of ice from the appropriate body slot.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #81 on: July 28, 2015, 08:51:07 PM »
Explosion: Creates an explosion.

Explosion [x,y,z]
Explosion [x,y,z] [radius]
Explosion [x,y,z] [radius] [strength]

[x,y,z] - The coordinate for the center of the explosion.

[radius] - The radius of the explosion. Values must be between 1 and 30. If this parameter is ommitted, a default value of 5 is used.

[strength] - The (blast) strength of the explosion. Values must be between 1 and 300. If this parameter is ommitted, a default value of radius x 3 is used.

Examples:

Explosion [100,150, 200]
Creates an explosion at coordinate 100,150,200, using the default radius of 5 and default strength of 15 (radius x 3).

Explosion [100,150, 200] [10]
Creates an explosion at coordinate 100,150,200, using a radius of 10 and default strength of 30 (radius x 3).

Explosion [100,150, 200] [15] [50]
Creates an explosion at coordinate 100,150,200, using a radius of 15 and strength of 50.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #82 on: November 02, 2015, 06:50:49 PM »
Exit: Exit the script immediately (stop executing the script at this command, even if there are more commands that follow).

Example:

if
   condition1
then
   do something
else
   exit
endif

if
   condition2
then
   do something
endif

If condition1 is false then the script stops executing and the second if block (condition2) is not executed. The Exit command is not needed at the end of a script (the last command), it's only needed if your intent is to conditionally exit the script before the last command.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #83 on: November 02, 2015, 06:52:51 PM »
Kick: Kicks the player who activated the script from the multiplayer session.

Has no effect in single player.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #84 on: November 02, 2015, 06:53:29 PM »
IsNameplate: Queries the players nameplate setting.

IsNameplate [true|false|short|far]

Examples:

IsNameplate [short]
Returns true if the players nameplate is set to short.

IsNameplate
IsNameplate [true]
Both variants returns true if the players nameplate is on (either short or far).

IsNameplate [false]
Returns true if the players nameplate is turned off.
« Last Edit: November 02, 2015, 06:56:52 PM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #85 on: November 02, 2015, 06:53:59 PM »
SetNameplate: Sets player or mob nameplate settings.

SetNameplate [off|short|far]
SetNameplate [off|short|far] [player|clan]
SetNameplate [on|off] [mobs]
SetNameplate [on|off] [player|clan] [mobs]

[on|off|short|far] - The nameplate setting to use.
[mobs] - Specifies that the command affects the mob nameplate setting, otherwise if omitted the command affects player nameplate settings.

Examples:

SetNameplate [off]
Turns off player nameplates for all players in the session.

SetNameplate [short]
Sets player nameplates to short for all players in the session.

SetNameplate [off] [player]
Turns off the nameplate only for the player that activated the script.

SetNameplate [off] [clan]
Turns off the nameplate only for players in the clan of the player that activated the script.

SetNameplate [on] [mobs]
Turns on mob nameplates for all players in the session.

SetNameplate [on] [player] [mobs]
Turns on mob nameplates for the player that activated the script.
« Last Edit: November 02, 2015, 06:57:27 PM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #86 on: November 02, 2015, 07:00:18 PM »
Particle: Emit an individual particle.

Particle [x,y,z] [template]
Particle [x,y,z] [duration] [velocity] [size] [startcolor] [gravity] [rotation] [velocityvariation] [endcolor] [emitposvariance] [emitposoffset]

[x,y,z] - The position (coordinate) in the world to spawn the particle.

[template] - A preset type of particle. Current presets are [Default], [Chimney], [Sparks], [SnowMachine], [AcidRain], [ForestFire].

[duration] - The duration of the particle, in seconds. Maximum duration is 8 seconds.

[velocity] - The velocity of the particle in meters per second. 3 comma separated values for the X, Y and Z axis.
 
[size] - Starting size of the particle and the end size multiplier. 4 comma separated values. The first 3 values are the initial size for the X, Y and Z axis, and the fourth number is the end size multiplier. The particle is spawned as the initial size, and interpolated to the initial size * end size multiplier over it's life time.

[startcolor] - The starting color of the particle specified in RGBA format (4 comma separated values with a range of 0-255).

[gravity] - The gravity of the particle in meters per second. Zero equals no gravity. Negative gravity is supported. If this parameter is omitted a value of zero is used (no gravity).

[rotation] - The rotation speed of the particle in radians per second. Zero equals no rotation. A positive number rotates clockwise, a negative number rotates anti-clockwise. If this parameter is omitted a value of zero is used (no rotation).

[velocityvariation] - This value allows randomized variation of the particles velocity as an offset to the base [velocity]. e.g. if the base [velocity] is 1,2,3 and the [velocityvariance] is [0.5, 1, 1.5] then the particles velocity will be in the range of [0.75/1.25, 1.5/2.5, 2.25/3.75]. If this parameter is omitted a value of [0,0,0] is used (no variation).

[endcolor] - The ending color of the particle specified in RGBA format (4 comma separated values with a range of 0-255). The particles color will be interpolated from the start color to the end color over it's lifetime. If this parameter is omitted the end color will equal the start color (no change in color).

[emitposvariance] - Similar to [velocityvariance] except this value works against the base position. It allows particles to be spawned over a randomized area around the base position. If this parameter is omitted a value of [0,0,0] is used (no variation).

[emitposoffset] - This parameter allows you to offset the particles spawn position against the base [position].


Examples:

Particle [100,200,150] [Chimney]
Spawns a single smoke particle that rises into the air, changing color from dark to light gray as it rises.

Particle [100,200,150] [4.5] [5.2,4.3,3.5] [0.5,0.6,0.7,3] [255,255,0,255]
Spawns a single particle that lasts for 4.5 seconds. It has a constant velocity of 5.2,4.3,3.5 mps. The size of the particle starts at 0.5,0.6,0.7 and ends at 1.5,1.8,2.1. It's color is a constant yellow. It has not rotation, velocity variance, color change, position variance or position offset.
                                                                                                                                                       
Particle [100,200,150] [4.5] [5.2,4.3,3.5] [0.5,0.6,0.7,3] [255,255,0,255] [2] [1.57] [1,1,1] [255,0,0,255] [5,5,5] [0,2,0]
Spawns a single particle that lasts for 4.5 seconds. It has a constant velocity of between 4.7,3.8,3.0 and 5.7,4.8,4.0 mps. The size of the particle starts at 0.5,0.6,0.7 and ends at 1.5,1.8,2.1. It's color starts at yellow and interpolates to red over its lifetime. It has gravity of 2 mps. It has a rotation of 1.57 radians per second (approximately 1 full spin every 4 seconds). The particle may spawn within [-2.5,-2.5,-2.5] and [2.5,2.5,2.5] of the base position. The particles base position is offset by 2 meters up.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #87 on: November 02, 2015, 07:00:42 PM »
ParticleEmitter: Creates a particle emitter that emits particles at a specified frequency over a specified length of time.

ParticleEmitter [x,y,z] [emitterduration] [template] [emitfreq]
ParticleEmitter [x,y,z] [emitterduration] [emitfreq] [duration] [velocity] [size] [startcolor] [gravity] [rotation] [velocityvariation] [endcolor] [emitposvariance] [emitposoffset]

[x,y,z] - The position (coordinate) in the world of the emitter.

[emitterduration] - The emitter will be active emitting particles for this duration in seconds and then be automatically removed.

[template] - A preset type of particle to emit. Current presets are [Default], [Chimney], [Sparks], [SnowMachine], [AcidRain], [ForestFire].

[emitfreq] - The frequency in seconds to emit the particles.

[duration] - The duration of the particle, in seconds. Maximum duration is 8 seconds.

[velocity] - The velocity of the particles in meters per second. 3 comma separated values for the X, Y and Z axis.
 
[size] - Starting size of the particles and the end size multiplier. 4 comma separated values. The first 3 values are the initial size for the X, Y and Z axis, and the fourth number is the end size multiplier. The particles are spawned as the initial size, and interpolated to the initial size * end size multiplier over it's life time.

[startcolor] - The starting color of the particles specified in RGBA format (4 comma separated values with a range of 0-255).

[gravity] - The gravity of the particle in meters per second. Zero equals no gravity. Negative gravity is supported. If this parameter is omitted a value of zero is used (no gravity).

[rotation] - The rotation speed of the particles in radians per second. Zero equals no rotation. A positive number rotates clockwise, a negative number rotates anti-clockwise. If this parameter is omitted a value of zero is used (no rotation).

[velocityvariation] - This value allows randomized variation of the particles velocity as an offset to the base [velocity]. e.g. if the base [velocity] is 1,2,3 and the [velocityvariance] is [0.5, 1, 1.5] then the particles velocity will be in the range of [0.75/1.25, 1.5/2.5, 2.25/3.75]. If this parameter is omitted a value of [0,0,0] is used (no variation).

[endcolor] - The ending color of the particles specified in RGBA format (4 comma separated values with a range of 0-255). The particles color will be interpolated from the start color to the end color over it's lifetime. If this parameter is omitted the end color will equal the start color (no change in color).

[emitposvariance] - Similar to [velocityvariance] except this value works against the base (emitter) position. It allows particles to be spawned over a randomized area around the base position. If this parameter is omitted a value of [0,0,0] is used (no variation).

[emitposoffset] - This parameter allows you to offset the particles spawn position against the base (emitter) position.


Examples:

ParticleEmitter [100,200,150] [Chimney]
Emits chimney smoke particles that rises into the air, changing color from dark to light gray as it rises. The particles are emitted at the frequency defined by the template.

ParticleEmitter [100,200,150] [Chimney] [0.1]
Emits chimney smoke particles at a custom frequency (1 particle every 0.1 of a second or 10 particles per second).

ParticleEmitter [100,200,150] [20] [1] [4.5] [5.2,4.3,3.5] [0.5,0.6,0.7,3] [255,255,0,255]
Emits particles at 1 particle per second for 20 seconds. Each particle lasts for 4.5 seconds. It has a constant velocity of 5.2,4.3,3.5 mps. The size of the particle starts at 0.5,0.6,0.7 and ends at 1.5,1.8,2.1. It's color is a constant yellow. It has not rotation, velocity variance, color change, position variance or position offset.
                                                                                                                                                       
Particle [100,200,150] [30] [0.5] [4.5] [5.2,4.3,3.5] [0.5,0.6,0.7,3] [255,255,0,255] [2] [1.57] [1,1,1] [255,0,0,255] [5,5,5] [0,2,0]
Emits particles at 2 particles per second for 30 seconds. Each particle lasts for 4.5 seconds. It has a constant velocity of between 4.7,3.8,3.0 and 5.7,4.8,4.0 mps. The size of the particle starts at 0.5,0.6,0.7 and ends at 1.5,1.8,2.1. It's color starts at yellow and interpolates to red over its lifetime. It has gravity of 2 mps. It has a rotation of 1.57 radians per second (approximately 1 full spin every 4 seconds). The particle may spawn within [-2.5,-2.5,-2.5] and [2.5,2.5,2.5] of the base position. The particles base position is offset by 2 meters up.
« Last Edit: August 12, 2016, 04:45:04 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #88 on: November 02, 2015, 07:02:25 PM »
Loop: Restarts the script from the top.

Loop
Loop [millisecs]

[millisecs] - Specify a time in milliseconds to wait before the script restarts. The value cannot be less than 2. If omitted a value of 16 (60 FPS) is used by default.

Examples:

Loop
This will cause the script to restart after 16 milliseconds.

Loop [1000]
This will cause the script to restart after 1000 milliseconds (1 second).

Note: Because of the nature of how scripts are queued for execution, these timings are not exact and should not be relied on to be exact.
« Last Edit: August 12, 2016, 04:41:04 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #89 on: November 02, 2015, 07:03:16 PM »
HasPlayer: Queries player properties.

HasPlayer [property] [compare] [level]

Examples:

HasPlayer [Health] [>] [100]
Returns true if the players current Health is greater than 100 points, otherwise returns false.

HasPlayer [Oxygen] [=] [25]
Returns true if the players current Oxygen is equal to 25 points, otherwise returns false.