Script Commands: Difference between revisions

From Ashes of the Singularity - Official Wiki
Jump to navigation Jump to search
(Created page with "Commands are used within triggers to create gameplay effects, from revealing locations to spawning attack waves or even changing an AI's difficulty mid-game. ==List of Co...")
 
mNo edit summary
Line 1: Line 1:
Commands are used within [[triggers]] to create gameplay effects, from revealing locations to spawning attack waves or even changing an AI's difficulty mid-game.


==List of Commands==
Commands are used within [[Triggers|triggers]] to create gameplay effects, from revealing locations to spawning attack waves or even changing an AI's difficulty mid-game.
 
== List of Commands ==
 
=== [[ActivateTrigger|ActivateTrigger]] ===


===[[ActivateTrigger|ActivateTrigger]]===
Activate another trigger (also can be used to activate the trigger it is called from, making a repeating trigger).
Activate another trigger (also can be used to activate the trigger it is called from, making a repeating trigger).


*'''Target''' - This is the name of another trigger that will be set from Inactive to Active.  
*'''Target''' - This is the name of another trigger that will be set from Inactive to Active.  


===[[AreaIndicator|AreaIndicator]]===
=== [[AreaIndicator|AreaIndicator]] ===
 
This places a visible indicator on the map to help the player know where they should go to.
This places a visible indicator on the map to help the player know where they should go to.


Line 17: Line 20:
*'''Duration''' - How long the area indicator should last, -1 means that it lasts forever.  
*'''Duration''' - How long the area indicator should last, -1 means that it lasts forever.  


===[[AttackAttackMove|AttackAttackMove]]===
=== [[AttackAttackMove|AttackAttackMove]] ===
 
Order an army to move to a specific area, engaging enemies along the way.
Order an army to move to a specific area, engaging enemies along the way.


Line 24: Line 28:
*'''Position''' - Where the army is ordered to move to.  
*'''Position''' - Where the army is ordered to move to.  


===[[AttackUnit|AttackUnit]]===
=== [[AttackUnit|AttackUnit]] ===
 
Order an army to attack a specific script-spawned unit
Order an army to attack a specific script-spawned unit


Line 30: Line 35:
*'''Target''' - The name of the unit to be attacked  
*'''Target''' - The name of the unit to be attacked  


===[[Camera|Camera]]===
=== [[Camera|Camera]] ===
 
Move the player's view to a specific area.
Move the player's view to a specific area.


Line 45: Line 51:
**Third number is pitch. 40-50 are typical gameplay angles. 90 would be straight down. Note that anything lower than 40 can cause the engine to load a '''lot''' more terrain and models than it's designed to, so use with caution.  
**Third number is pitch. 40-50 are typical gameplay angles. 90 would be straight down. Note that anything lower than 40 can cause the engine to load a '''lot''' more terrain and models than it's designed to, so use with caution.  


=== [[CaptureNearestNext|CaptureNearestNext]] ===


===[[CaptureNearestNext|CaptureNearestNext]]===
Order an army to capture the nearest neutral or enemy-controlled region
Order an army to capture the nearest neutral or enemy-controlled region


Line 52: Line 58:
*'''Repeat''' - Whether to repeat the order (indefinitely)  
*'''Repeat''' - Whether to repeat the order (indefinitely)  


===[[CaptureNearest|CaptureNearest]]===
=== [[CaptureNearest|CaptureNearest]] ===
 
Order an army to clear its order queue and capture the nearest neutral or enemy-controlled region (note: ordered unit will stop moving if region is captured before it gets there)
Order an army to clear its order queue and capture the nearest neutral or enemy-controlled region (note: ordered unit will stop moving if region is captured before it gets there)


Line 58: Line 65:
*'''Repeat''' - Whether to repeat the order (indefinitely)  
*'''Repeat''' - Whether to repeat the order (indefinitely)  


===[[ChangeAIDifficulty|ChangeAIDifficulty]]===
=== [[ChangeAIDifficulty|ChangeAIDifficulty]] ===
 
Change an AI player's difficulty setting
Change an AI player's difficulty setting


Line 64: Line 72:
*'''Difficulty''' - The name of the difficulty to set it to  
*'''Difficulty''' - The name of the difficulty to set it to  


===[[ChangeAIPersonality|ChangeAIPersonality]]===
=== [[ChangeAIPersonality|ChangeAIPersonality]] ===
 
Change an AI player's personality
Change an AI player's personality


