Skip to content

AI Scripting and Mapping

This page describes all AI scripting and mapping related additions and changes introduced by Phobos.

Bugfixes and Miscellanous

  • Script action Move to cell now obeys YR cell calculation now. Using 1000 * Y + X as its cell value. (was 128 * Y + X as it's a RA1 leftover)
  • The game now can reads waypoints ranges in [0, 2147483647]. (was [0,701])
  • Map trigger action 41 Play Animation At... can now create 'non-inert' animations which can play sounds, deal damage and apply TiberiumChainReaction if a parameter is set (needs following changes to fadata.ini).
  • Map trigger action 125 Build At... can now play buildup anim and becomes singleplayer-AI-repairable optionally (needs following changes to fadata.ini).
  • Both Global Variables (VariableNames in rulesmd.ini) and Local Variables (VariableNames in map) are now unlimited.
  • Script action Deploy now has vehicles with DeploysInto searching for free space to deploy at if failing to do so at initial location, instead of simply getting stuck.
  • Teams spawned by trigger action 7,80,107 can use IFV and opentopped logic normally.
  • If a pre-placed building has a NaturalParticleSystem, it used to always be created when the game starts. This has been removed.
  • Superweapons used by AI for script actions 56 Chronoshift to Building, 57 Chronoshift to a Target Type and 10104 Chronoshift to Enemy Base can now be explicitly set via [General] -> AIChronoSphereSW & AIChronoWarpSW respectively. If AIChronoSphereSW is set but AIChronoWarpSW is not, game will check former's SW.PostDependent for a second superweapon to use. Otherwise if not set, last superweapon listed in [SuperWeaponTypes] with Type=ChronoSphere or Type=ChronoWarp will be used, respectively.
  • Fixed AI team recruitment inconsistency causing underfilled teams.

Increased Overlay Limit

  • Maps can now contain OverlayTypes with indices up to 65535.

  • To enable this, set [Basic] -> NewINIFormat=5 in the scenario file.

Note

Maps using this feature cannot be loaded by the vanilla game.

Warning

Not all tools properly support this feature yet, and may crash or corrupt the map. We recommend using the World-Altering Editor map editor when using this feature.

Singleplayer Mission Maps

Base node repairing

  • In singleplayer campaign missions you can now decide whether AI can repair the base nodes / buildings delivered by SW (Ares feature).
    • You can control it globally by setting [Basic] -> RepairBaseNodes, or locally by setting the flag with same name in [Some House] in certain map file. The global one will be overriden if the local one is set.

In rulesmd.ini:

ini
[Basic]
RepairBaseNodes=false              ; boolean

In map file:

ini
[Country House]
RepairBaseNodes=                   ; List of 3 booleans indicating whether AI repair basenodes in Easy / Normal / Difficult game diffculty.

Default loading screen and briefing offsets

  • It is now possible to set defaults for singleplayer map loading screen briefing pixel offsets and the loading screen images and palette that are used if there are no values defined for the map itself or in case of loading screens and palette, if the files are missing.

In missionmd.ini:

ini
[Defaults]
DefaultLS640BriefLocX=0  ; integer
DefaultLS640BriefLocY=0  ; integer
DefaultLS800BriefLocX=0  ; integer
DefaultLS800BriefLocY=0  ; integer
DefaultLS640BkgdName=    ; filename - including the .shp extension.
DefaultLS800BkgdName=    ; filename - including the .shp extension.
DefaultLS800BkgdPal=     ; filename - including the .pal extension

Note

Despite the key name being DefaultLS800BkgdPal, this applies to both shapes just like the original scenario-specific LS800BkgdPal does.

MCV redeploying

  • You can now decide whether MCV can redeploy in singleplayer campaign missions by setting [Basic] -> MCVRedeploys. Overrides [MultiplayerDialogSettings] -> MCVRedeploys only in singleplayer campaign missions.

In map file:

ini
[Basic]
MCVRedeploys=                 ; boolean
  • By default the singleplayer mission par times and message strings are defined in [Ranking] section of the map file itself. These can now also be set in the map file's section in missionmd.ini, taking precedence over the map file's settings but defaulting to them if not set.

In missionmd.ini:

ini
[SOMEMISSION]             ; Filename of mission map
Ranking.ParTimeEasy=      ; time string (hh:mm:ss)
Ranking.ParTimeMedium=    ; time string (hh:mm:ss)
Ranking.ParTimeHard=      ; time string (hh:mm:ss)
Ranking.UnderParTitle=    ; CSF entry key
Ranking.UnderParMessage=  ; CSF entry key
Ranking.OverParTitle=     ; CSF entry key
Ranking.OverParMessage=   ; CSF entry key

Show briefing dialog on startup

  • You can now have the briefing dialog screen show up on singleplayer campaign mission startup by setting ShowBriefing to true in map file's [Basic] section, or in the map file's section in missionmd.ini (former takes precedence if available). This can be disabled by user by setting ShowBriefing to false in RA2MD.INI.
    • BriefingTheme (In order of precedence from highest to lowest: map file, missionmd.ini, side entry in rulesmd.ini) can be used to define a custom theme to play on this briefing screen. If not set, the loading screen theme will keep playing until the scenario starts properly.
    • String labels for the startup briefing dialog screen's resume button as well as the button's status bar text can be customized by setting ShowBriefingResumeButtonLabel and ShowBriefingResumeButtonStatusLabel respectively. They default to the same labels used by the briefing screen dialog when opened otherwise.

In missionmd.ini:

ini
[SOMEMISSION]   ; Filename of mission map
ShowBriefing=   ; boolean
BriefingTheme=  ; Theme name

In map file:

ini
[Basic]
ShowBriefing=false  ; boolean
BriefingTheme=      ; Theme name

In rulesmd.ini:

ini
[SOMESIDE]      ; Side
BriefingTheme=  ; Theme name

In uimd.ini:

ini
[UISettings]
ShowBriefingResumeButtonLabel=GUI:Resume                      ; CSF entry key
ShowBriefingResumeButtonStatusLabel=STT:BriefingButtonReturn  ; CSF entry key

In RA2MD.INI:

ini
[Phobos]
ShowBriefing=true  ; boolean

Script Actions

10000-10999 Ingame Actions

10000-10049 Attack Actions

  • These actions instruct the TeamType to use the TaskForce to approach and attack the target specified by the second parameter which is an index of a generic pre-defined group. Look at the tables below for the possible actions (first parameter value) and arguments (the second parameter value).
  • For threat-based attack actions TargetSpecialThreatCoefficientDefault and EnemyHouseThreatBonus tags from rulesmd.ini are accounted.
  • All aircraft that attack other air units will end the script. This behavior is intentional because without it aircraft had some bugs that weren't fixable at the time of developing the feature.
  • AITargetTypes actions instruct the TeamType to use the TaskForce to approach and attack the target specified by the second parameter which is an index of a modder-defined group from AITargetTypess. Look at the tables below for the possible actions (first parameter value) and arguments (the second parameter value).

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=i,n             ; For i values check the next table
ActionArgumentRepeatsTarget PriorityDescription
10000Target Type#YesCloser
10001Target Type#NoCloserEnds when a team member kill the designated target
10002AITargetTypes index#YesCloser
10003AITargetTypes index#NoCloserEnds when a team member kill the designated target
10004AITargetTypes index#YesCloserPicks 1 random target from the list
10005Target Type#YesFarther
10006Target Type#NoFartherEnds when a team member kill the designated target
10007AITargetTypes index#YesFarther
10008AITargetTypes index#NoFartherEnds when a team member kill the designated target
10009AITargetTypes index#YesFartherPicks 1 random target from the list
10010Target Type#YesCloser, higher threat
10011Target Type#NoCloser, higher threatEnds when a team member kill the designated target
10012AITargetTypes index#YesCloser, higher threat
10013AITargetTypes index#NoCloser, higher threatEnds when a team member kill the designated target
10014Target Type#YesFarther, higher threat
10015Target Type#NoFarther, higher threatEnds when a team member kill the designated target
10016AITargetTypes index#YesFarther, higher threat
10017AITargetTypes index#NoFarther, higher threatEnds when a team member kill the designated target
  • The following values are the Target Type# which can be used as second parameter of the new attack script actions:
    • 'Buildings considered as vehicles' means buildings with both UndeploysInto set & Foundation=1x1 and ConsideredVehicle not set or buildings with ConsideredVehicle=true.
ValueTarget TypeDescription
1AnythingAny enemy VehicleTypes, AircraftTypes, InfantryTypes and BuildingTypes
2StructuresAny enemy BuildingTypes that are not considered as vehicles
3Ore MinersAny enemy VehicleTypes with Harvester=yes or ResourceGatherer=yes, BuildingTypes with ResourceGatherer=yes
4InfantryAny enemy InfantryTypes
5VehiclesAny enemy VehicleTypes or buildings considered as vehicles
6FactoriesAny enemy BuildingTypes with a Factory= setting
7Base DefensesAny enemy BuildingTypes with IsBaseDefense=yes
8House ThreatsAny object that targets anything of the Team's House or any enemy that is near to the Team Leader
9Power PlantsAny enemy BuildingTypes with positive Power= values
10OccupiedAny BuildingTypes with garrisoned infantry
11Tech BuildingsAny BuildingTypes with Capturable=yes and NeedsEngineer=yes
12RefineryAny enemy BuildingTypes with Refinery=yes or ResourceGatherer=yes, VehicleTypes with ResourceGatherer=yes & Harvester=no (i.e. Slave Miner)
13Mind ControllerAnything VehicleTypes, AircraftTypes, InfantryTypes and BuildingTypes with MindControl=yes in the weapons Warheads
14Air Units (incl. landed)Any enemy, AircraftTypes and Jumpjet=yes VehicleTypes or InfantryTypes, including landed ones as well as any other currently airborne units
15NavalAny enemy BuildingTypes and VehicleTypes with a Naval=yes, any enemy VehicleTypes, AircraftTypes, InfantryTypes in a water cell
16DisruptorsAny enemy objects with positive InhibitorRange= values, positive RadarJamRadius= values, CloakGenerator=yes or GapGenerator=yes
17Ground VehiclesAny enemy VehicleTypes without Naval=yes, landed AircraftTypes or buildings considered as vehicles
18EconomyAny enemy VehicleTypes with Harvester=yes or ResourceGatherer=yes, BuildingTypes with Refinery=yes, ResourceGatherer=yes or OrePurifier=yes
19Infantry FactoryAny enemy BuildingTypes with Factory=InfantryType
20Vehicle FactoryAny enemy BuildingTypes with with Naval=no and Factory=UnitType
21Aircraft FactoryAny enemy BuildingTypes with Factory=AircraftType
22RadarAny enemy BuildingTypes with Radar=yes or SpySat=yes
23Tech LabAny enemy BuildingTypes in [AI]>BuildTech= list
24Naval FactoryAny enemy BuildingTypes with Naval=yes and Factory=UnitType
25Super WeaponAny enemy BuildingTypes with SuperWeapon=, SuperWeapon2= or SuperWeapons=
26Construction YardAny enemy BuildingTypes with ConstructionYard=yes and Factory=BuildingType
27NeutralsAny neutral object (Civilian)
28GeneratorsAny enemy BuildingTypes with CloakGenerator=yes or GapGenerator=yes
29Radar JammerAny enemy objects with positive RadarJamRadius= values
30InhibitorsAny enemy objects with positive InhibitorRange= values
31Naval UnitsAny enemy VehicleTypes with a Naval=yes or any enemy VehicleTypes, AircraftTypes, InfantryTypes in a water cell
32Mobile UnitsAnything VehicleTypes, AircraftTypes and InfantryTypes
33CapturableAny BuildingTypes with Capturable=yes or any BuildingTypes with BridgeRepairHut=yes that are linked to broken bridges
34Area ThreatsAny enemy object that is inside of the Team Leader's Guard Area
35Vehicle & Naval FactoryAny enemy BuildingTypes with Factory=UnitType
36Non-defensive StructuresAny enemy BuildingTypes with IsBaseDefense=no
37Bridge Repair HutsAny BuildingTypeswith BridgeRepairHut=yes that are linked to broken bridges
  • The second parameter with a 0-based index for the AITargetTypes section specifies the list of possible VehicleTypes, AircraftTypes, InfantryTypes and BuildingTypes that can be evaluated.
  • The AITargetTypes index# values are obtained in the new AITargetTypes section that must be declared in rulesmd.ini:

In rulesmd.ini:

ini
[AITargetTypes]  ; List of TechnoType lists
0=SOMETECHNOTYPE,SOMEOTHERTECHNOTYPE,SAMPLETECHNOTYPE
1=ANOTHERTECHNOTYPE,YETANOTHERTECHNOTYPE
...

10050-10099 Move Team to Techno Location actions

  • These actions instructs the TeamType to use the TaskForce to approach the target specified by the second parameter. Look at the tables below for the possible actions (first parameter value).

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=i,n             ; For i values check the next table
ActionArgumentTarget OwnerTarget PriorityDescription
10050Target Type#EnemyCloser, higher threat
10051[AITargetType] index#EnemyCloser, higher threat
10052[AITargetType] index#EnemyCloserPicks 1 random target from the selected list
10053Target Type#FriendlyCloser
10054[AITargetType] index#FriendlyCloser
10055[AITargetType] index#FriendlyCloserPicks 1 random target from the selected list
10056Target Type#EnemyFarther, higher threat
10057[AITargetType] index#EnemyFarther, higher threat
10058[AITargetType] index#EnemyFartherPicks 1 random target from the selected list
10059Target Type#FriendlyFarther
10060[AITargetType] index#FriendlyFarther
10061[AITargetType] index#FriendlyFartherPicks 1 random target from the selected list

10100-10999 General Purpose

10100 Timed Area Guard
  • Puts the TaskForce into Area Guard mode for the given units of time. Unlike the original timed Guard script action (5,n) that just stays in place doing a basic guard operation this action has a more active role attacking nearby invaders or defending units that needs protection.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=10100,n         ; integer, time in ingame seconds
10101 Wait Until Ammo is Full
  • If the TaskForce contains unit(s) that use ammo then the the script will not continue until all these units have fully refilled the ammo.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=10101,0
10102 Regroup Temporarily Around the Team Leader
  • Puts the TaskForce into Area Guard mode for the given amount of time around the Team Leader (this unit remains almost immobile until the action ends). The default radius around the leader is [General] -> CloseEnough and the units will not leave that area.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=10102,n
10103 Load onto Transports
  • If the TaskForce contains unit(s) that can be carried by the transports of the same TaskForce then this action will make the units enter the transports. In single player missions the next action must be "Wait until fully loaded" (43,0) or the script will not continue.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=10103,0
10104 Chronoshift to Enemy Base
  • Chronoshifts the members of the TeamType using first available Type=ChronoSphere superweapon to a location within [General] -> AISafeDistance (plus the additional distance defined in parameter, can be negative) cells from enemy house's base. The superweapon must be charged up to atleast [General] -> AIMinorSuperReadyPercent percentage of its recharge time to be available for use by this action.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=10104,n         ; integer, additional distance in cells

12000-12999 Suplementary/Setup Pre-actions

12000 Wait if No Target Found

  • When executed before a new Attack ScriptType actions like Generic Target Type Attack actions and AITargetTypes Attack actions the TeamType will remember that must wait 1 second if no target was selected. The second parameter is a positive value that specifies how much retries the Attack will do when no target was found before new Attack ScriptType Action is discarded & the script execution jumps to the next line. The value 0 means infinite retries.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=12000,n         ; integer n=0

12001 Modify Target Distance

  • By default Move Team to Techno Location actions ends when the Team Leader reaches a distance declared in rulesmd.ini called CloseEnough. When this action is executed before the actions Move Team to Techno Location overwrites CloseEnough value. This action works only the first time and CloseEnough will be used again the next Movement action.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=12001,n

12002 Set Move Action End Mode

  • Sets how the Movement actions ends and jumps to the next line. This action works only the first time and CloseEnough will be used again the next Movement action.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=12002,n
  • The possible argument values are:
ArgumentAction ends when...
0Team Leader reaches the minimum distance
1One unit reaches the minimum distance
2All team members reached the minimum distance

14000-14999 Utility Actions

14000 Team's Trigger Weight Reward

  • When executed before a new Attack ScriptType actions like Generic Target Type Attack actions and AITargetTypes Attack actions the TeamType will remember that must be rewarded increasing the current weight of the AI Trigger when the TeamType Target was killed by any of the Team members. The current weight will never surprass the minimum weight and maximum weight limits of the AI Trigger. The second parameter is a positive value.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=14000,n         ; integer n=0

14001 Increase AI Trigger Current Weight

  • When executed this increases the current weight of the AI Trigger. The current weight will never surprass the minimum weight and maximum weight limits of the AI Trigger. Take note that all TeamTypes of the same AI Trigger will update the AI Trigger Current Weight sooner or later. The second parameter is a positive value. Take note that the original game only uses the first of the two Teams for calculating the AI Trigger Current weight at the end of the Trigger life, this action ignores if the Team is the first or the second of the AI Trigger and the Current weight is calculated when is executed the action.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=14001,n

14002 Decrease AI Trigger Current Weight

  • When executed this decreases the current weight of the AI Trigger. Details same as above.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=14002,n

14003 Unregister Team Success

  • Is just the opposite effect of the script action 49,0. Like if the Team failed.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=14003,0

14004 Force Global OnlyTargetHouseEnemy value in Teams for new attack / move actions introduced by Phobos

  • Globally forcibly set a value for the OnlyTargetHouseEnemy tag on TeamType. Only affects the new attack / move actions introduced by Phobos.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=14004,n         ; integer
  • The possible argument values are:
ArgumentDescription
-1Disable Global value for Force OnlyTargetHouseEnemy tag. Default value
0Force OnlyTargetHouseEnemy = false
1Force OnlyTargetHouseEnemy = true
2Force random boolean value

16000-16999 Flow Control

16000 Start a Timed Jump to the Same Line

  • When the timer ends the current script action ends and start again the same script action. The timer jump repeats again (infinite loop) until is stopped with action 16002 or the team is destroyed.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=16000,n         ; integer n=0, in ingame seconds

16001 Start a Timed Jump to the Next Line

  • When the timer ends the current script action ends and start the next one in the script type list.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=16001,n         ; integer n=0, in ingame seconds

16002 Stop the Timed Jumps

  • If the Timed Jumps were activated this action stop the process.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=16002,0

16003 Randomly Skip Next Action

  • When executed this action picks a random value between 1 and 100. If the value is equal or below the second parameter then the next action will be skipped. If the second parameter is 0 means that the next action will never be skipped and 100 means thay always will be skipped.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=16003,n         ; where 0 > n <= 100

16004 Pick a Random Script

  • When executed this action picks a random Script Type and replaces the current script by the new picked one. The second parameter is a 0-based index from the new section AIScriptsList explained below.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=16004,n

The second parameter is a 0-based index for the AIScriptsList section that specifies the list of possible ScriptTypes that can be evaluated. The new AIScriptsList section must be declared in rulesmd.ini for making this script work:

In rulesmd.ini:

ini
[AIScriptsList]  ; List of ScriptType lists
0=SOMESCRIPTTYPE,SOMEOTHERSCRIPTTYPE,SAMPLESCRIPTTYPE
1=ANOTHERSCRIPTTYPE,YETANOTHERSCRIPTTYPE
...

16005 Jump Back To Previous Script

  • Used in a Random Script picked by action 94. It can jump back to the previous script, and continue in the line after x=94,n.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=16005,0

18000-18999 Variable Manipulation

18000-18023 Edit Variable

  • Operate a variable's value.
  • The variable's value type is int16 instead of int32 in trigger actions for some reason, which means it ranges from -2^15 to 2^15-1.
  • Any numbers exceeding this limit will lead to unexpected results!

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=i,n             ; where 18000 <= i <= 18023, n is made up of two parts, the low 16 bits is being used to store the variable index, the high 16 bits is being used for storing the param value.

18024 - 18047 Edit Variable using Local Variable

  • Operate a variable's value using a local variable's value.
  • Similar to 18000-18023, but the number to operate the value is being read from a local variable.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=i,n             ; where 18024 <= i <= 18047, n is made up of two parts, the low 16 bits is being used to store the variable index, the high 16 bits is being used for storing the local variable index.

18000 - 18071 Edit Variable using Global Variable

  • Operate a variable's value using a global variable's value.
  • Similar to 18000-18023, but the number to operate the value is being read from a global variable.

In aimd.ini:

ini
[SOMESCRIPTTYPE]  ; ScriptType
x=i,n             ; where 18048 <= i <= 18071, n is made up of two parts, the low 16 bits is being used to store the variable index, the high 16 bits is being used for storing the global variable index.

19000-19999 Miscellanous/Uncategorized

This category is empty for now.

Trigger Actions

500 Save Game

  • Save the current game immediately.

Note

For this action to work in multiplayer - you need to use a version of YRpp spawner with multiplayer saves support.

  • These vanilla CSF entries will be used: TXT_SAVING_GAME, TXT_GAME_WAS_SAVED and TXT_ERROR_SAVING_GAME.
  • The save's description will look like MapDescName - CSFText.
  • For example: Allied Mission 25: Esther's Money - Money Stolen.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],500,4,[CSFKey],0,0,0,0,A,[ActionX]
...

501 Edit Variable

  • Operate a variable's value.
  • The variable's value type is int32, which means it ranges from -2^31 to 2^31-1.
  • Any numbers exceeding this limit will lead to unexpected results!

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],501,0,[VariableIndex],[Operation],[Number],[IsGlobalVariable],0,A,[ActionX]
...
OperationDescription
0CurrentValue = Number
1CurrentValue = CurrentValue + Number
2CurrentValue = CurrentValue - Number
3CurrentValue = CurrentValue * Number
4CurrentValue = CurrentValue / Number
5CurrentValue = CurrentValue % Number
6CurrentValue = CurrentValue leftshift Number
7CurrentValue = CurrentValue rightshift Number
8CurrentValue = ~CurrentValue
9CurrentValue = CurrentValue xor Number
10CurrentValue = CurrentValue or Number
11CurrentValue = CurrentValue and Number

