IPB

Welcome Guest ( Log In | Register )


> AI Trigger Collection, useful stuff for singleplayer maps
Lin Kuei Ominae
post Aug 2 2009, 10:42 PM
Post #1


Stealth Tank
Group Icon

Group: Members
Posts: 1,065
Joined: 14-November 06
From: Germany
Member No.: 281
Alliance: CABAL
Favorite game: Tiberian Sun



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 MCV
It 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. wink1.gif

2. Attacking Orcas
every 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 A10s
This 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 Superweapon
This 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 patrol
This 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 production
This 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. Reinforcements
This 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


--------------------
Co-Leader of Twisted Insurrection
my public units for you
Nod units:____________________________GDI units:
Nod Scorpion__________________________GDI 3A Kodiak
Nod Tachyon Tank______________________GDI Medusa (Triple Cannon Mech)
Nod Goliath___________________________GDI Behemoth (medium size Mech)
Nod Cobra (fast medium mech)__________GDI Battleship Aurora
Nod Siegebot (light MG-Mech)__________GDI Fortress Tower (Heavy Base Defense)
Nod Redeemer (4 legged heavy Cyborg)__GDI Triton (Titan support Mech)
Nod/Scrin WotW Tripod_________________GDI Exciter
______________________________________GDI Ion Charge Collector
Misc and Fun units:
X-Mech Calendar 28 SHP Units
Star Wars Mechs ATAT/ATST
Cyborg Barrack on PPM_________________Mech Factory
Mutant Tiberium Flyer
yt1300 (Millenium Falcon + BIG version)

if you use my units in your mod, please credit me.if you want to use my units on your website please ask me before.
Go to the top of the page
 
: | +Quote Post
 
Start new topic
Replies
Nyerguds
post Aug 4 2009, 10:10 AM
Post #2


Cyborg
Group Icon

Group: Members
Posts: 370
Joined: 22-October 06
From: Flanders (Belgium)
Member No.: 97
Alliance: Nod
Favorite game: Tiberian Dawn



1: Neat trick! I'm surprised that a unit with an Unload/Rescue command can be recruited into a team and made to stop its original action. Normally that shouldn't work.
Does Rescue also deploy the MCV from the start, if you don't add any other trigger stuff?

2: Hm, right. Nothing new there tongue.gif
On a related note, 1.06c will have up to 6 destroyable triggers, and probably a few more to enable/disable the automatic area guard of helicopters.

3a: Well, that's just how all AI Airstrikes are done in the campaign...

3b: I've actually succeeded in giving the rechargeable Airstrike superweapon to the AI. All you need to do for that is make the AI player trigger a celltrigger linked to the airstrike superweapon, and they will get it (if they are set as trigger owner). This way the AI targets its airstrikes more intelligently. The drawbacks is that you can't have a trigger to stop the airstrikes, and that the AI never targets units with its superweapons.

4: A common misconception with this is the Loop:## command, which does NOT cause the patrol to loop (it does that automatically), but instead takes off the first ## commands. It can be used to move a team to a certain location through some waypoints, and then make them patrol there without going through those first waypoints again.

5: This is actually almost completely wrong. Production isn't just rebuilding of buildings. Before Production is activated the AI players will also not build any units. Also, Production has no owner. It applies to ALL AIs. As I said in some other threads already, the house indication in a trigger is a restriction in who can ACTIVATE the trigger, and rarely relates to the effect. The Airstrike thing I mentioned above is the only exception I've noticed so far.

6: hovercrafts: pretty correct, though as far as I know the only thing that matters is the obstacles on the water ON the map and ONE CELL just outside the map border. Anything further outside the map is ignored by reinforcements, as this mission shows (all non-water outside the border is normal clear terrain).

Helis: Yeah, standard stuff. This is also used to place (capturable) enemy transport helicopters on a map 'from the beginning', since it's not possible to actually place air units on a map. (I once activated that in the exe and tried it, but it acted weird)
On a kinda related note, I've once seen an odd teamtype situation where a transport helicopter unloaded 8 APCs and didn't fly away. This is probably caused by the fact the Unload command is accepted by the APCs too.
Chinooks shouldn't be used for ridiculous things like that anyway though, imo tongue.gif

