The event header creates a new event. Events contain the commands that interfere with the game-execution.
print ( "target", "text" );
Print a line of text to the console. This text also appears in the upper left corner of the screen, similar to chat-messages. The quotation-marks are necessary, so please include them always.
target - the name of target that shall read the text, written in the
macro-language
text - the message that shall appear
If the player is in the tactical-mode or in the strategy-mode, the messages won't be displayed on the screen, only on the console, so avoid writing mission-critical informations by this method!
HUD ( "target", x, y, "text" );
Display positioned text on the target's HUD. This avoids that an important information drops by the eyes of the player.
target - the name of target that shall read the text, written in the
macro-language
x, y - coordinates, where the text is placed on the HUD, the upper left corner of the HUD is (0|0), the lower right corner is (640|480)
text - the message that shall appear
You may format the text with the color-signs (e.g.
^1) and line breaks (
\n).
set_field ( "target", "name", "value" );
Fields are your run-time variables to save different things like status, targetnames, ... . Use this function to assign your fields values.
target - the name of target where the field is saved, written in the
macro-language
name - the name of the field, for global fields you have the freedom of choice; entity-bound fields (saved directly at a unit/object) are restricted to these special fields:
classname
origin
model
model2
spawnflags
speed
target
targetname
message
team
wait
random
count
health
light
dmg
angles
angle
targetShaderName
targetShaderNewName
value - the value you want to assign, you may save everything you can write in normal ASCII
The maximum number of global fields allowed is 64.
remove_field ( "target", "name" );
Since the number of fields is limited, you should remove fields you don't need any longer. Removing a field will also make a 'field'-function in a trigger return false.
target - the name of target where the field is saved, written in the
macro-language
name - the name of the field, the same name rules as for the 'set_field'-function are applied
end_game ( "target", "status" );
This will end the game for a certain team.
target - the name of the team, the name is specified in the
.ini-file
status - there are two options:
win
loose
The game will last until all teams have got the signal to end. Players whose team has ended the game will spectate until the others are done as well. This allows you to create objectives for different teams that aren't opposite to each other. Both teams could win or loose.
control_level ( "target", level );
Changes the level of interaction the players of a team have. This way you can create intro-sequences and cut-scenes.
target - the name of the team, the name is specified in the
.ini-file
level - the control-level the players of the team get:
0 - none, auto-set value at the start of the game, avoid to set this again
1 - waiting, no interaction to the game (watch cutscene)
2 - playing, full degree of interaction
3 - won, can still play
4 - lost, can still play
start_timer ( "target", secs );
Start a mission timer for a certain team.
target - the name of target at which the timer shall be assigned to (teams only), written in the
macro-language
secs - time at which the timer will start to count down in seconds, if you use '-1', a previously stopped timer will start at the time where it was stopped
end_timer ( "target");
Stop a mission timer for a certain team.
target - the name of target at which the timer is assigned to (teams only), written in the
macro-language
A stopped timer can be continued with
start_timer (<target>, -1);.
build ( "class", (x y z), (pitch yaw roll), "team", flags );
Request a build-call for a team. The request will be treated like one that has been issued by a player during the game. This means you can only build what you are allowed to and if you have the money for it. This function will be very useful to give an AI-controlled team build-abilites.
class - the classname of the unit/building/equipment you want to build. Corresponding to the current list of
Units and Buildings are this namely:
BeamPortal
MgunTurret
Soldier
RocketInfantry
Grenadier
RailInfantry
PlasmaGunner
ammo_bullets
ammo_rockets
ammo_grenades
ammo_slugs
ammo_cells
item_armor_shard
item_health_small
x y z - where the object should be placed, applies only to buildings
pitch yaw roll - how the object should be placed, applies only to buildings
team - the name of the team, the name is specified in the
.ini-file
flags - special flags to change or determine the way the object is built, add the numbers of the properties you want to apply together, here is the list:
4 - create for free
8 - create scripted, executes only, if there is no human playing in the team
The things built due to the call of this functions will appear directly where they are built. This means, if you build a unit it will appear at the building where units come out (e.g. teleporter). Buildings are placed by the coordinates in the function-call.
create ( "class", (x y z), (pitch yaw roll), "team", flags, "name" );
In effect, 'create' does the same as 'build', the simple difference is that you are getting the request immediately without cost and no matter if you could build it. This makes this function suitable for pre-mission setups, place enemy units over the map, give the player a pre-built base and so on.
Request a build-call for a team. The request will be treated like one that has been issued by a player during the game. This means you can only build what you are allowed to and if you have the money for it. This function will be very useful to give an AI-controlled team build-abilites.
class - the classname of the unit/building/equipment you want to build. The
Units and Buildings you can create are the same as defined in the build-function (see above).
x y z - where the object should be placed, applies only to buildings
pitch yaw roll - how the object should be placed, applies only to buildings
team - the name of the team, the name is specified in the
.ini-file
flags - special flags to change or determine the way the object is built, the flags are also the same as for the 'build'-function, although 4 (create for free) is useless here, special flags only working with 'create':
32 - place units/items directly at the x y z-coordinates, turn them to the pitch yaw roll-angles
name - if you want to give the object after it's placement a name, so you could create a mission-critical building that needs to be destroyed
group ( "target", "team", "group", radius, flags );
Group units with this function. A group will be easier to command, than several single units.
target - the name of the object you want to add, written in the
macro-language
team - the name of the team where the target belongs to, the name is specified in the
.ini-file
group - the name of the group, you're free to choose, you may add a unit to an existing group by using the group's name again
radius - currently not used properly, set to zero
flags - currently not used properly, set to zero
A unit that is in a group can't be added to another group.
un_group ( "group" );
Ungroup, all units are free again. Use this if you need the units of this group in another group.
target - the name of the group you want to ungroup
order ("unit", number, radius, "trgt", (x1 y1 z1), (x2 y2 z2), flags);
Give a command to a unit or a group. This is the only way for an AI-controlled team to get the initiative and attack the enemy. Orders are only executed of there is no human client on the team.
unit - the unit(s) that you want to order, written in the
macro-language
number - the order itself, identified by a number, each order requires different parameters that are explained here as well:
11 - attack, the unit will seek a moving enemy and kill him, parameters:
12 - move, the unit will move to that position and guard the area around it, parameters:
x1 y1 z1 - destination to move to
13 - destroy, the unit will advance to the standing object (building) and destroy it, parameters:
radius - meaning and usage differs, see the orders
x1 y1 z1 - meaning and usage differs, see the orders
x2 y2 z2 - meaning and usage differs, see the orders
flags - influence the way the order is executed, add the numbers of the properties you want to apply together, here is the list:
65536 - execute the order also if there is a human playing in the team
'attack' and 'destroy' are pretty similar in their effect, but the AI works differently in the chasing and destroying of the target.
jump ( "target", "jump_target", (x y z), (pitch yaw roll), flags );
Re-position a client in tactical mode or sattelite-mode to a special position and in certain angles. The main use will be the cutscene arrangement.
target - the name of the client you want to reposition, written in the
macro-language
jump_target - name of a special target to teleport to
x y z - coordinates to teleport to, if there is no 'jump_target' specified
pitch yaw roll - angles the teleported object should have after the jump
flags - influence the way the jump is executed, add the numbers of the properties you want to apply together, here is the list:
1 - allows the positioning of any object no matter which state it is in
follow_path ( "target", "path" );
Make a client follow a path. The main use will be the cutscene arrangement. The client will follow the path 'till it's end and wait there until he gets new orders. If the path is a looping path, the client will move go from the last waypoint to the first point of the path and continue his movement until he gets new orders.
target - the name of the client you want to move, written in the
macro-language
path - name of the path you defined, plus the number of the waypoint where the movement shall start (e.g.
flightpath2 - will start the movement on flightpath at the second waypoint), the path has to be specified before the event else it won't be recognized
The path-movement will only work properly if the player has been set to 'wait' with the 'control_level'-command.
The number of events you may use in a script has been limited to 128.