502 Generate random number

  • Generate a random integer ranged in [Min, Max] and store it in a given variable.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],502,0,[VariableIndex],[Min],[Max],[IsGlobalVariable],0,A,[ActionX]
...

503 Print variable value

  • Print a variable value to the message list.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],503,0,[VariableIndex],[IsGlobalVariable],0,0,0,A,[ActionX]
...

504 Binary Operation

  • Operate a variable's value with another variable's value.
  • Similar to 501, but the operation number is read from another variable.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],504,0,[VariableIndex],[Operation],[VariableForOperationIndex],[IsGlobalVariable],[IsOperationGlobalVariable],A,[ActionX]
...

Operation can be looked up at action 501.

505 Fire Super Weapon at specified location

  • Use with caution
  • Launch a Super Weapon from [SuperWeaponTypes] list at a specified location.
  • HouseIndex can take various values:
House IndexDescription
>= 0The index of the current House in the map
4475-4482Like in the index range 0-7
-1Pick a random House that isn't Neutral
-2Pick the first Neutral House
-3Pick a random Human Player
  • Coordinates X & Y can take possitive values or -1, in which case these values can take a random value from the visible map area.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],505,0,0,[SuperWeaponTypesIndex],[HouseIndex],[CoordinateX],[CoordinateY],A,[ActionX]