QUOTE (Lin Kuei Ominae @ Aug 3 2009, 12:42 AM) *
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])

The "Time" trigger has always been a bit dodgy when it comes to ownership. But it's perfectly possible to make the AI drop off heli reinforcements after the human player triggers a celltrigger. And pretty much everything outside Time triggers needs the "team that can activate it" as trigger owner. Same thing for heli reinforcements after you destroy certain buildings or units. The player WHO DESTROYS has to be the trigger 'owner', and it has no effect on the reinforcement. It will come.
"Trigger owner" is actually a very bad way of calling it. It's actually the "trigger activator".

I'm pretty sure this also works for AI players... like giving the player a new MCV after the AI destroyed the (pre-placed) one in the player's base.

This post has been edited by Nyerguds: Apr 26 2015, 06:02 PM


--------------------
Go to the top of the page
 
: | +Quote Post
Lin Kuei Ominae
post Aug 4 2009, 11:40 AM
Post #3


Stealth Tank
Group Icon

Group: Members
Posts: 1,065
Joined: 14-November 06
From: Germany
Member No.: 281
Alliance: CABAL
Favorite game: Tiberian Sun



QUOTE (Nyerguds @ Aug 4 2009, 11:10 AM) *
1: Neat trick! I'm surprised that a unit with an Unload/Rescue command can be recruited into a team and made to stop its original action. Normally that ahouldn't work.
Does Rescue also deploy the MCV from the start, if you don't add any other trigger stuff?

yep, both Rescue and Deploy assigned as the action to an MCV will make it deploy.

QUOTE (Nyerguds @ Aug 4 2009, 11:10 AM) *
Production isn't just rebuilding of buildings. Before Production is activated the AI players will also not build any units.

i haven't said anything else. But I'll update the topic with the info that an additional autocreate trigger is necessary for the AI to build units too.
So you can have an AI which rebuilds Buildings and no units, but
you can't have an AI which builds units only, as the autocreate trigger needs a working production.
QUOTE (Nyerguds @ Aug 4 2009, 11:10 AM) *
5: This is actually almost completely wrong. Production isn't just rebuilding of buildings. Before Production is activated the AI players will also not build any units. Also, Production has no owner. It applies to ALL AIs. As I said in some other threads already, the house indication in a trigger is a restriction in who can ACTIVATE the trigger, and rarely relates to the effect. The Airstrike thing I mentioned above is the only exception I've noticed so far.

If you have 2 AI players, you can let only one start the production using the House on that trigger. That's why it is necessary to identify which one of the AI players should start the production.
The House in the trigger also must match the reinforcements house or they won't appear.
The House in the trigger must match the team that is created by "Create Team". (e.g. 4. gptl1=Time,Create Team,30,GoodGuy,gdip1,0 )
You see there are more situations where the trigger specifies the house to which it belongs and not who can activate it.


QUOTE (Nyerguds @ Aug 4 2009, 11:10 AM) *
6: hovercrafts: pretty correct, though as far as I know the only thing that matters is the obstacles on the water ON the map and ONE CELL just outside the map border. Anything further outside the map is ignored by reinforcements, as this mission shows (all non-water outside the border is normal clear terrain).

yep, with one cell outside i meant the one cell border just outside the visible map.
e.g.
white marks the border which isn't visible and just one cell outside the visible map
Attached Image
the upper one works and the hovercraft will always come from the centre cell of the 3 water cells in the border.
the lower one doesn't works as the water stripe is not big enough (only one water cell isn't enough) and also the path to the beach is not free.

QUOTE (Nyerguds @ Aug 4 2009, 11:10 AM) *
Helis: Yeah, standard stuff.

do you know if it's possible to use the Nod Cargo Plane as a transport for reinforcements? I tried this by simply replacing TRAN with C17 in the team but nothing happened.


QUOTE (Nyerguds @ Aug 4 2009, 11:10 AM) *
The "Time" trigger has always been a bit dodgy when it comes to ownership. But it's perfectly possible to make the AI drop off heli reinforcements after the human player triggers a celltrigger.