Line 70: Line 79:
*'''Name''' - The name of the personality to set it to (defined in \Assets\GameCore\DefaultPlayerAI.xml)  
*'''Name''' - The name of the personality to set it to (defined in \Assets\GameCore\DefaultPlayerAI.xml)  


===[[DestroyBuilding|DestroyBuilding]]===
=== [[DestroyBuilding|DestroyBuilding]] ===
 
Destroys a specific script-spawned building.
Destroys a specific script-spawned building.


*'''Name''' - The name of the building to be destroyed.  
*'''Name''' - The name of the building to be destroyed.  


===[[DestroyUnit|DestroyUnit]]===
=== [[DestroyUnit|DestroyUnit]] ===
 
Destroys a specific script-spawned unit.
Destroys a specific script-spawned unit.


*'''Name''' - The name of the unit to be destroyed.  
*'''Name''' - The name of the unit to be destroyed.  


===[[Dialog|Dialog]]===
=== [[Dialog|Dialog]] ===
 
This creates a popup that can convey information or story to the player. Use with <Entry> tags.
This creates a popup that can convey information or story to the player. Use with <Entry> tags.


===[[Entry|Entry]]===
=== [[Entry|Entry]] ===
 
The actual text that will be displayed. Use only within <Dialog> tags.
The actual text that will be displayed. Use only within <Dialog> tags.


Line 98: Line 111:
**Agethon  
**Agethon  


&nbsp;


*'''Text''' - The actual text that is displayed. Corresponds to an entry in a .csv file in \Assets\UIText\  
*'''Text''' - The actual text that is displayed. Corresponds to an entry in a .csv file in \Assets\UIText\  


===[[EndMission|EndMission]]===
=== [[EndMission|EndMission]] ===
 
Use to force a win or loss of the scenario.
Use to force a win or loss of the scenario.


Line 107: Line 123:
*'''String''' - The text that is displayed.  
*'''String''' - The text that is displayed.  


===[[GrantStuff|GrantStuff]]===
=== [[GrantStuff|GrantStuff]] ===
 
Give a player free resources.
Give a player free resources.


Line 116: Line 133:
*'''Turinium''' - The amount of victory points being granted.  
*'''Turinium''' - The amount of victory points being granted.  


===[[GrantTech|GrantTech]]===
=== [[GrantTech|GrantTech]] ===
 
Give a player a free Quantum Upgrade
Give a player a free Quantum Upgrade


Line 122: Line 140:
*'''Tech''' - The upgrade to grant [ HPs | Weapons | Radar | BuildingHPs | MetalStorage | RadsStorage ]  
*'''Tech''' - The upgrade to grant [ HPs | Weapons | Radar | BuildingHPs | MetalStorage | RadsStorage ]  


===[[HidePanel|HidePanel]]===
=== [[HidePanel|HidePanel]] ===
 
Hide UI panels.
Hide UI panels.


Line 129: Line 148:
*'''HideResource''' - Hide the Resource panel  
*'''HideResource''' - Hide the Resource panel  


===[[LetterBox|LetterBox]]===
=== [[LetterBox|LetterBox]] ===
 
Disable commands and go to a cinematic, letterbox view.
Disable commands and go to a cinematic, letterbox view.


Line 135: Line 155:
*'''Snap''' - 1 to immediately go to/from letterbox mode instead of fading in/out  
*'''Snap''' - 1 to immediately go to/from letterbox mode instead of fading in/out  


===[[MoveUnit|MoveUnit]]===
=== [[MoveUnit|MoveUnit]] ===
 
Move an army to a location without stopping to fight
Move an army to a location without stopping to fight


Line 143: Line 164:
*'''Stop''' - 1 to stop the unit  
*'''Stop''' - 1 to stop the unit  


===[[Objective|Objective]]===
=== [[Objective|Objective]] ===
 
Use this to set objective notifications for the player (so they know what to do).
Use this to set objective notifications for the player (so they know what to do).


Line 151: Line 173:
*'''SetCheck''' - If the objective checkbox is checked or not.  
*'''SetCheck''' - If the objective checkbox is checked or not.  


===[[Restrict|Restrict]]===
=== [[Restrict|Restrict]] ===
 
To block the player from being able to access objects in the game.
To block the player from being able to access objects in the game.


Line 158: Line 181:
*'''Enable''' - Set this to 1 to enable the object. You can use this to restrict something early in the scenario and then enable it later on (for example: when the player accomplishes an objective or after a set amount of time).  
*'''Enable''' - Set this to 1 to enable the object. You can use this to restrict something early in the scenario and then enable it later on (for example: when the player accomplishes an objective or after a set amount of time).  