...

506 Fire Super Weapon at specified Waypoint

  • Use with caution
  • Launch a Super Weapon from [SuperWeaponTypes] list at a specified waypoint.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],506,0,0,[SuperWeaponTypesIndex],[HouseIndex],[WaypointIndex],0,A,[ActionX]
...

510 Toggle MCV redeployablility

  • Force MCV's redeployablility by setting the third parameter.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],510,0,0,[MCVRedeploy],0,0,0,A,[ActionX]
...

511 Undeploy Building to Waypoint

  • Undeploy specific BuildingTypes into VehicleTypes and move them to a specific Waypoint.
    • If <All> is entered for the Building Type here, then undeploy all BuildingTypes.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],511,-10,[BuildingTypesID],[HouseIndex],0,0,0,[WaypointIndex],[ActionX]
...

606 Edit Hate-Value

  • Edit the hate-value that trigger houses to other houses.
  • -1 works for all houses.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],606,0,[HouseIndex],[Operation],[Number],0,0,A,[ActionX]
...
OperationDescription
0CurrentValue = Number
1CurrentValue = CurrentValue + Number
2CurrentValue = CurrentValue - Number
3CurrentValue = CurrentValue * Number
4CurrentValue = CurrentValue / Number
5CurrentValue = CurrentValue % Number
6CurrentValue = CurrentValue leftshift Number
7CurrentValue = CurrentValue rightshift Number
8CurrentValue = ~CurrentValue
9CurrentValue = CurrentValue xor Number
10CurrentValue = CurrentValue or Number
11CurrentValue = CurrentValue and Number

