Jump to content

Trigger question


Recommended Posts

Okay let's say I want to have the AI defender launch a counter attack when the human player moves to a certain spot. I know how to do this but what happens if I insert another order after the trigger and the counter attack? Will this order be ignored and the defending units stay put if the trigger is not activated? In other words, can I use more than one order to develop a counter attack?

Link to comment
Share on other sites

I am not totally getting the question. Orders are executed in order so if you have a unit that waits for a trigger and then executes the counter attack then adding more orders after that will give them something to do if the trigger is hit and after their counter attack orders are completed.

The wait for trigger statement is not a "if then else" it is a "wait until" statement. What they wait on is either the trigger event to happen to the time to run out.

Link to comment
Share on other sites

Yeah, Triggers are not "if-then", it's "wait here until this condition is met, then continue with your orders".

In that sense they're fundamentally similar to the inbuilt "leave after" orders, but rather than being based on the clock, they're based on units in a location.

You can be a little clever about it - if the assembly/waiting point is covering one flank, and you're happy for them to hang around there for the duration, then a trigger on the other flank becomes a "if they come this way, hold fast, if they go that way, go over there", but that's very map dependent.

Conditions would improve the potential for scripting significantly, but the tools that exist are still pretty powerful.

Link to comment
Share on other sites

 

Quote

In that sense they're fundamentally similar to the inbuilt "leave after" orders, but rather than being based on the clock, they're based on units in a location.

Okay thanks. I more or less understood how it worked before but the way you put it, comparing it to leave after order,  makes perfect sense.

Quote

You can be a little clever about it - if the assembly/waiting point is covering one flank, and you're happy for them to hang around there for the duration, then a trigger on the other flank becomes a "if they come this way, hold fast, if they go that way, go over there"

Yeah that's what I did actually in my test. This way they only counter attack if the attack is on the opposite corner of the map.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...