Jump to content
Sign in to follow this  
kdk11

Making triggers activate only after task complete?

Recommended Posts

hello is it possible to make triggers activate only after a task is complete? For example in my mission you have to clear a town, and once you clear the town you have to speak to AI civilians. At the moment you can speak to them during the first task, which ruins it. I would like to make it so you can only speak to them after the first task. Anyone know how this would be done?.

Share this post


Link to post
Share on other sites

I would go with a trigger to complete the task, then the trigger to go off after the task would have this code as the condition. Make sure you name the task completing trigger, and use that name for the triggerActivated condition.

triggerActivated <triggername>

Share this post


Link to post
Share on other sites

I suppose you have a trigger which sets the task to completed. You can then check in the second trigger conditions, whether the first trigger has fired.

I make my Mission triggers in two steps, lets say the players have to reach a specific area to complete the task, and then the option to speak with the civilian gets available.

I make a trigger zone, blufor present, on activation it sets a variable "z1 = 1;". I set another trigger, condition "z1 == 1;" which I sync with the set task state module, to complete the task. On this trigger in the activation, you can add the code to make the speak to civilian action available. Or you create another trigger with "z1 == 1;"

Don't forget to initialise z1 on mission start (z1 = 0;) in the init field of some ai unit. Just to be safe.

Share this post


Link to post
Share on other sites

I have used modules for all my tasks. And I am sure there is a way to sync the AI to only speak after the first task is completed however finding which part to sync it too is where I am stuck. There are 7-8 different modules for all the different tasks. First task is to clear a town, then the second task is to find intel. And thats the task I want the AI to speak on only. If this all makes sense.

Share this post


Link to post
Share on other sites

Find your first trigger of that conversation. Change it to BLUFOR PRESENT and change it's condition to:

this && ["clr1"] call BIS_fnc_taskState == "SUCCEEDED"

  • Like 1

Share this post


Link to post
Share on other sites

would i put that in all the triggers i have for the conversations?

Share this post


Link to post
Share on other sites

Nope, just the first as I said. Your other triggers all wait for a value to be set based on that first trigger, all your msgdone stuff.

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  

×