607 Clear Hate-Value

  • Clear the hate-value that trigger houses to other houses.
  • -1 works for all houses.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],607,0,[HouseIndex],0,0,0,0,A,[ActionX]
...

608 Set Force Enemy

  • Force an enemy, it will not change with the change of hate-value.
  • -1 will remove the forced enemy.
  • -2 will never have any enemies.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],608,0,0,[HouseIndex],0,0,0,A,[ActionX]
...

609 Set Radar Mode

  • Change the current radar mode of the trigger house.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],609,0,0,[RadarMode],0,0,0,A,[ActionX]
...
  • The possible argument values are:
ArgumentDescription
0Normal mode, requires buildings that provide radar and sufficient power
1Change to FreeRadar mode
2Force enable radar
3Force disable radar

610 Set house's TeamDelays value

  • Set the TeamDelays value of the trigger's house.
    • If this value is less than 0, then use the value of [General] -> TeamDelays.

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],610,0,0,[Number],0,0,0,A,[ActionX]
...

800-802 Display Banner

  • Display a 'banner' at a fixed location that is relative to the screen.
    • Action 800 will create a new banner or replace the banner with the same Banner ID if it exists. Using a local variable's value when displaying a text banner.
    • Action 801 will create a new banner or replace the banner with the same Banner ID if it exists. Using a global variable's value when displaying a text banner.
    • Action 802 will delete the banner corresponding to the set Banner ID.
  • To make use of this, you need to set the properties of a BannerType in your ini file. The banner can either be a PCX file, a Shape (SHP) file or a CSF text. If multiple are set the first one in the above listed order takes effect.
    • SHP.Palette controls the palette that'll be used when drawing a banner for Shape file.
    • CSF.Color controls the color of the text that'll be used when drawing a text banner.
    • CSF.Background controls whether a black background will be displayed below the text banner.
    • CSF.VariableFormat controls the way to print a variable together with the text banner.
      • none will make the text banner not display the variable.
      • variable will make the text banner display the variable alone and will ignore the text in CSF.
      • prefix/prefixed will make the text banner display the variable before any other text.
      • suffix/suffixed will make the text banner display the variable after any other text.
    • Duration determines how long the banner will be displayed. Negative values mean the banner can always be displayed until being deleted. The banner itself won't be deleted when it's not displaying.
    • Delay determines when the banner will be displayed again after it stops displaying by a positive Duration. Neagtive values mean it can't be displayed again.
      • If an SHP banner displays again after the delay, it'll start from the frame when it's stopped last time. This can also be changed to its first frame if SHP.RefreshAfterDelay set to true.

