Jump to content
JohnKalo

Players Ready Condition

Recommended Posts

I have a mission intro set but since it is an SP/MP mission there is a problem. I would like the intro video to start playing once all players are ready and have started the mission. In other words, all players to start seeing the video at the same time. So is there some condition I can use? SP and MP compatible. 

Share this post


Link to post
Share on other sites
On 22/10/2018 at 8:00 AM, JohnKalo said:

I have a mission intro set but since it is an SP/MP mission there is a problem. I would like the intro video to start playing once all players are ready and have started the mission. In other words, all players to start seeing the video at the same time. So is there some condition I can use? SP and MP compatible. 

 

Well, it's easy if you don't disable AIs in lobby:

waitUntil {count allPlayers == count (playableUnits + switchableUnits) }; // SP MP compatible  (EDITED)

 

If you disableAi in lobby (to remove units on unplayed slots before JIP), playableUnits == allPlayers, always. :shaun:

 

so you need to:

waitUntil {count allPlayers == playableSlotsNumber west + playableSlotsNumber east + playableSlotsNumber independent + playableSlotsNumber civilian};  // MP only

 

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks,

@davidoss Seems like a nice solution but the other one seems simpler :thumbsup:

@pierremgi The AI units are not disabled so I will use this:

 

waitUntil {count allPlayers == count playableUnits + switchableUnits};

 

I suppose it works even if all playable slots are used by players.

I will place the above in the initPlayerLocal.sqf and afterwards the intro commands will follow.

 

 

Share this post


Link to post
Share on other sites

Ehm I took the solution as granted and so I moved on to create the media needed. (Not such a good idea :scratchchin:) Due to that, now that some of the media are ready to be implemented, the condition seems not to work. I tested it by placing it in the initPlayerLocal.sqf of a mission and it reported an expression error. Using this seemed to fix it:

 

waitUntil {count allPlayers == count playableUnits + count switchableUnits};

but does it do the same thing? 

Share this post


Link to post
Share on other sites

waitUntil {count allPlayers == count playableUnits + count switchableUnits};

or

waitUntil {count allPlayers == count (playableUnits +  switchableUnits)};

 

I guess a   count playableUnits +  switchableUnits    will fail by the lack of  brackets, counting playableUnits only,   (so, zero in SP preview). Not tested.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I shall use this which I tested and worked:

 

waitUntil {count allPlayers == count playableUnits + count switchableUnits};

 

  • Like 2

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

×