Jump to content
Sign in to follow this  
Major Fubar

Random, limited respawn

Recommended Posts

Hi,

This may be a really insane question, but I'm wondering if I can do the following:

In an MP coop mission, I want someone to have a chance at respawn, that decreases after each respawn. For instance, 1st time you die, 75% of respawn; 2nd time, 50% chance; 3rd time, 25% chance; and 4th time, 0% chance.

Is this remotely possible? Also, if it is, can I have the character respawn in the exact same spot, with all current weapons and ammo?

TIA - Fubar

Share this post


Link to post
Share on other sites

P.S. I fthat is not possible, or too complicated, is there a way to have a "backup squad", so that once all human players are dead, they ALL respawn into a secondary squad who are waiting at a different location? I want this to only happen once...

Share this post


Link to post
Share on other sites

Just create a trigger in the mission area and have it activated by West Not Present (or whatever side the protagonists are on).

In init.sqs have a variable PlayerDeath = 0 initted.

Have another trigger for each unit that is triggered by their death, i.e.

!Alive West1 && Local West1 (to keep the count local)

 Have this trigger exec a script which uses random #'s like so:

;;RespawnCheck.sqs

PlayerDeath = PlayerDeath + 1

_ran = random 1

?_ran <= .75 && PlayerDeath < 2 : goto "respawn"

?_ran <= .50 && PlayerDeath < 3 : goto "respawn"

?_ran <= .25 && PlayerDeath < 4 : goto "respawn"

;;You can decrease the chances differently if you want

;;If they have more than 3 deaths, then it goes to norespawn.

#NoRespawn

;;Setpos the player on an island in the middle of nowhere

Player setpos getpos Somewhere

;;Create some kind of camera, like the death cam in this area to trap them here.

Exit

#Respawn

;;Player respawns as usual.  I'd use Instant respawn in description.ext

Exit

When the West Not Present trigger is activated because all units are dead, Then have another script get activated from this trigger move all units from the group to whereever you want the 2nd squad to start from and use a script to equip them however u wish.

BTW, this is a very rough untested version, but it's not too hard to do.

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  

×