Jump to content
Sign in to follow this  
satory

How to check if a unit has not reached a destination and is dead

Recommended Posts

Im looking at setting up a Convoy mission, basically the USMC team has to stop a convoy from reaching, for this example Gorka.

I've created a trigger around Gorka and called it trigger1, and set it to presence and the condition has been set to the name of the unit, for example Jim. I think im mission something here, rather than in the next bit.

I have create a second trigger and made it emcompass the entire route of the convoy, I have set the condition to:

!(triggger1) && !(alive Jim)

From my basic understanding since trigger1 hasn't activated and if Jim gets killed this should be set off but for some reason it is not doing that.

Where am I going wrong?

Share this post


Link to post
Share on other sites

Edit:

I see what you're trying to do (I read the topic heading!), try this:

- change the Precense type of the trigger to NOT PRESENT

- then have the following in the condition:

this&&!(alive Jim)

Edited by Rocket

Share this post


Link to post
Share on other sites
Edit:

I see what you're trying to do (I read the topic heading!), try this:

- change the Precense type of the trigger to NOT PRESENT

- then have the following in the condition:

this&&!(alive Jim)

Yeah thats what I had at first, though the problem is that if the player kills "Jim" when he's at his destination then the trigger is activated. Im hoping to make sure that even if they kill "Jim" when he's at his destination then its too late and they wont complete the objective?

Share this post


Link to post
Share on other sites

In that case, I'd go about it a different way. I'd add a Killed eventhandler to Jim, and have the trigger still, but just checking jim is Not Present.

On Jim add the following init:

this [url="http://community.bistudio.com/wiki/addEventHandler"]addEventHandler[/url] ["killed", "if (!(Jim in (list trigger1))) then {hint 'You've won!'} else {hint 'too late!'};"];

That make sense?

Edited by Rocket

Share this post


Link to post
Share on other sites

Yeah that makes sense, so if Jim is killed and not in the Trigger area then it would fire.

this addEventHandler ["killed", "if (!(Jim in (list trigger1))) then {"1" objStatus "DONE"} else {"1" objStatus "FAILED"};"];

I've added in the objective status like I would of had in the trigger and Im getting an error, it says its mission a "]" Any ideas?

Share this post


Link to post
Share on other sites

Try this:

this addEventHandler ["killed", "if (!(Jim in (list trigger1))) then {'1' objStatus 'DONE'} else {'1' objStatus 'FAILED'};"];

You had quote marks inside quote marks. In that case, you need to either double up the quote marks (ie. ""Hello"") or use apostrophies (ie. 'Hello').

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  

×