Jump to content
Sign in to follow this  
lockjaw-65-

Create Trigger mid-mission

Recommended Posts

I have a specific problem with my mission that im working on. I have coloured markers on the map which indicate if enemy is present within that area. these are controlled by a trigger the same size and when enemy present they turn red, when not present they turn blue. The problem that I have is I only want them at certain times during the mission. I can make the markers invisible from start but the triggers have to be on the map and I also have to have an enemy unit there from the start to keep it red and not show the text that goes with it.

Is there an easy way to make the markers not present until needed?

Share this post


Link to post
Share on other sites

Thanks for reply. I use setMarkerAlpha for the markers but my triggers also have this in on activation

Obj1 setTaskState "CREATED"; hint "Enemy Detected in Gvozdno"

and this on deactivation:

Obj1 setTaskState "SUCCEEDED"; hint "Gvozdno Clear";

As you can see when the triggers are active they will remain so for rest of game.

Just realised that they are the wrong way round but seems to give same results

Edited by LockJaw-65-
more info

Share this post


Link to post
Share on other sites

Here's a demo mission using just triggers to handle all of this.

Zone1 and Zone2. Triggers and markers are placed on the map. Markers are hidden at start. Use the Radio to turn on or off the markers. Zone1 and Zone2 tasks are created at start via gamelogic. When OPFOR enters one of the zones it turns red and updates the description of the proper task and gives a task hint. When OPFOR is no longer in the zone it turns blue and updates the task description and state.

Share this post


Link to post
Share on other sites

Very useful info Kylania

I have created this but comes up with errors?

_trg=createTrigger["EmptyDetector",getmarkerpos "Obj1"];

_trg setTriggerArea[500,500,0,false];_trg setTriggerActivation["EAST","NOT PRESENT",true];_trg setTriggerStatements["this", "Obj1 setTaskState "SUCCEEDED", "hint 'Gvozdno Clear'", "Obj1 setTaskState "CREATED", "hint 'Enemy Detected in Gvozdno'"];

Edited by LockJaw-65-

Share this post


Link to post
Share on other sites

You have too many commas and not enough semi-colons. :)

_trg=createTrigger["EmptyDetector",getPos player];
_trg setTriggerArea[500,500,0,false];
_trg setTriggerActivation["EAST","NOT PRESENT",true];
_trg setTriggerStatements["this", "Obj1 setTaskState 'SUCCEEDED';hint 'Gvozdno Clear'","Obj1 setTaskState 'CREATED';hint 'Enemy Detected in Gvozdno'"]; 

Share this post


Link to post
Share on other sites

Ah thanks for that will try that now, to get marker position Obj1 instead of player would I just put

_trg=createTrigger["EmptyDetector",getmarkerpos Obj1];

Edited by LockJaw-65-

Share this post


Link to post
Share on other sites

_trg = createTrigger ["EmptyDetector", getMarkerPos "Obj1"]; 

Remember marker names are strings.

Share this post


Link to post
Share on other sites

Hi thanks for your help with this one, just need to know how you make the spawned trigger into a repeating trigger. I have been trying for ages

Cheers

Share this post


Link to post
Share on other sites

Many thanks that was very useful.

One other thing on this subject is how do you include executing an other script i.e null = execVM "supportmission1.sqf";.

I have tried many ways to do this but always comes up with errors?

Share this post


Link to post
Share on other sites

A simpler way would be to add a boolean (true/false) condition to the trigger that's activated when you need it.

Share this post


Link to post
Share on other sites

Hi. Im not sure how to put that in. I know I have been around these forums for a long time but I still fumble my way around and dont really know what im doing with scripts.

I cut and paste most of it and hope for best LOL. For example I have been working on this mission for over 2 years on and off :-)

---------- Post added at 08:51 ---------- Previous post was at 08:31 ----------

Thought I would post what I have for this trigger.

_trg = createTrigger ["EmptyDetector", getMarkerPos "mrk_zone1"];
_trg setTriggerArea[400,400,0,false];
_trg setTriggerActivation["EAST","NOT PRESENT",false];
_trg setTriggerStatements["this", "execVM "random1.sqf"];

I want it to start the random1 script when all east are dead, this then selects another mission.

Share this post


Link to post
Share on other sites

I have managed to work this out. I placed a trigger on the map and in its condition i put missiondone and in the activation i put

missiondone=false; nul = [] execvm "random1.sqf";

then the code for the trigger is:

_trg2 = createTrigger ["EmptyDetector", getMarkerPos "mrk_zone1"];
_trg2 setTriggerArea [400,400,0,false];
_trg2 setTriggerActivation ["EAST", "NOT PRESENT", false];
_trg2 setTriggerStatements ["this", "missiondone=true", ""];

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  

×