In rulesmd.ini:

ini
[BannerTypes]
0=SOMEBANNER

[SOMEBANNER]                ; BannerType
PCX=                        ; filename - including the .pcx extension
SHP=                        ; filename - including the .shp extension
SHP.Palette=palette.pal     ; filename - including the .pal extension
SHP.RefreshAfterDelay=false ; boolean
CSF=                        ; CSF entry key
CSF.Color=                  ; integer - Red,Green,Blue, defaults to MessageTextColor of the owner Side
CSF.Background=false        ; boolean
CSF.VariableFormat=none     ; List of Variable Format Enumeration (none|variable|prefix/prefixed|surfix/surfixed)
Duration=-1                 ; integer
Delay=-1                    ; integer

In mycampaign.map:

ini
[Actions]
...
ID=ActionCount,[Action1],800,4,[SOMEBANNER],[Unique ID],[Horizontal position],[Vertical position],[VariableIndex],A,[ActionX]
ID=ActionCount,[Action1],801,4,[SOMEBANNER],[Unique ID],[Horizontal position],[Vertical position],[VariableIndex],A,[ActionX]
ID=ActionCount,[Action1],802,0,[Unique ID],0,0,0,0,A,[ActionX]
...

Trigger events

500-511 Variable comparation

  • Compares the variable's value with given number.

