Jump to content
Sign in to follow this  
Griffin64

Limiting player respawns?

Recommended Posts

I'm trying to create a MP mission where one team doesn't respawn and the other team gets 3 respawns per player.

I know how to create respawns in general, but I'm just not sure how to limit them.

I also saw the "revive script" which is kinda similar since there was a way to limit respawns in it, but it's just too convoluted for me to understand with my limited knowledge.

So basically I just need help on limiting player respawns (not reviving).

Thanks very much :D

Share this post


Link to post
Share on other sites

Ok, maybe we can simplify it a bit.

How can I make it so both teams get the same number of limited respawns?

Thanks.

Share this post


Link to post
Share on other sites

you cant stop respawns - they are unlimited unless you put a counter on the deaths.

You can do a counter script for each player tho then maybe move them into a holding cell or put them into a cutscene until the round ends..

put [this] exec "counter.sqs" in each units init line

_unit = _this select 0

;;;number of lives
_i = 3


;;;counter
#loop
@(Not(Alive _unit))
_i = _i - 1
? _i == 0 : goto "end"
goto "loop"

#end
;;add what u need here

maybe SQF would work better, but im not the SQF type :)

Share this post


Link to post
Share on other sites
you cant stop respawns - they are unlimited unless you put a counter on the deaths.

You can do a counter script for each player tho then maybe move them into a holding cell or put them into a cutscene until the round ends..

put [this] exec "counter.sqs" in each units init line

_unit = _this select 0

;;;number of lives
_i = 3


;;;counter
#loop
@(Not(Alive _unit))
_i = _i - 1
? _i == 0 : goto "end"
goto "loop"

#end
;;add what u need here

maybe SQF would work better, but im not the SQF type :)

Oh jeez that looks complicated (really, really new to scripting). Would it be possible to turn people into some sort of wildlife or force them into spectator? How would that script look if it's even possible?

Many thanks for your help :)

Share this post


Link to post
Share on other sites
Oh jeez that looks complicated (really, really new to scripting). Would it be possible to turn people into some sort of wildlife or force them into spectator? How would that script look if it's even possible?

Many thanks for your help :)

Im not that advanced in scripting so making the player into something else isnt my thing but there is a trick to doing something like that...

look up enablesimulation - remotecontrol and switchcamera

something like this

_target = _this select 0

Player enablesimulation false
player remotecontrol _target
_target switchcamera "External"

its fun when doing it in the editor but only seems to work on AI that are in vehicles :( (Not tried it on animals tho)

Share this post


Link to post
Share on other sites

Limiting player respawn scripts

© JULY 2009 - norrin

Description:

A suite of scripts that allows you to specify the total number of lives/respawns each team gets (for two teams). When there are no lives left players respawn in spectate mode.

Download

http://www.norrin.org/downloads/ArmA2/Limit_respawns/Limit_respawns_02.utes.rar (v0.2 updated 140709)

To implement

1. Copy the limit_respawns and NORRN_spectate folders into your mission directory

2. Copy the info from the description.ext into your own description.ext file - note you can change the respawndelay, header etc but respawn must = "base" and the AI must be disabled for the scripts to work.

3. Copy the info from the init.sqf into your own init.sqf file - Note there are some parameters that you may wish to change here ie.

// Set parameters for the first playable side

_side_1 = WEST;

_total_respawns_1 = 2;

_respawn_point_1 = "west base";

// Set parameters for the second playable side

_side_2 = EAST;

_total_respawns_2 = 3;

_respawn_point_2 = "east base";

To suit your mission set-up.

4. If your 2 sides are WEST and EAST then create respawn_west and respawn_east markers on the map - alter to suit your settings. NB make sure that these two markers are a long way from each other.

5. Create markers on the map at which you would like your players to respawn in the test mission these are named "west base" for west units and "east base" for east units

6. Create a game logic (object) in the editor and name it:

server

NB this last step is extremely important

When no lives remain, players will get a spectate camera when they die

Key Bindings for simple camera script

W/S keys - next/previous camera

A/D keys - next/previous unit

N - toggles night vision

In "Free camera" mode

Right mouse click on the screen and the camera will rotate, move up and down etc (many thanks to the boys at OFPEC for providing this function).

Mouse wheel -zoom in/out

This camera mode takes a little getting used to but you'll master it fairly quickly

Note these scripts have only been tested quickly so please let me know if any bugs exist.

Edited by norrin

Share this post


Link to post
Share on other sites

What does #end do? End the script? Where can I find a complete list of things like this?

edit:

Nevermind, I see what it does now. Handy little trick

Share this post


Link to post
Share on other sites

Hey, thanks very much for your help, but I'm experiencing a couple of problems.

Firstly, I set: _side_1 = WEST;

_total_respawns_1 = 2;

_respawn_point_1 = "west base";

But my character had to die 3 times before being put into spectate camera, and even then my character would still respawn and my friend could kill it.

Secondly, I put in a .sqs script to remove NVGs from players on WEST which works fine in the editor's preview mode, but in multiplayer, the default rifleman loadout still appears. (not sure if related to your script somehow)

Thirdly, once I died 3 times, I was put into a broken spectate camera. It just kept rotating really fast, and none of the camera controls worked.

Thanks for any help :)

