Script Commands: Difference between revisions

From Ashes of the Singularity - Official Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 51: 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.  


=== [[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)
 
=== [[CaptureNearestNext|CaptureNearestNext]] ===
 
Order 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)  


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


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 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  
Line 116: Line 113:
**Agethon  
**Agethon  


 


*'''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\  
Line 239: Line 238:
*'''Example''' - ''<Var Name="vFoo" Operation="+" Value="3" />'' will add three to vFoo's current value  
*'''Example''' - ''<Var Name="vFoo" Operation="+" Value="3" />'' will add three to vFoo's current value  


[[Category:Modding]]
[[Category:Modding]] [[Category:Commands]]
[[Category:Commands]]

Revision as of 21:04, 18 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.

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)

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)

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