In mycampaign.map:

ini
[Events]
...
ID=EventCount,[Event1],[EVENTID],2,[VariableIndex],[Param],[EventX]
...
Event IDDescriptionGlobal
500CurrentValue > NumberNo
501CurrentValue < NumberNo
502CurrentValue = NumberNo
503CurrentValue >= NumberNo
504CurrentValue <= NumberNo
505CurrentValue & NumberNo
506CurrentValue > NumberYes
507CurrentValue < NumberYes
508CurrentValue = NumberYes
509CurrentValue >= NumberYes
510CurrentValue <= NumberYes
511CurrentValue & NumberYes

512-523 Variable comparation with local variable

  • Compares the variable's value with given local variable value.

In mycampaign.map:

ini
[Events]
...
ID=EventCount,[Event1],[EVENTID],2,[VariableIndex],[LocalVariableIndex],[EventX]
...
Event IDDescriptionGlobal
512CurrentValue > LocalVariableValueNo
513CurrentValue < LocalVariableValueNo
514CurrentValue = LocalVariableValueNo
515CurrentValue >= LocalVariableValueNo
516CurrentValue <= LocalVariableValueNo
517CurrentValue & LocalVariableValueNo
518CurrentValue > LocalVariableValueYes
519CurrentValue < LocalVariableValueYes
520CurrentValue = LocalVariableValueYes
521CurrentValue >= LocalVariableValueYes
522CurrentValue <= LocalVariableValueYes
523CurrentValue & LocalVariableValueYes