Share this post


Link to post
Share on other sites

@ Griffin - Sounds like you may be missing something can you please email me your mission to here and I'll take a look at it.

One thing you do need to do is to make sure that the respawn_west and respawn_east positions are a long way away from the combat zone. I'll add some code to make the "dead" units invincible. Also players will respawn with the default load-out (this is just what the game does) I can add some code that will make them respawn with the load-out you give them in the editor if you like.

Share this post


Link to post
Share on other sites
@ Griffin - Sounds like you may be missing something can you please email me your mission to here and I'll take a look at it.

One thing you do need to do is to make sure that the respawn_west and respawn_east positions are a long way away from the combat zone. I'll add some code to make the "dead" units invincible. Also players will respawn with the default load-out (this is just what the game does) I can add some code that will make them respawn with the load-out you give them in the editor if you like.

Thank you very much, email has been sent.

Share this post


Link to post
Share on other sites

Limiting player respawn scripts update v0.2

download

http://www.norrin.org/downloads/ArmA2/Limit_respawns/Limit_respawns_02.utes.rar

Added Features

* Players respawn with load-out they started the mission with

* The player's avatar is made invincible and setPactive true when the spectate script starts

NB: If you're using the previous version of the script just swap the Limit_respawns folder in your mission directory with the one in the rar file.

Share this post


Link to post
Share on other sites

Thanks Norrin,

This script does exactly what i have been trying to achieve & more for 2 weeks : P

I am a novice scripter and appreciate your effort and community contributions.

Thanks

Frosty

Edited by Rough Knight

Share this post


Link to post
Share on other sites

Norrin's script is awesome! Only problem I came across was.. I don't know how to disable the test. See it went through the test spawns first... and then it did it for real. My game is set up for a Last Man Standing mission. With the test script running first, it gives everyone two lives.

Thanks for the help and the input guys!

Share this post


Link to post
Share on other sites

i love this Script ! Maybe it is possible to write the same Script with a Option for both Sides, with multiple choiceable Spawnpoints( maybe at a small Screen :) ) ?? I say pleeaase :) norrin. I know the revive Script but i dont need a revive, only limited Spawns and the Possibilty to choice the Spawnpoint.

Greetings Thunder

Share this post


Link to post
Share on other sites

stick to sqf. theres alot of problems with sqs and its missing alot of useful commands.

add an eventhandler to each player, type killed.

player1 addeventhandler ["killed", player1Lives = player1Lives - 1; if (player1Lives <= 0) then {//Turn off your revive script or make them teamswitch to some animal or w.e};]

of course you would have to define all players with a variable for their number of lives.

so in the init:

playe1Lives = 3;

player2Lives = 3;

etc etc

might be better using setVariable on a player, so that globals dont effect other things in the game.

Share this post


Link to post
Share on other sites

is it possible to do an instant respawn with this? Or will it need some fixing up?

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  

×