Jump to content
Sign in to follow this  
failtolawl

Linking triggers?

Recommended Posts

So I am making a mission where your side has to seize all 5 sections of a city, whereas the mission is won when all sectors are seized.

Right now I have the triggers in each area set up so that when seized, the area turns blue, as well as when lost, the area turns back to red, but no win trigger is set up yet.

So how do I go about doing this,

should I have 5 objectives, linking them to a win script?

or can I possibly link all of the seize triggers to one, only having one objective?

Thanks in advance!

Share this post


Link to post
Share on other sites
triggerActivated or have the triggers switch variables to true or something and have the ending trigger looking for those variables to be true. Several examples of this have been posted recently.

Share this post


Link to post
Share on other sites

I'd just have five global variables (assuming you create mission in editor and not by scripts). drn_area1, drn_area2, drn_area3, drn_area4 and drn_area5. On activate in each I'd put "drn_areaX = true;" and on deactivate "drn_areaX = false;". Then I'd add a the end trigger with activation "drn_area1 && drn_area2 && drn_area3 && drn_area4 && drn_area5".

Note: "drn" is my initials, so the variables will not conflict with eventual other scripts used.

Share this post


Link to post
Share on other sites

Remember you'll want to set all of those to false in your init.sqf so that the triggers know what to look for.

init.sqf:

drm_area1 = false;
drm_area2 = false;
drm_area3 = false;
drm_area4 = false;
drm_area5 = false;

If you're not using scripts you can put all of that in the init field of a GameLogic or a player unit or something similar.

Then as you said turn each true in the OnAct field of your area triggers.

drn_area1 = true;

Then the ending trigger would have a Condition of:

drn_area1 && drn_area2 && drn_area3 && drn_area4 && drn_area5

You probably don't want anything in the OnDeactivate fields unless you want to hold all the areas simultaneously. For most uses of trigger based objectives, just the onAct is fine.

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  

×