This is because "Player Enters" is always the human player, that's why the House in the trigger can be assigned to the AI player.
e.g.
CODE
rnf2=Player Enters,Reinforce.,0,GoodGuy,heli,0
while the human player is BadGuy

also for destroyed objects this works, because you assign the trigger to the objects on the map, so the House on the trigger is again unbound to the event of the trigger and can be this way assigned to the house which should do the action (e.g create a team or give reinforcements).

That's why i wouldn't call it "trigger owner" nor "trigger activator" but "action owner", as it depends on the action you plan to do with the trigger.
CODE
name=Event, Action, Value, ActionOwner, TeamType, loop
Event: the event that causes the trigger to start (depends on the certain event which owner starts this)
Action: the action that should be done when this trigger is released
ActionOwner: the owner to which the action belongs (must match the owner of the TeamType)
TeamType: the team that is assigned to the trigger
Loop: 1-And
         2-Or
         0-No loop


This post has been edited by Lin Kuei Ominae: Aug 4 2009, 12:04 PM


--------------------
Co-Leader of Twisted Insurrection
my public units for you
Nod units:____________________________GDI units:
Nod Scorpion__________________________GDI 3A Kodiak
Nod Tachyon Tank______________________GDI Medusa (Triple Cannon Mech)
Nod Goliath___________________________GDI Behemoth (medium size Mech)
Nod Cobra (fast medium mech)__________GDI Battleship Aurora
Nod Siegebot (light MG-Mech)__________GDI Fortress Tower (Heavy Base Defense)
Nod Redeemer (4 legged heavy Cyborg)__GDI Triton (Titan support Mech)
Nod/Scrin WotW Tripod_________________GDI Exciter
______________________________________GDI Ion Charge Collector
Misc and Fun units:
X-Mech Calendar 28 SHP Units
Star Wars Mechs ATAT/ATST
Cyborg Barrack on PPM_________________Mech Factory
Mutant Tiberium Flyer
yt1300 (Millenium Falcon + BIG version)

if you use my units in your mod, please credit me.if you want to use my units on your website please ask me before.
Go to the top of the page
 
: | +Quote Post
Nyerguds
post Aug 4 2009, 11:59 AM
Post #4


Cyborg
Group Icon

Group: Members
Posts: 370
Joined: 22-October 06
From: Flanders (Belgium)
Member No.: 97
Alliance: Nod
Favorite game: Tiberian Dawn



QUOTE (Lin Kuei Ominae @ Aug 4 2009, 01:40 PM) *
If you have 2 AI players, you can let only one start the production using the House on that trigger. That's why it is necessary to identify which one of the AI players should start the production.

Actually, I've seen missions where multi-houses were added to the map, and after one Production trigger was activated, all AI players competed over the buildings put in the [Base] section (after all, they have no owners set). One trigger enabled AI production for all AI houses.

Besides, I've seen triggers in the original missions where AI production was started by a trigger activated by the player, like crossing certain celltriggers:

http://nyerguds.arsaneus-design.com/cncstu...nod/scb08ea.png
http://nyerguds.arsaneus-design.com/cncstu...aps/scb08ea.ini

[Triggers]
prod=Player Enters,Production,0,BadGuy,None,0

Player is Badguy.

QUOTE (Lin Kuei Ominae @ Aug 4 2009, 01:40 PM) *
yep, with one cell outside i meant the one cell border just outside the visible map.
e.g.
white marks the border which isn't visible and just one cell outside the visible map
Attached Image
the upper one works and the hovercraft will always come from the centre cell of the 3 water cells in the border.
the lower one doesn't works as the water stripe is not big enough (only one water cell isn't enough) and also the path to the beach is not free.

Ahh, in X direction. right, sorry, I misunderstood that.
Since you combined 2 conditions that block it in that second image, that doesn't prove much about the actual size of the opening though tongue.gif
I never tested this myself though, so I'll believe you wink1.gif

QUOTE (Lin Kuei Ominae @ Aug 4 2009, 01:40 PM) *
do you know if it's possible to use the Nod Cargo Plane as a transport for reinforcements? I tried this by simply replacing TRAN with C17 in the team but nothing happened.

