Jump to content
Sign in to follow this  
anthonyfromtheuk

Stop AI moving to first waypoint until it is triggered.

Recommended Posts

I have an AI set in position and a trigger set off when his team mates are killed.

When this happens I want him to leave his current position and go investigate.

My problem is that he goes straight to the waypoint even if its not triggered, trigger is synced to first waypoint and I have tried just syncing it to the AI.

Have no problem activating waypoints with triggers if its not the very first waypoint but I have positioned the AI in his INIT so do not want him to move to a waypoint before he goes to his search waypoint.

(unless there is a way to make waypoints as accurate as setpos)

I don't understand, The AI should not move until the trigger is triggered no?

currently I am using disablemove to keep them is position until the trigger is triggered but what am I doing wrong there.

How do you sync the first waypoint of an AI to a trigger?

Share this post


Link to post
Share on other sites

try to make a HOLD waypoint and then the final waypoint . sync your trigger on HOLD waypoint. i think this way work

Share this post


Link to post
Share on other sites
try to make a HOLD waypoint and then the final waypoint . sync your trigger on HOLD waypoint. i think this way work

Thanks for your reply but thats not what I want to do as I stated I have set the AI in position using SetPos and if I set a new waypoint it will disregard my SetPos in the units INIT.

I guess using the DisableMove and EnableMove will do it works perfectly just didn't understand why I have to use that.

Share this post


Link to post
Share on other sites

you mean

disableAI "MOVE"
command

---------- Post added at 20:28 ---------- Previous post was at 20:20 ----------

You have to put in the init of the unit this

unitname disableAI "MOVE";
and in your trigger act
unitname enableAI "MOVE";

Share this post


Link to post
Share on other sites

Yes I had it was working at the first post as i said, just wondered why nevermind.

Thanks anyway

---------- Post added at 18:48 ---------- Previous post was at 18:47 ----------

doStop unit

Will remember that for next time thanks.

Share this post


Link to post
Share on other sites

Just put a first WP at the place where the unit is (select the unit leader then create a WP on it directly), then sync the WP with the trigger.

Share this post


Link to post
Share on other sites
Just put a first WP at the place where the unit is (select the unit leader then create a WP on it directly), then sync the WP with the trigger.
Unit is set by setPos in its INIT and that way would ruin the setPos but dostop works perfectly also disableAI "MOVE"; Don't think I worded my first post very well, I was wondering if I was doing something wrong. I had disablemove (or disableAI "MOVE" sorry) working perfectly, just was concerned that the AI wouldn't respond to anything else but doStop is fine because they still respond to seeing an enemy.

Share this post


Link to post
Share on other sites

So you want an AI hold position till some other AI are dead?

Do:

In your "NOT PRESENT" (the AI that needs to be dead) trigger make a Global variable that gets set to TRUE when the AI are not present/killed. Place it in the OnAct of the trigger.

MoveNow = true;

Give the other AI (that you want to hold) two MOVE waypoints. One where he is currently waiting to move.... and one at the point he needs to move to.

In the first waypoint (onAct)add "&& MoveNow" to the Condition.... so we have...

true && MoveNow;

Until MoveNow is true.... the AI cannot advance to the next waypoint.

Share this post


Link to post
Share on other sites

Name your teammates (for example, unit1, unit2, unit3 etc.) Make a trigger, and in its condition, write this down.

!alive unit1 AND !alive unit2 AND !alive unit3 etc...

Sync this trigger to the first waypoint. When those teammates die, the second waypoint becomes active for him to move to :)

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  

×