Jump to content

Recommended Posts

Hello,

I'm making a mission which you switch units with a trigger.

Trigger condition is fine, but issue is the activation. I want to have a phase, like, "fadeout > sleep for about 5 secs > switch unit > sleep for another 5 secs > fadein". Issue is, sleep doesn't work in triggers. Fadeout sequence starts but turns into fadein almost immediately with a bunch of "expression errors".

//This is what I got inside Trigger "On Activation"

[0, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;
uiSleep 5;
selectPlayer player2;
uiSleep 10;
[1, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;

 

I'm not very found of external files or I don't really understand script languages. Is there a way to make it work with triggers? I remember these being easy before, I had a Steam post but looks like discussions were wiped and stuff changed since then.

Share this post


Link to post
Share on other sites

@JoseRodriguez,
Try this,

null=[]spawn {

[0, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;
uiSleep 5;
selectPlayer player2;
uiSleep 10;
[1, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;

};

Have Fun!

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Although I have no idea what actually null does, it just worked !

Thank you very much good sir.

  • Like 2

Share this post


Link to post
Share on other sites

@JoseRodriguez,
 

Quote

Although I have no idea what actually null does...


In this case null is just the name of the process. Something like,

you_fadeEffect=[] spawn...

would work just as well.

Anytime you need a sleepy script in the editor it has to be within a  code-block, so,

you_saySleep=[] spawn {
sleep 1;
systemChat "Sleep";
};
you_isAlive=[] spawn {
waitUntil {sleep 1; alive player};
systemChat "Player is alive";
};

Have fun!

  • Like 4

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

×