Jump to content
Sign in to follow this  
Kebab

Alternative Respawning

Recommended Posts

Hello Lovely Community.

I have been struggling finding a way to make a different respawn system. I am well versed in the “normal†way of respawning. Unfortunately, it does not currently cut it for me. The system I am looking for is something along the lines of this:

When a player dies, he remains dead until the remaining players have cleared an objective. If all players die, the mission ends in failure.

Furthermore,

If objective 1 is completed, all dead players instantly spawn at marker A. (one time trigger)

If objective 2 is completed, all dead players instantly spawn at marker B. (one time trigger)

I would only assume it has been done before, and I would appreciate any references. Normally the search field solves all my arma problems, but in this case, it did not :(

Thanks in advance!

Share this post


Link to post
Share on other sites

In general, the 'normal' way of respawning just means that you don't heavily interfere with the respawn process by using eventhandlers and scripts. What you are describing is very possible with some knowledge of SQF and locality/remote execution. There are also different approaches to get the same result.

This is what I would do:

For stopping respawn, put a MP respawn eventhandler on players, then check if the objective is complete any way you can. If it is not complete, kill the player and make them wait again to respawn (show a black script or something to cover it up). If the objective is complete, let the player respawn wherever you want (helps to be able to test which objective is which). With a respawn timer of about 20 seconds, player won't have to wait too long after the objective is complete. You can use some tricks with global variables on the client machines to be sure you check the latest objective and don't allow respawn more than once per objective. This works for base and instant respawn options.

https://community.bistudio.com/wiki/addMPEventHandler

You could also try this instead of killing them again:

https://community.bistudio.com/wiki/...yerRespawnTime

I haven't tried it though; it sounds like it doesn't reset the timer, just changes it in the future.

For all players being dead, I would put a killed eventhandler on each player, then check if all other players are dead each time it fires. If they are, end the mission in any way you want. This will require the use of BIS_fnc_MP or equivalent, as the ending the mission happens locally as far as I know.

I don't know how experienced you are with SQF, so if something is unclear just ask.

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
Sign in to follow this  

×