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...")
 
m (Updated look.)
 
(10 intermediate revisions by 2 users not shown)
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.
{{DISPLAYTITLE:<span style="position: absolute; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);">{{FULLPAGENAME}}</span>}}


==List of Commands==
{{HeaderTemplate
|welcome=Script Commands
}}


===[[ActivateTrigger|ActivateTrigger]]===
'''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.
Activate another trigger (also can be used to activate the trigger it is called from, making a repeating trigger).
 
{{SectionTemplate
|h=h3
|title=List of Commands
|content=}}
{{SectionTemplate
|h=h4
|title=ActivateTrigger
|content=}}
[[ActivateTrigger|ActivateTrigger]] activates 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]]===
 
This places a visible indicator on the map to help the player know where they should go to.
{{SectionTemplate
|h=h4
|title=AreaIndicator
|content=}}
[[AreaIndicator|AreaIndicator]] places a visible indicator on the map to help the player know where they should go to.


*'''Name''' - The name of the area.  
*'''Name''' - The name of the area.  
Line 17: Line 32:
*'''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]]===
 
Order an army to move to a specific area, engaging enemies along the way.
{{SectionTemplate
|h=h4
|title=AttackAttackMove
|content=}}
[[AttackAttackMove|AttackAttackMove]] orders 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.  
*'''Name''' - The name of the army that will be given the order.  
Line 24: Line 43:
*'''Position''' - Where the army is ordered to move to.  
*'''Position''' - Where the army is ordered to move to.  


===[[AttackUnit|AttackUnit]]===
 
Order an army to attack a specific script-spawned unit
{{SectionTemplate
|h=h4
|title=AttackUnit
|content=}}
[[AttackUnit|AttackUnit]] orders an army to attack a specific script-spawned unit.


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


===[[Camera|Camera]]===
 
Move the player's view to a specific area.
{{SectionTemplate
|h=h4
|title=Camera
|content=}}
[[Camera|Camera]] moves the player's view to a specific area.


*'''Position''' - Where the camera will be looking.  
*'''Position''' - Where the camera will be looking.  
Line 46: Line 73:




===[[CaptureNearestNext|CaptureNearestNext]]===
{{SectionTemplate
Order an army to capture the nearest neutral or enemy-controlled region
|h=h4
|title=CaptureNearest
|content=}}
[[CaptureNearest|CaptureNearest]] orders 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  
*'''Name''' - The name of the unit to do the capturing  
*'''Repeat''' - Whether to repeat the order (indefinitely)  
*'''Repeat''' - Whether to repeat the order (indefinitely)  