524-535 Variable comparation with global variable

  • Compares the variable's value with given global variable value.

In mycampaign.map:

ini
[Events]
...
ID=EventCount,[Event1],[EVENTID],2,[VariableIndex],[GlobalVariableIndex],[EventX]
...
Event IDDescriptionGlobal
524CurrentValue > GlobalVariableValueNo
525CurrentValue < GlobalVariableValueNo
526CurrentValue = GlobalVariableValueNo
527CurrentValue >= GlobalVariableValueNo
528CurrentValue <= GlobalVariableValueNo
529CurrentValue & GlobalVariableValueNo
530CurrentValue > GlobalVariableValueYes
531CurrentValue < GlobalVariableValueYes
532CurrentValue = GlobalVariableValueYes
533CurrentValue >= GlobalVariableValueYes
534CurrentValue <= GlobalVariableValueYes
535CurrentValue & GlobalVariableValueYes

600 The shield of the attached object is broken

In mycampaign.map:

ini
[Events]
...
ID=EventCount,...,600,2,0,0,...
...

601-602 House owns/doesn't own Techno Type

  • 601: Springs when specified house owns at least 1 instance of set TechnoType.
  • 602: Springs when specified house doesn't own a single instance of set TechnoType.
    • Multiplayer houses (indices 4475 through 4482) are supported.

