Since adding AI is always a problem for many TD mappers, but essential for a good singleplayer map, i thought we could collect here some useful Triggers & Teamtypes.
1. The moving and then deploying MCVIt was widely assumed that an MCV can't be deployed on a certain cell by using triggers.
This is how it works anyway.
CODE
[UNITS]
000=GoodGuy,MCV,256,1596,0,Rescue,MCVD
;note the Rescue action and the connection to the MCVD Trigger
[TeamTypes]
mcvt=GoodGuy,0,0,0,0,0,15,0,0,0,1,MCV:1,6,Move:5,Move:6,Move:7,Move:8,Move:9,Rescue:0,0,0
;The MCV moves along the waypoints 5,6,7,8,9 and then deploys at the last waypoint 9
[Triggers]
MCVD=Time,Create Team,0,GoodGuy,mcvt,0
Though i admit it has some drawbacks and special conditions
1. The MCV has to be placed on the map and can't be send via reinforcements.
2. The place where the MCV is placed on the map must be big enough for the MCV to deploy there too (you should test this first using no trigger)
3. The MCV needs Rescue (or Unload) as it's action
4. The TeamType needs Rescue (or Unload if Unload is on the MCV) as the last action on the waypoint list
5. The Trigger has to start instantly (hence Time 0) or the MCV deploys on it's start position
But you can add many waypoints to its path to give it a delay before it deploys on its final destination
The main advantage is, that you can this way make an AI player (in a singleplayer map) which has to build its base from scratch just like the human player in almost every other mission.
2. Attacking Orcasevery 150 timeunits, 3 Orcas will attack the players base
when the GDI Helipad is destroyed, the Orca attacks will stop
CODE
[STRUCTURES]
000=GoodGuy,HPAD,50,3824,0,delx
[TeamTypes]
orc1=GoodGuy,0,0,0,0,0,7,0,0,0,1,ORCA:3,1,Attack Base:99,0,0
[Triggers]
xxxx=Time,Reinforce.,150,GoodGuy,orc1,1
delx=Destroyed,Dstry Trig 'XXXX',0,GoodGuy,None,0
This will give GDI free Orca reinforcements, which are spawned at the map border and attack the players base
Unfortunately i haven't got it work that the AI builds them like any other TeamType.
3. Attacking A10sThis gives GDI every 200 timeunits an airstrike with 2 A10s (even if the human player is GDI)
CODE
[TeamTypes]
a10s=GoodGuy,0,0,0,0,0,7,0,0,0,1,A10:2,0,0,0
[Triggers]
airs=Time,Reinforce.,200,GoodGuy,a10s,1
3. GDI Airstrike SuperweaponThis gives GDI the Airstrike SW (unlike the version before, this one can be controlled via the sidemenu icon)
CODE
[Triggers]
airs=Time,Airstrike,0,GoodGuy,None,0
The same works also for Nod
CODE
[Triggers]
airs=Time,Airstrike,0,BadGuy,None,0
4. Starting a patrolThis starts a Hummvee patrol for GDI after 30 timeunits
CODE
[TeamTypes]
gdip1=GoodGuy,1,0,0,0,0,15,1,0,0,1,JEEP:1,8,Move:10,Guard:10,Move:11,Guard:10,Move:10,Guard:10,Move:8,Guard:10,1,0
[Triggers]
gptl1=Time,Create Team,30,GoodGuy,gdip1,0
The unit will patrol along the waypoints 10,11,10,8 and guard for 10 units on each waypoint. Then it starts again since the units loop by default the actions defined in the TeamType.
If the unit is destroyed it will be replaced by another one. (hence the second last 1)
5. Start GDIs productionThis starts the GDI production (GDI will start rebuilding Buildings which are in the [Base] section) when the Player enters a certain cell
CODE
[Triggers]
prod=Player Enters,Production,0,GoodGuy,None,0
[CellTriggers]
3752=prod
3816=prod
3880=prod
Note: this will only start the production of buildings and allows the production of units. But to make the AI build units you need an additional autocreate trigger.
That's why you can have an AI which builds buildings
and units, but not an AI which only builds units (except you don't give the AI a conyard)
CODE
[STRUCTURES]
012=Special,GTWR,256,1139,0,auto
013=Special,GTWR,256,1141,0,auto
[Triggers]
auto=Destroyed,Autocreate,0,GoodGuy,None,2
when one of the 2 guard towers is destroyed (hence 2 at the trigger which is an "Or" connection), GDI will start producing units.
6. ReinforcementsThis gives Nod a Hovercraft with 1 Commando as reinforcements after 10 timeunits
CODE
[TeamTypes]
new1=BadGuy,0,0,0,0,0,7,0,0,0,2,LST:1,RMBO:1,0,0,0
[Triggers]
rnf1=Time,Reinforce.,10,BadGuy,new1,0
Note: the Hovercraft always comes from the south and you have to place there where the Hovercraft should spawn, at least 3 cells water in a row 1 cell outside the visible map
I would suggest making around the whole map, 1 cell outside the visible area, a border with impassable rocks from the terrain set. (Don't use overlays, trees or anything else as these raise the ini file size and maps work only flawlessly when their size is under 16k)
This gives the human player Nod a controllable Transport Helicopter as reinforcements.
CODE
[BadGuy]
Edge=South
[TeamTypes]
heli=BadGuy,0,0,0,0,0,7,0,0,0,1,TRAN:1,1,Move:16,0,0
[Triggers]
rnf2=Time,Reinforce.,0,BadGuy,heli,0
Note: as soon as you put more units in the Team, the Helitrans will unload them at the waypoint and fly away
BadGuy on the Trigger is necessary and must match the house of the human player, or the reinforcements won't arrive.
The Reinforcements are spawned along the map border (here Edge=South) which is specified in the House section (here [BadGuy])
I hope this not only brings back some more life to TibWeb but also to TD mapping.
\EDIT
some more infos about map making and its restrictions
-the max file size of the ini is 16k (16384 Byte) for the DOS version (everything after the 16384th Byte will be ignored)
-the max number of entries for the Terran section is 300 (all trees/rocks after/including the 301st will be ignored)
-the max number of teamtypes is 40 (if you have 41 or more teamtypes the map will freeze the game when loading)
This post has been edited by Lin Kuei Ominae: Aug 11 2009, 08:47 PM