===[[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)
{{SectionTemplate
|h=h4
|title=CaptureNearestNext
|content=}}
[[CaptureNearestNext|CaptureNearestNext]] orders an army to capture the nearest neutral or enemy-controlled region.


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


===[[ChangeAIDifficulty|ChangeAIDifficulty]]===
 
Change an AI player's difficulty setting
{{SectionTemplate
|h=h4
|title=ChangeAIDifficulty
|content=}}
[[ChangeAIDifficulty|ChangeAIDifficulty]] changes an AI player's difficulty setting.


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


===[[ChangeAIPersonality|ChangeAIPersonality]]===
 
Change an AI player's personality
{{SectionTemplate
|h=h4
|title=ChangeAIPersonality
|content=}}
[[ChangeAIPersonality|ChangeAIPersonality]] changes an AI player's personality.


*'''Player''' - The index of the player to change  
*'''Player''' - The index of the player to change  
*'''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]]===
 
Destroys a specific script-spawned building.
{{SectionTemplate
|h=h4
|title=DestroyBuilding
|content=}}
[[DestroyBuilding|DestroyBuilding]] 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]]===
 
Destroys a specific script-spawned unit.
{{SectionTemplate
|h=h4
|title=DestroyUnit
|content=}}
[[DestroyUnit|DestroyUnit]] 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]]===
This creates a popup that can convey information or story to the player. Use with <Entry> tags.


===[[Entry|Entry]]===
{{SectionTemplate
The actual text that will be displayed. Use only within <Dialog> tags.
|h=h4
|title=Dialog
|content=}}
[[Dialog|Dialog]] creates a popup that can convey information or story to the player. Use with <Entry> tags.
 
 
{{SectionTemplate
|h=h4
|title=Entry
|content=}}
[[Entry|Entry]] is the actual text that will be displayed. Use only within <Dialog> tags.


*'''Text''' - The actual text that is displayed. Corresponds to an entry in a .csv file in \Assets\UIText\
*'''Icon''' - The icon used with the text popup. Hard-coded to correspond to Ashes characters, and changes the text color to match.  
*'''Icon''' - The icon used with the text popup. Hard-coded to correspond to Ashes characters, and changes the text color to match.  
**Mac  
**Mac  
Line 94: Line 153:
**Ventrix  
**Ventrix  
**Athena  
**Athena  
**Adrasteia
**Narrator
**Agememnon  
**Agememnon  
**Agethon  
**Agethon  




*'''Text''' - The actual text that is displayed. Corresponds to an entry in a .csv file in \Assets\UIText\
{{SectionTemplate
 
|h=h4
===[[EndMission|EndMission]]===
|title=EndMission
Use to force a win or loss of the scenario.
|content=}}
[[EndMission|EndMission]] used to force a win or loss of the scenario.


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


===[[GrantStuff|GrantStuff]]===
 
Give a player free resources.
{{SectionTemplate
|h=h4
|title=GrantStuff
|content=}}
[[GrantStuff|GrantStuff]] gives a player free resources.


*'''Player''' - The index of the player to be hooked up  
*'''Player''' - The index of the player to be hooked up  
Line 116: Line 180:
*'''Turinium''' - The amount of victory points being granted.  
*'''Turinium''' - The amount of victory points being granted.  


===[[GrantTech|GrantTech]]===
 
Give a player a free Quantum Upgrade
{{SectionTemplate
|h=h4
|title=GrantTech
|content=}}
[[GrantTech|GrantTech]] gives a player a free Quantum Upgrade


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


===[[HidePanel|HidePanel]]===
 
Hide UI panels.
{{SectionTemplate
|h=h4
|title=HidePanel
|content=}}
[[HidePanel|HidePanel]] hides UI panels.


*'''HidePlayer''' - Hide the Player panel  
*'''HidePlayer''' - Hide the Player panel  
Line 129: Line 201:
*'''HideResource''' - Hide the Resource panel  
*'''HideResource''' - Hide the Resource panel  


===[[LetterBox|LetterBox]]===
 
Disable commands and go to a cinematic, letterbox view.
{{SectionTemplate
|h=h4
|title=LetterBox
|content=}}
[[LetterBox|LetterBox]] disables commands and go to a cinematic, letterbox view.


*'''Enable''' - 1 to turn letterbox mode on, 0 to turn it off  
*'''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  
*'''Snap''' - 1 to immediately go to/from letterbox mode instead of fading in/out  


===[[MoveUnit|MoveUnit]]===
 
Move an army to a location without stopping to fight
{{SectionTemplate
|h=h4
|title=MoveUnit
|content=}}
[[MoveUnit|MoveUnit]] moves an army to a location without stopping to fight


*'''Name''' - Name of the unit to be moved  
*'''Name''' - Name of the unit to be moved  
Line 143: Line 223:
*'''Stop''' - 1 to stop the unit  
*'''Stop''' - 1 to stop the unit  


===[[Objective|Objective]]===
 
Use this to set objective notifications for the player (so they know what to do).
{{SectionTemplate
|h=h4
|title=Objective
|content=}}
[[Objective|Objective]] is used 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.  
*'''Name''' - The name of the objective, use this name when checking or hiding it.  
Line 151: Line 235:
*'''SetCheck''' - If the objective checkbox is checked or not.  
*'''SetCheck''' - If the objective checkbox is checked or not.  


===[[Restrict|Restrict]]===
 
To block the player from being able to access objects in the game.
{{SectionTemplate
|h=h4
|title=Restrict
|content=}}
[[Restrict|Restrict]] blocks 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.  
*'''Type''' - Unit, Building, Research or Orbital. Whatever type of object that is being restricted.  
Line 158: Line 246:
*'''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 the fog of war over a location
{{SectionTemplate
|h=h4
|title=Reveal
|content=}}
[[Reveal|Reveal]] reveals the fog of war over a location


*'''Name''' - The name of this reveal (so you can modify it with a later command)  
*'''Name''' - The name of this reveal (so you can modify it with a later command)  
Line 167: Line 259:
*'''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]]===
 