===[[Reveal|Reveal]]===
=== [[Reveal|Reveal]] ===
 
Reveal the fog of war over a location
Reveal the fog of war over a location


Line 167: Line 191:
*'''RadarSize''' - Use to add a radar component to the reveal. Can be used with Size="0" to create a radar-only reveal  
*'''RadarSize''' - Use to add a radar component to the reveal. Can be used with Size="0" to create a radar-only reveal  


===[[SpawnBuilding|SpawnBuilding]]===
=== [[SpawnBuilding|SpawnBuilding]] ===
 
Places a building on the map.
Places a building on the map.


Line 176: Line 201:
*'''NoDeath''' - Set this to "1" to make the unit immortal (you can still kill it with a scripted DestroyBuilding command)  
*'''NoDeath''' - Set this to "1" to make the unit immortal (you can still kill it with a scripted DestroyBuilding command)  


===[[SpawnUnit|SpawnUnit]]===
=== [[SpawnUnit|SpawnUnit]] ===
 
Places a unit on the map.
Places a unit on the map.


Line 185: Line 211:
*'''Position''' - Where the unit will be created.  
*'''Position''' - Where the unit will be created.  


===[[Var|Var]]===
=== [[Var|Var]] ===
 
Set or modify a variable. Tip: Set any variable you want to use to 0 in the initial setup trigger to avoid unpredictable results. ''All values must be integers.''
Set or modify a variable. Tip: Set any variable you want to use to 0 in the initial setup trigger to avoid unpredictable results. ''All values must be integers.''


Line 197: Line 224:
**"SubRand" - subtract a random value between Min and Max  
**"SubRand" - subtract a random value between Min and Max  


&nbsp;


*'''Value''' - The value to be used in the operation  
*'''Value''' - The value to be used in the operation  

Revision as of 22:41, 17 January 2017

Commands are used within triggers to create gameplay effects, from revealing locations to spawning attack waves or even changing an AI's difficulty mid-game.

List of Commands

ActivateTrigger

Activate another trigger (also can be used to activate the trigger it is called from, making a repeating trigger).

  • Target - This is the name of another trigger that will be set from Inactive to Active.

AreaIndicator

This places a visible indicator on the map to help the player know where they should go to.

  • Name - The name of the area.
  • Position - The center of the area.
  • Color - The color the area indicator is. [ Green | Blue | Red ]
  • Size - How big the area indicator will be.
  • Duration - How long the area indicator should last, -1 means that it lasts forever.

AttackAttackMove

Order an army to move to a specific area, engaging enemies along the way.

  • Name - The name of the army that will be given the order.
  • Repeat - Whether to repeat the order. Use with multiple AttackAttackMove commands to create a patrol path.
  • Position - Where the army is ordered to move to.

AttackUnit

Order an army to attack a specific script-spawned unit

  • Name - The name of the unit to do the attacking
  • Target - The name of the unit to be attacked

Camera

Move the player's view to a specific area.

  • Position - Where the camera will be looking.
  • Snap - Set to 1 to move the camera instantly, instead of panning
  • Speed - Scalar for how fast the camera will move, compared to clicking on the minimap. 0.5 for half speed, 2 for double, etc.
  • Unit - Follow a specific script-spawned unit. Do not use Position if you use this.
  • Building - Follow a specific script-spawned building. Do not use Position if you use this.
  • Save - Save the current camera settings. Useful if you want to show the player something and then move the camera back to whatever they were looking at.
  • Load - Load the last saved camera settings. Use with Save. May cause a crash if you haven't previously saved a camera position.
  • RTP - Distance, rotation and pitch of the camera.
    • The first number is distance. 1000 is a fairly tight shot, 2500 is a fairly typical gameplay zoom
    • Second number is rotation. 0 points the camera north, 90 east, 180 south, 270 west.
    • Third number is pitch. 40-50 are typical gameplay angles. 90 would be straight down. Note that anything lower than 40 can cause the engine to load a lot more terrain and models than it's designed to, so use with caution.

CaptureNearestNext

Order an army to capture the nearest neutral or enemy-controlled region

  • Name - The name of the unit to do the capturing
  • Repeat - Whether to repeat the order (indefinitely)

CaptureNearest

Order an army to clear its order queue and capture the nearest neutral or enemy-controlled region (note: ordered unit will stop moving if region is captured before it gets there)

  • Name - The name of the unit to do the capturing
  • Repeat - Whether to repeat the order (indefinitely)

ChangeAIDifficulty

Change an AI player's difficulty setting

  • Player - The index of the player to change
  • Difficulty - The name of the difficulty to set it to