In mycampaign.map:

ini
[Events]
...
ID=EventCount,...,[EVENTID],2,[HouseIndex],[TechnoType],...
...

Note

These events, as opposed to events 81 & 82 from Ares, take house as a parameter instead of using the trigger owner.

604-605 Checking if a specific Techno enters in a cell

  • 604: Checks if the techno that entered in the cell has the same ID specified in the event.
  • 605: Checks if the techno that entered in the cell appears in the selected list in AITargetTypes.
  • HouseIndex can be customized to focus in a specified house.

In mycampaign.map:

[Events]
...
ID=EventCount,...,604,2,[HouseIndex],[TechnoType],...
ID=EventCount,...,605,2,[HouseIndex],[AITargetTypes index#],...
...
House IndexDescription
>= 0The index of the current House in the map
-1This value is ignored (any house is valid)
-2Pick the owner of the map trigger

606 AttachEffect is attaching to a Techno

  • Checks if an AttachEffectType is attaching to a techno. Doesn't work for attached effects that were attached prior to the trigger's enabling.
  • To be elaborate, the event will be triggered during these occasions:
    • Self-owned effects: initial granted (triggered after AttachEffect.InitialDelays amount of frames), recreation (triggered after AttachEffect.Delays or AttachEffect.RecreationDelays amount of frames).
    • Effects from other sources: granted, refreshing when trying to apply the same type of attached effect to the techno.

In mycampaign.map:

ini
[Events]
...
ID=EventCount,...,606,2,0,[AttachEffectType],...
...