No, the Nod cargo plane has the same "Is Aircraft" option set that the A-10 has. It makes sure they can't turn on the spot in the air (they have to kleep flying forward while they turn), and it prevents them from landing. If you disable that option, and you build something with the airstrip, the C-17 unloads like a reinforced chinook, at (I think) the default helicopter reinforcements dropoff waypoint (#27)


QUOTE (Lin Kuei Ominae @ Aug 4 2009, 01:40 PM) *
This is because "Player Enters" is always the human player, that's why the House in the trigger can be assigned to the AI player.
e.g.
CODE
rnf2=Player Enters,Reinforce.,0,GoodGuy,heli,0
while the human player is BadGuy

No it's not. As I just said, I made an AI house activate the trigger. If you set a celltrigger somewhere and make the "owner" of the actual trigger the AI's house, then the human player can't activate it. I tested this with Flare triggers.

This post has been edited by Nyerguds: Dec 6 2011, 11:29 AM


--------------------
Go to the top of the page
 
: | +Quote Post

Posts in this topic
- Lin Kuei Ominae   AI Trigger Collection   Aug 2 2009, 10:42 PM
|- - Lin Kuei Ominae   QUOTE (Nyerguds @ Aug 4 2009, 11:59 AM) N...   Aug 4 2009, 04:31 PM
- - Nyerguds   Ooh, that's pretty brilliant [edit] I just ...   Aug 4 2009, 04:38 PM
|- - Lin Kuei Ominae   That is strange because you, the player enter the ...   Aug 4 2009, 05:39 PM
- - Nyerguds   The second row of celltriggers is for when GDI sta...   Aug 4 2009, 08:29 PM
|- - Lin Kuei Ominae   QUOTE (Nyerguds @ Aug 4 2009, 09:29 PM) Y...   Aug 4 2009, 09:29 PM
- - Nyerguds   Magnificent work I wish I had time to experiment...   Aug 4 2009, 10:35 PM
|- - Lin Kuei Ominae   i just found something interesting new. you sure ...   Aug 26 2009, 10:27 PM
- - Nyerguds   That is some great information! I've been ...   Aug 26 2009, 11:20 PM
|- - Lin Kuei Ominae   with this 3rd value i just noticed some kind of pa...   Aug 27 2009, 09:52 AM
|- - Nyerguds   QUOTE (Lin Kuei Ominae @ Aug 27 2009, 11...   Oct 5 2009, 07:48 AM
- - Nyerguds   Interesting stuff, Lin Kuei   Aug 28 2009, 05:40 PM
|- - Lin Kuei Ominae   i took a look in the game.dat (DOS TD) to see if t...   Aug 30 2009, 09:54 PM
- - Nyerguds   I once enabled the Aircraft section in C&C95, ...   Aug 30 2009, 10:32 PM
|- - Lin Kuei Ominae   too bad. I thought already i could make a map with...   Aug 30 2009, 11:10 PM
- - Operon   Here's something fun that could be useful for ...   Feb 9 2010, 12:45 AM
- - Nyerguds   Ehh, "loop" PREVENTS looping. It doesn...   Feb 11 2010, 07:11 PM
|- - Operon   QUOTE (Nyerguds @ Feb 11 2010, 11:11 AM) ...   Feb 14 2010, 03:26 PM
- - Nyerguds   Must be because of the gunboat exceptions... I gue...   Feb 15 2010, 11:05 AM
|- - Operon   QUOTE (Nyerguds @ Feb 15 2010, 03:05 AM) ...   Feb 18 2010, 09:09 AM
- - Crimsonum   Didn't even know this topic exists Should pro...   Feb 18 2010, 12:17 PM
- - Nyerguds   Nice to see you refined the method   Feb 21 2010, 04:53 PM
- - Nyerguds   LKO, I just noticed something odd... "Rescue...   Aug 4 2010, 08:57 PM
|- - Lin Kuei Ominae   That's strange. Though since it still works an...   Aug 4 2010, 09:32 PM
- - Nyerguds   Yeah, there's 2 completely separate lists; one...   Aug 5 2010, 06:53 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th June 2025 - 02:26 AM


XGhozt.com