Jump to content
Sign in to follow this  
jw custom

Is there a parameter for number of respawns?

Recommended Posts

Is there a parameter to go with respawn and respawnDelay that set the max. number of respawns?

Is it correct that you can not change respawn/respawnDelay values on the fly?

Share this post


Link to post
Share on other sites

you didnt say descriptions.ext in your 1st post.

afik you cant set this in the description.ext file.

you have to give respawnVehicle command the nr you want for vhehicles.

for players, i guess you have to make som sort of counter "Lifes" when it reach 0 set him/here to a dog or a bird or something. or just force a camera.

Share this post


Link to post
Share on other sites
you didnt say descriptions.ext in your 1st post.

But i mentioned the respawn and respawnDelay parameter so i thought it was clear :)

for players, i guess you have to make som sort of counter "Lifes" when it reach 0 set him/here to a dog or a bird or something. or just force a camera.

I have tried that and the counter works fine but i can't seem to break out of that "keep respawn loop", thats why it would have been nice if i could set respawnDelay really high locally but that doesn't seem to work :(

Share this post


Link to post
Share on other sites

Run once at start:

_respawns = 0;

while {_respawns < 3} do
{
    while {alive player} do // wait for the player to die, waitUntil would be unnecessarily resource-heavy
    {
         sleep 1;
    };
    _respawns = _respawns + 1;
};
//Player has died more than 3 times once he gets here.

waitUntil {alive player}; //Wait for him to respawn again

/*
Create some cute camera here.
*/

player setPos [1,1,0]; //Move him away

Keep in mind this is very basic. It can be easily cheated by reconnecting too.

I didn't use killed EH because that is executed where the unit is local - server. You'd have to opt for some more advanced methods of server-client communication in this case. There might be a template for such thing though, if not I may be interested in creating one.

Share this post


Link to post
Share on other sites
Run once at start:

_respawns = 0;

while {_respawns < 3} do
{
    while {alive player} do // wait for the player to die, waitUntil would be unnecessarily resource-heavy
    {
         sleep 1;
    };
    _respawns = _respawns + 1;
};
//Player has died more than 3 times once he gets here.

waitUntil {alive player}; //Wait for him to respawn again

/*
Create some cute camera here.
*/

player setPos [1,1,0]; //Move him away

Keep in mind this is very basic. It can be easily cheated by reconnecting too.

I didn't use killed EH because that is executed where the unit is local - server. You'd have to opt for some more advanced methods of server-client communication in this case. There might be a template for such thing though, if not I may be interested in creating one.

That looks very similar to what i already got but how to determine when all connected players have used their lives?

Here's what i already got:

waitUntil {!isNull player};

numOfRespawns = 3;

respawnsLeft = numOfRespawns;

while {respawnsLeft > 0} do

{

WaitUntil{not alive player};

respawnsLeft = respawnsLeft - 1;

WaitUntil{alive player};

hint format["Lives left: %1",respawnsLeft];

};

//here i put code for when player has used all lives, not really sure what to put here :confused:

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  

×