Jump to content
Black_Ice931

Trigger after action

Recommended Posts

Hey guys,

 

Very easy question: how can I start a trigger after an action is done?

 

In my case: I have have to talk to someone, after that I wouold like to complete the mission.

 

Help?

 

Cheers.

Share this post


Link to post
Share on other sites

On server(initServerLocal.sqf in MP, init.sqf in SP) , set a variable like: sentencePassed = FALSE;

publicVariable it, if in MP: publicVariable "sentencePassed";

 

Inside your addActionCode, just add:

sentencePassed = TRUE;

publicVariable it, if MP

 

In your trigger add in condition field: ... && sentencePassed

 

 

 

Share this post


Link to post
Share on other sites

I'm definitely not the most expert coder here, so...

 

6 minutes ago, pierremgi said:

sentencePassed = FALSE;

publicVariable "sentencePassed";

 

This is what I need to add in my initServerLocal.sqf.

 

7 minutes ago, pierremgi said:

Inside your addActionCode

Where do I find it?

 

8 minutes ago, pierremgi said:

... && sentencePassed

And those dots will stay or do I need to insert something there?

Share this post


Link to post
Share on other sites

Simpler:

this addaction ["talk", {missionNamespace setVariable ["sentencedPassed",true,true]}];//in you npc''s in it field.

 

Set your trigger condition to :

sentencePassed

and that's it!

  • Like 2

Share this post


Link to post
Share on other sites
On 3/15/2019 at 8:07 PM, Mr H. said:

Simpler:

this addaction ["talk", {missionNamespace setVariable ["sentencedPassed",true,true]}];//in you npc''s in it field.

 

Set your trigger condition to :

sentencePassed

and that's it!

Another question!

 

This works, but I want to use a script to create a marker after that action, how can I call it after that as been done?

 

Script is this:

_comandantepos = getPos latta;
_marker1 = createMarker ["Comandate", _comandantepos];
_marker1 setMarkerShape "ICON";
_marker1 setMarkerType "hd_objective";
_marker1 setMarkerSize [1, 1];
_marker1 setMarkerColor "ColorBlack";
_marker1 setMarkerText "Comandate";
removeAllActions contatto;

 

Thanks

Share this post


Link to post
Share on other sites

Just put it on the on activation partof your trigger or add it to the code of the addaction

  • Like 1

Share this post


Link to post
Share on other sites

Why you want to start a trigger and not a script..? Or are you so horny to write all stuff in one line..?

  • Sad 1

Share this post


Link to post
Share on other sites
46 minutes ago, jts_2009 said:

Why you want to start a trigger and not a script..? Or are you so horny to write all stuff in one line..?

Why not? Depending on your skill, and your aim (area, loop, pre-cond..)

  • Confused 1

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

×