Jump to content

Recommended Posts

The group I'm part of is running a Mike Force server, and we want to be able to ensure group members can always join (so, reserved slots). However, we'd also like those reserved slots to be open to anyone if there's no group members waiting. Basically, we want the reserved slots to work more like priority slots that are only reserved if a group member is connected but not in the mission. Is this possible?

Share this post


Link to post
Share on other sites

From this page:

 

Quote

You may host it on your servers and play it in its published state only.
This is a temporary restriction, that will last until the end of the Mike Force beta. We want to ensure all players have the best, most up-to-date experience possible - and that's unfortunately not feasible if people start producing variants!

We hope to make the mission available for changes after its full release - thanks for understanding!

 

  • Like 1

Share this post


Link to post
Share on other sites

Regardless Mike Force Beta, for anyone that may interest and test it:

 

I guess you already found multiple topics about reserved slot and especially the Larrow's scripts:
 

 

From this point, using the Larrow's variables, as you can see, reserving slots relies on:

- allowed  : a list of players' UIDs  which grant the access to specific slots;

- some specific slots set with a variable from editor:    this setVariable [ "Reserved", true ]

 

My thought: If you want a non-listed player to access a reserved slot, after one of the granted player chose a standard slot (so abandons his privilege and frees a reserved slot, but which one?), you can:

- give privilege to another player; ("open" the UIDs list)...  not easy to manage afterwards

or

- temporary free the slots (with variable set to false)

In both cases, this should be temporary, the time for a non-granted player to choose a slot. Then back to the normal.

 

So, imho you need a loop in initserver.sqf:
 

NOT TESTED so far, sorry!

[] spawn {
     waitUntil {allPlayers isNotEqualTo []};
     private _coolPlayers = [];
     private _nonPlayedReservedSlots = [];
     while {true} do {
        waitUntil {uiSleep 0.5; allPlayers findIf {_x in allowed && !(_x in _coolPlayers) && !(_x getVariable ["reserved",false])} > -1};
        _coolPlayers append (allPlayers select {_x in allowed && !(_x in _coolPlayers) && !(_x getVariable ["reserved",false])});
        _coolPlayers = _coolPlayers - (playableUnits select {!isPlayer _x});
        _nonPlayedReservedSlots = playableUnits select {!isNil {_x getVariable "reserved"} && !isPlayer _x};
        {_x setVariable ["reserved",FALSE,TRUE]} forEach _nonPlayedReservedSlots;
        waitUntil {uiSleep 0.5; _nonPlayedReservedSlots findIf {isPlayer _x && !(_x in allowed)} > -1};
        {_x setVariable ["reserved",TRUE,TRUE]} forEach _nonPlayedReservedSlots;
    };
};

working, if I'm right, like this:
wait for at least a player in game

loop for:
waiting  for players (probably just one in such case during 0.5 sec.) belonging to granted , using a non-reserved slot (reserved is false by default) , not already detected as a cool player (just for halting the loop)
this  player is cool (so added in _coolPlayers)
clean the _coolPlayers list because some of them perhaps quit the game

check for the remaining reserved slots (not played)
set the "reserved" variable to false on them. (concern only the reserved slots)

wait for a non-granted player choosing one of these slots

back to normal (the reserved slots are set to "reserved" true).
loop waiting for a new granted player to be cool.

 

 

Share this post


Link to post
Share on other sites
20 hours ago, stanhope said:

From this page:

 

 

Per their forum, modifications are now permitted (and have been for a few days) provided you observe certain limitations (namely, not editing any of the Mike Force code files, the author info and splash screens, and making it clear what you changed). And thank you pierremgi, we'll give that a try!

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

×