ChangeAIPersonality

Change an AI player's personality

  • Player - The index of the player to change
  • Name - The name of the personality to set it to (defined in \Assets\GameCore\DefaultPlayerAI.xml)

DestroyBuilding

Destroys a specific script-spawned building.

  • Name - The name of the building to be destroyed.

DestroyUnit

Destroys a specific script-spawned unit.

  • Name - The name of the unit to be destroyed.

Dialog

This creates a popup that can convey information or story to the player. Use with <Entry> tags.

Entry

The actual text that will be displayed. Use only within <Dialog> tags.

  • Icon - The icon used with the text popup. Hard-coded to correspond to Ashes characters, and changes the text color to match.
    • Mac
    • Haalee
    • Vexen
    • Valen
    • Artix
    • Ventrix
    • Athena
    • Adrasteia
    • Agememnon
    • Agethon


 

  • Text - The actual text that is displayed. Corresponds to an entry in a .csv file in \Assets\UIText\

EndMission

Use to force a win or loss of the scenario.

  • Victory - Set to 0 to lose the scenario or 1 to win.
  • String - The text that is displayed.

GrantStuff

Give a player free resources.

  • Player - The index of the player to be hooked up
  • Metal - The amount of metal being granted.
  • Quanta - The amount of quanta being granted.
  • Radioactives - The amount of radioactives being granted.
  • Turinium - The amount of victory points being granted.

GrantTech

Give a player a free Quantum Upgrade

  • Player - The index of the player to be hooked up
  • Tech - The upgrade to grant [ HPs | Weapons | Radar | BuildingHPs | MetalStorage | RadsStorage ]

HidePanel

Hide UI panels.

  • HidePlayer - Hide the Player panel
  • HideRank - Hide the Rank panel
  • HideResource - Hide the Resource panel

LetterBox

Disable commands and go to a cinematic, letterbox view.

  • Enable - 1 to turn letterbox mode on, 0 to turn it off
  • Snap - 1 to immediately go to/from letterbox mode instead of fading in/out

MoveUnit

Move an army to a location without stopping to fight

  • Name - Name of the unit to be moved
  • Position - x/y coordinates to move to
  • Repeat - 1 to repeat this command indefinitely. Use with multiple MoveUnit commands to create a patrol path.
  • Stop - 1 to stop the unit

Objective

Use this to set objective notifications for the player (so they know what to do).

  • Name - The name of the objective, use this name when checking or hiding it.
  • Hide - If this objective should be hidden or not, usually this means the objective is complete.
  • String - What the objective displays on the screen.
  • SetCheck - If the objective checkbox is checked or not.

Restrict

To block the player from being able to access objects in the game.

  • Type - Unit, Building, Research or Orbital. Whatever type of object that is being restricted.
  • ID - The name of the object being restricted.
  • Enable - Set this to 1 to enable the object. You can use this to restrict something early in the scenario and then enable it later on (for example: when the player accomplishes an objective or after a set amount of time).

Reveal

Reveal the fog of war over a location

  • Name - The name of this reveal (so you can modify it with a later command)
  • Enable - 1 to enable, 0 to disable
  • Position - x/y coordinates of the center of the revealed area
  • Size - Radius of the area to be revealed
  • RadarSize - Use to add a radar component to the reveal. Can be used with Size="0" to create a radar-only reveal

SpawnBuilding

Places a building on the map.

  • Name - The name you assign to the building.
  • Template - The name of the building type being created.
  • Player - The player who will own the building.
  • Position - Where the building will be placed.
  • NoDeath - Set this to "1" to make the unit immortal (you can still kill it with a scripted DestroyBuilding command)

SpawnUnit

Places a unit on the map.

  • Name - The name you assign to the unit.
  • Parent - The army the unit will belong to (used to make it easier to issue moves).
  • Template - The type of unit being created.
  • Player - The player that will own the unit.
  • Position - Where the unit will be created.

Var

Set or modify a variable. Tip: Set any variable you want to use to 0 in the initial setup trigger to avoid unpredictable results. All values must be integers.

  • Name - Name of the variable
  • Operation - Operation to be performed
    • "=" or "Set" - set to the value
    • "+" or "Add" - add value
    • "-" or "Sub" - subtract value
    • "Rand" or "SetRand" - set to a random value between Min and Max
    • "AddRand" - add a random value between Min and Max
    • "SubRand" - subtract a random value between Min and Max


 

  • Value - The value to be used in the operation
  • Min - Minimum value for random functions
  • Max - Maximum value for random functions
  • Example - will add three to vFoo's current value