Jump to content
NoFunAllowedBruv

execVM on trigger activation

Recommended Posts

hey,

i have been trying to make this work for hours now but cant seem to fix it. 

 

I want to trigger an end script when all players are dead but the script isnt executing.

NX4mph1.png

 

Share this post


Link to post
Share on other sites

condition:

{alive _x} count allPlayers == 0 && count allPlayers > 0

 

on activation:

give your init_end.sqf . Your code can't work anyway because <this> refer to the trigger, not the players.

Share this post


Link to post
Share on other sites

on act:

0 = [] execVM "sqf\init_end.sqf";

  should work.

I forgot to mention there is no need to preset "any player" "not present" with my custom condition. Let it "none" "none".

Share this post


Link to post
Share on other sites
3 minutes ago, pierremgi said:

on act:

0 = [] execVM "sqf\init_end.sqf";

  should work.

I forgot to mention there is no need to preset "any player" "not present" with my custom condition. Let it "none" "none".

it worked thank you very much!

One more question tho when I want the same thing but when all the AI in the area are dead what would i put in to the condition? sorry pretty new to this :D

Share this post


Link to post
Share on other sites

You need another trigger (for another aim like win end I guess). I presume all AIs are enemies.

This trigger must be none none  (Usually I skip preset conditions but there are several possibilities)

condition:

{alive _x && !isPlayer _x && _x inArea thisTrigger} count allUnits == 0

on act:

execVM the same code , but ending by: "EveryoneWon" call BIS_fnc_endMissionServer;

Share this post


Link to post
Share on other sites
3 minutes ago, pierremgi said:

You need another trigger (for another aim like win end I guess). I presume all AIs are enemies.

This trigger must be none none  (Usually I skip preset conditions but there are several possibilities)

condition:

{alive _x && !isPlayer _x && _x inArea thisTrigger} count allUnits == 0

on act:

execVM the same code , but ending by: "EveryoneWon" call BIS_fnc_endMissionServer;

yeah already have a differen sqf for win and thank you again that worked aswell. 

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

×