Jump to content
Sign in to follow this  
evilnate

Variable Respawn Times

Recommended Posts

I am making a coop mission and I would like to allow players to select which respawn time they want. I did some searching and it looks like the only command that does this is RespawnDelay in the description.ext file.

Is there a way to set respawn time via init.sqs? Like this?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

description.ext

titleParam2 = "Respawn time";

valuesParam2[] = {1,2,3,4};

defValueParam2 = 4;

textsParam2[] = {"5 Seconds", "15 Seconds", "30 Seconds", "60 Seconds"};

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

init.sqs

?(param2 == 1):goto "five"

?(param2 == 2):goto "fifteen"

?(param2 == 3):goto "thirty"

?(param2 == 4):goto "sixty"

#five

respawndelay = 5

goto "Param2_END"

#fifteen

respawndelay = 15

goto "Param2_END"

#thirty

respawndelay = 30

#sixty

respawndelay = 60

goto "Param2_END"

goto "Param2_END"

#Param2_END

help.gif

Share this post


Link to post
Share on other sites

In short, that probably won't work. The respawn delay is hardcoded once its defined in desc.ext.

You're going to have to write a custom script which keeps respawned players in a "holding area" until your respawn script waits the amount of time set in the param (and probably shows a camera view of their body and a timer countdown), then kills the camera and puts them at the respawn zone you want. In this case you should probably set the desc.ext respawntime to be 1 or so so they always end up at the holding area before your script manually 'respawns' the players.

Share this post


Link to post
Share on other sites

how do you even write a respawn code in the description? Im all confused about this... i dunno why they dont just make it optional within game...

Share this post


Link to post
Share on other sites

its not exactly complicated, and the biki documents it completely:

http://community.bistudio.com/wiki/Description.ext

make a notepadfile called description.ext, and then inside write the following:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

respawn = #1;

respawndelay = #2;

#1 being a choice between numbers 0, 1, 2, 3, 4 and 5, with the numbers representing:

0 - No respawn

1 - Respawn as seagul

2 - Respawn where you died

3 - Respawn at a base (base is allocated as a marker named respawn_west/east/guerrila/civilian)

4 - Respawn into an AI slot in your group, if none left you become a seagul

5 - Respawn into an AI slot on your side

#2 being the time in seconds you wait till respawn.

Share this post


Link to post
Share on other sites

Have you tried your proposed solution? If so, let us know if it works! smile_o.gif

If it doesn't work, there are plenty of ideas for workarounds. It all depends on what you want the player to see while they are waiting (i.e. dead). One idea is to tie into Kegetys Spectator Script.

First off, set respawn=base and respawn time=0 (or something low) in the description, and then place the respawn marker in a safe area away from everything. When a player is killed, trap the event with an eventhandler, launch the spectator script, and then after the specified time period (which you now have control of) interrupt the spectator script, and move the player back into the action.

Probably sounds complicated, right? Well, I actually had something like this up and running for OFP, and yeah it got pretty nasty putting it together. My system was actually to tie multiple player led groups together, so when a player died, they could take over as one of their AI group member, if they had any. If they had no AI group members available, they could take over as a friends AI, and if no players had any AI left, the killed player would be taken to the spectator view (which I modified only to be able to spectate friendly players, and no AI).

But these dead players (stuck in spectator mode), could actually return to play if the remaining living players ever encountered any AI groups that were designated as "reinforcements". If a living player found a group of reinforcements, the reinforcements would join his group, and the dead spectating players would get a button on their dialog to "Take over as reinforcement". When they clicked, wallah! They were alive again, taking over as another AI.

The whole thing was designed for long coops, but it was good for all types of missions. It actually worked really well, except for one thing. In OFP, there was no selectPlayer command, and so I had to physically swap out the players body with the AI. This led to all sorts of trouble regarding vehicles. Eventually I got that all ironed out, but it was still kind of jarring if you ever saw the swap taking place, especially if the player and the AI they were swapping into were in different stances. Anyhow, I think the system would work very well in ArmA, due to the advent of the selectPlayer command.

Anyhow, back to your problem. The most complicated part about my original workaround suggestion for you is tying in with Kegetys spectator, so you could really simplify your system by omitting that part. (I.e. you could just black out the screen until you are ready to return the player from the dead, after the duration of your choosing. Or just let them wander around at some designated Valhalla-type place for dead people.) I would defiantly keep the selectplayer command in mind though, to avoid the jarring appearance of the player teleporting back in.

Good luck! biggrin_o.gif

edit:

Also, for those unaware, respawn=side did not work in OFP. (it just did the same as respawn=group). Anyone tested this in ArmA?

Share this post


Link to post
Share on other sites

how do i insert it into an editor mutiplayer mission..? just the same mission i am editing and then hit export to mp? with the description in the mission file?

Share this post


Link to post
Share on other sites

@HT

I'm not completely sure what you are asking, but I did pick up on a couple things that might help you out:

The description.ext file has to be seperate from the mission.sqm.

Also, you shouldn't need to export your mission to multiplayer to get the respawn working.  Just open your mission from Multiplayer and you're good to go.  (Actually I'm just assuming it still works that way in Arm.  It did work that way in OFP though.)

edit: typo

Share this post


Link to post
Share on other sites

Thanks for the replies.

The solution that I was looking for isn't here, so I solved my problem by making the respawn time 30 seconds and adjusted some objective triggers.

Of course I could teleport the dead people like norrin's revive but IMO the less scripts, the more solid the gameplay. It would be nice to have the respawndelay as a scripting command instead of the description setting, but that's arma for ya.

Thanks again for the help. smile_o.gif

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  

×