Jump to content
Sign in to follow this  
Havok69

Trigger question

Recommended Posts

Ok, I'm trying to make a mission where a vehicle is travelling down a road and when it gets to a certain point on the road (indicated by a trigger?), the enemy on the side of the road will fire when it gets to that trigger, not b4. And make it so when the ambush team sees the vehicle they wont get up and run some where. Help plz, sry if has been answered many times but its a pretty specific and hard to search for.

Share this post


Link to post
Share on other sites

try to put this in the leader's init at first: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">grp = group this; "_x setbehaviour STEALTH" foreach units grp; "_x setcombatmode WHITE" foreach units grp

Then, in the trigger, you put the following in the activation line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x setcombatmode RED" foreach units grp; "_x setbehaviour COMBAT" foreach units grp You may keep the "STEALTH" behaviour though, it's up to you. If you want the ambush party to lay down all the time, you might want to check a previous post. Good luck!  smile_o.gif

btw remember to check who the trigger is activated by  wink_o.gif . Just a tip cuz i forget to do it almost every time and then wonder why its not working  rofl.gif

Share this post


Link to post
Share on other sites

The post concerning units stand up/ lie down can be found here

Share this post


Link to post
Share on other sites

Let me correct Gaskin's lines a bit:

Put in the group leader's init:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ambushGrp = group this; {_x setbehaviour "STEALTH"; _x setcombatmode "WHITE"; _x doStop true} foreach units ambushGrp

the doStop so they don't get away.

Then you need a bigger trigger over the ambush area, making units aim at the vehicle. Press F2 and connect the trigger with the vehicle, then select "Activation by Vehicle", present.

In the onActivation line you type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x reveal myVehicle; _x doTarget myVehicle} forEach ambushGrp

Finally the small trigger that makes the units attack, which should be same as the last one, only smaller. In the onActivation line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x setCombatMode "RED"; _x setBehaviour "COMBAT"} forEach units ambushGrp

Share this post


Link to post
Share on other sites

Ok, what do I replace the "_x" with if anything?  Also it says something when I start the mission "unkown operator doStop true.  What do I change so the ambush side attacks a group not just a vehicle? Where do I place the triggers exactly? Do I place both trippers over the ambush grp?

Share this post


Link to post
Share on other sites

Yep, you place both triggers over the ambush troop, where the first should be bigger (so they can aim and get ready) while the second tells them to engage.

If you want to ambush a group you should change the bigger trigger onActivation line to:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{(leader ambushGrp) reveal _x} forEach enemyGrp

to reveal every enemy unit to the group leader (required that the group is called "enemyGrp").

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×