Script Commands

From Ashes of the Singularity - Official Wiki
Revision as of 20:49, 6 December 2020 by JYWLuca8269 (talk | contribs) (Updated look.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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