Places a building on the map.
{{SectionTemplate
|h=h4
|title=SpawnBuilding
|content=}}
[[SpawnBuilding|SpawnBuilding]] places a building on the map.


*'''Name''' - The name you assign to the building.  
*'''Name''' - The name you assign to the building.  
Line 176: Line 272:
*'''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]]===
 
Places a unit on the map.
{{SectionTemplate
|h=h4
|title=SpawnUnit
|content=}}
[[SpawnUnit|SpawnUnit]] places a unit on the map.


*'''Name''' - The name you assign to the unit.  
*'''Name''' - The name you assign to the unit.  
Line 185: Line 285:
*'''Position''' - Where the unit will be created.  
*'''Position''' - Where the unit will be created.  


===[[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.''
{{SectionTemplate
|h=h4
|title=Var
|content=}}
[[Var_Command|Var]] sets or modifies 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  
*'''Name''' - Name of the variable  
*'''Value''' - The value to be used in the operation
*'''Min''' - Minimum value for random functions
*'''Max''' - Maximum value for random functions
*'''Operation''' - Operation to be performed  
*'''Operation''' - Operation to be performed  
**"=" or "Set" - set to the value  
**"=" or "Set" - set to the value  
Line 197: Line 304:
**"SubRand" - subtract a random value between Min and Max  
**"SubRand" - subtract a random value between Min and Max  


 
[[Category:Modding]] [[Category:Commands]]
*'''Value''' - The value to be used in the operation
*'''Min''' - Minimum value for random functions
*'''Max''' - Maximum value for random functions
*'''Example''' - ''<Var Name="vFoo" Operation="+" Value="3" />'' will add three to vFoo's current value

Latest revision as of 20:49, 6 December 2020


Script Commands


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

ActivateTrigger activates 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

AreaIndicator 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

AttackAttackMove orders 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

AttackUnit orders 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

Camera moves 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.


CaptureNearest

CaptureNearest orders 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)


CaptureNearestNext

CaptureNearestNext orders 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)


ChangeAIDifficulty

ChangeAIDifficulty changes 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

ChangeAIPersonality changes 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

DestroyBuilding destroys a specific script-spawned building.

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


DestroyUnit

DestroyUnit destroys a specific script-spawned unit.

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


Dialog

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


Entry

Entry is the actual text that will be displayed. Use only within <Dialog> tags.

  • Text - The actual text that is displayed. Corresponds to an entry in a .csv file in \Assets\UIText\
  • 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
    • Narrator
    • Agememnon
    • Agethon


EndMission

EndMission used 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

GrantStuff gives 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

GrantTech gives 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 | NexusHPs ]


HidePanel

HidePanel hides UI panels.

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


LetterBox

LetterBox disables 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

MoveUnit moves 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

Objective is used 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

Restrict blocks 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 reveals 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

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

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

Var sets or modifies 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
  • Value - The value to be used in the operation
  • Min - Minimum value for random functions
  • Max - Maximum value for random functions
  • 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