Jump to content
Sign in to follow this  
Starlight

End Mission trigger help required

Recommended Posts

I have a mission where there are 4 targets that have to be destroyed.

I have the following script in a Trigger Switch which gives a screen hint when each target is destroyed.

condition: not alive Tungst1

On Act: nul = [objNull, ObjNull, Task2a, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

condition: not alive Tungst2

On Act: nul = [objNull, ObjNull, Task2b, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

etc....

linked back to my briefing document.

This all works, except the little task buttons do not change to green when completed :confused: any help / tips there would be good :)

My main issue is:

I want the mission to end successfully when any member of OPFOR gets back to a trigger zone marked for safe extraction and all of the 4 targets have been destroyed.

I do not know how to make the End trigger conditional on the Presence of OPFOR people and conditional on all 4 tasks being completed - not alive Tungst1 etc....

I tried just putting in not alive Tungst1; not alive Tungst2; but that does not work.

Any help appreciated.

It would be even better if this could be called in by Radio, but maybe that's for another time :D

Share this post


Link to post
Share on other sites

The problem is that those taskHint-calls only gives a certain hint pop-up. It doesn't actually change the state of the task to completed. To do that you need to do the following:

Task2a setTaskState "SUCCEEDED";

So the On Act should look like:

On Act: Task2a setTaskState "SUCCEEDED"; nul = [objNull, ObjNull, Task2a, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sq f";

The end trigger can be set to OPFOR PRESENT, trigger repeatable, END #1, Countdown to 5 seconds in min, mid and max, and the condition set to:

this && !alive Tungust1 && !alive Tungst2 && !alive Tungst3 && !alive Tungst4

This should make the trigger only turn TRUE (and thus end the mission) if OPFOR enters the trigger area, and all targets are destroyed (the '&&' is the same as 'AND', which means all the above paremeters need to be fulfilled)

Edited by Inkompetent

Share this post


Link to post
Share on other sites

Thanks for that quick reply.

Put it in and will test as soon as I can.

Thanks now I have a better understanding of the scripting

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  

×