Jump to content

Sign in to follow this  
Lokai

Respawning

Recommended Posts

Hey everyone, i've read a bunch of stuff on respawning players but it has only showed me how to make players instantly respawn from where they died or respawn from *a* base, or from a group. I've seen extensive respawn options in some of the multiplayer modes that people have made but im doing a beach assault map and im trying to make it so that if you die in the beginning of it you can respawn as a paratrooper onto the beach.

Im also trying to make it so once you get onto the beach you can take a certain area and it then becomes a respawn point also ontop of the respawning from paradrop. I would settle for just one of these respawn options but I haven't been able to figure out either. I tried to use Murray's guide but wasn't much help. Any help or ideas would be great, thanks. Also, sorry if there a thread for something similar to this somewhere, I couldn't find it.

Share this post


Link to post
Share on other sites
  Lokai said:
im trying to make it so that if you die in the beginning of it you can respawn as a paratrooper onto the beach.

Just put the BASE marker at the point on the beach you want them to respawn at and use the BASE option or am I not understanding you request?

Share this post


Link to post
Share on other sites

I think he means when you respawn you repsawn in the air as a paratrooper.

Share this post


Link to post
Share on other sites

Yah Dale is right, I would like it so if you get killed you respawn as a paratrooper above the beach. Also I am trying to do what they have in multiplayer where you take a area and then can respawn in it. I know this isn't possible as purely single player so I am trying to make this map a 2-8 person coop map.

Share this post


Link to post
Share on other sites

trigger, on activation:

"respawn_east" setmarkerPos getMarkerPos "MarkerName"

respawn as new class I haven't come to yet (just started with this stuff).

Share this post


Link to post
Share on other sites

Would you mind explaining that to me? I get the jist of it, but im a super noob and have no experience with scripting just the basic functions.

Share this post


Link to post
Share on other sites

No scripting necessary. If you want to respawn at base, you need a marker called "respawn_west" (if you're Bluefor). To move it by capturing a zone, create trigger with min/med/max time detected by Bluefor, present, On condition

this

on act.

"respawn_west" setMarkerPos getMarkerPos "MarkerName"

with respawn=3 (or base) in a file called description.ext

Only been at it a week, and nothing I've needed has required a parachute, so sorry, can't help you there.

Share this post


Link to post
Share on other sites

I saved the description.ext to my mission folder for the mission and when I tried to save it in in the editor it crashed..do I need to make a seperate folder inside of the mission directory? What I had it in was.. C:\Documents and Settings\SMC\My Documents\ArmA 2 Other Profiles\Lokai\missions\Operation%20Sand%20Runner.utes

and all I had was the respawn=3 in the description.ext

---------- Post added at 03:03 AM ---------- Previous post was at 02:57 AM ----------

Also, I may have done this wrong, but from what you said I created a trigger that I named capture with "respawn_west" setMarkerPos getMarkerPos "MarkerName" on act. I also created a marker called "respawn_west". Are the quotations supposed to be there in these lines? I tried doing it without them just to check it out but it wouldn't even create the trigger.

Share this post


Link to post
Share on other sites

Any help with this? Not sure what I did wrong.

Share this post


Link to post
Share on other sites

To respawn in general in MP:

1. create a marker called respawn_west

2. in description.ext, set the respawn type to base (I forget which number that is)

To respawn as a paratrooper, add an event handler in the ini/sqf file which gets fired upon player respawn.

The event handler simply calls one of the BIS halo functions (search the forum for HALO).

Check out my mission operation magpie, in my sig, which already has paratroop insertion upon respawn - you can probably reverse engineer it.

Share this post


Link to post
Share on other sites

Do I need to do anything to open your mission in editor? Or should it already be in there? Also, this is way noob sounding, but when I try to create a description.ext it gives me a error in ARMA 2 when I try to open that mission up that I created the description for.

Share this post


Link to post
Share on other sites

Isn't it awesome that a typo doesn't just give an error, but crashes the whole game. Especially when you start your first mission in Chernarus.

Lokai, add a semicolon to the end of the line:

respawn = 3;

respawndelay = 10;

and so on;

If you haven't figure it out, "markername" is another marker with the name "markername". And yes, marker references need quotes. To open up Magpie, search google or armaholic for cPBO by Kegetys, and unpack it where you made mission is (if you want to see it in the editor that is, you can just open it with notepad to see the scripting), or you could unpack the official missions, though they're a bit complicated.

Share this post


Link to post
Share on other sites

very helpful thank you. Hopefully I won't need to bump this thread back up again.

Share this post


Link to post
Share on other sites

@lokai

to open my mission in the editor, you'll need to unpbo it and place the folder in your missions folder in your profile area in my documents.

If you just want to play it as a proff of concept, just put the pbo file in the MPmissions folder in your arma2 root directory

Share this post


Link to post
Share on other sites

ive got a problem with respawn, when i die i ll respawn at the marker but then i cant die anymore im in god mod , same problem with my 3 AI team mate spec ops , when they die they ll respawn in god mod, and they are not spec ops anymore but normal soldier???

and another problem, after first death tasks disappear

im using this:

a marker named respawn_west

in description

enableTeamSwitch = true;

respawn = 3;

respawndelay= 10;

disableAI = 1;

class Header

{

gameType = COOP;

minPlayers = 1;

maxPlayers = 4;

}

Share this post


Link to post
Share on other sites

The invincible on respawn bug usually occurs when also trying to use the first aid modules in the editor - are you doing this?

The teamswitch option being anabled may also provide a conflict with respawning AI.

Share this post


Link to post
Share on other sites
  TurokGMT said:
The invincible on respawn bug usually occurs when also trying to use the first aid modules in the editor - are you doing this?

The teamswitch option being anabled may also provide a conflict with respawning AI.

you were right, i removed first aid module and god mod is gone.

i removed also teamswitch, i still need to figure why when AI and i respawn all equipment are changed

Share this post


Link to post
Share on other sites

because you are respawning as a fresh unit.

To ensure you spawn with the gear you previously had, you need to use a scripted event handler which retains a list of your kit (the only thing it can't do is keep track of exactly how many rounds you have in your current mag).

Try this, it's in sqs format, but you could probably tweak it to do the same thing in sqf:

;Universal Weapons Respawn Script v1.04 (March 31, 2003) revised (February 1, 2007)
;Required Version: ArmA
;original by toadlife revised by norrin for ArmA
;toadlife@toadlife.net
;intialize like this: ["unitname",0] exec "weapons_respawn.sqs"
;            Or this: ["unitname",1] exec "weapons_respawn.sqs"
;
; * "unitname" = The name of the player the script runs on (must be enclosed by quotes!)
; * 0/1 = method of repleneshing weapons
;  **if method is 0, the player gets the same weapons he started out with every time
;  **if method is 1, the player gets the same weapons he had when he died
;
; Advanced example method of initializing script - put the following lines in your init.sqs,
; and replce the unit names with your own:
;_units = ["w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18"]
;{[_x,0] exec "weapons_respawn.sqs"} foreach _units
;
;

~(random 0.3)
_name = _this select 0
_method = _this select 1
_hasrifle = false
_unit = call compile format["%1",_name]
?(_method == 0):_return = "checklocal";goto "guncheck"

#checklocal
_unit = call compile format["%1",_name]
?(local _unit):goto "respawnloop"
~(1 + (random 3))
goto "checklocal"

#respawnloop
@!alive _unit
#checkmethod
?(_method == 1):_return = "waitforlife";goto "guncheck"

#waitforlife
@alive call compile format["%1",_name]
_unit = call compile format["%1",_name]
removeAllWeapons _unit
?_hasrifle:_guns = _guns - [_prigun];_guncount = count _guns
_c = 0
while {_c <= (_magcount - 1)} do {_unit addmagazine (_mags select _c); _c = _c + 1}
_c = 0
while {_c <= (_guncount - 1)} do {_unit addweapon (_guns select _c); _c = _c + 1}
?_hasrifle:_unit addweapon _prigun;_gun = _guns + [_prigun]
;//If unit has a rifle select it
?_hasrifle:goto "selectrifle"

;//No rifle - if unit has a pistol, select it
?_unit hasweapon ((weapons _unit - [secondaryweapon _unit,"Binocular","NVGoggles"]) select 0):_unit selectweapon ((weapons _unit - [secondaryweapon _unit,"Binocular","NVGoggles"]) select 0);goto "respawnloop"

;//No rifle or pistol, select secondary weapon
_unit selectweapon secondaryweapon _unit
goto "respawnloop"

#selectrifle
;// BUG WORKAROUND! - Added to compensate for selectweapon bug 
;// Any gun with more than one muzzle (grenadelaunchers) cannot be selected with selectweapon!
;// Default Grenadelaunchers supported - Add your own types if you need to.
_unit selectweapon _prigun
?_prigun == "M16A2GL":_unit selectweapon "M16Muzzle"
?_prigun == "M16A4GL":_unit selectweapon "M16Muzzle"
?_prigun == "M16A4_ACG_GL":_unit selectweapon "M16Muzzle"
?_prigun == "M4GL":_unit selectweapon "M4Muzzle"
?_prigun == "M4A1GL":_unit selectweapon "M4Muzzle"
?_prigun == "AK74GL":_unit selectweapon "AK74Muzzle"

goto "respawnloop"


#guncheck
_guns = weapons _unit
_mags = magazines _unit
~(random 0.5)
_guncount = count _guns
_magcount = count _mags
?_unit hasweapon (primaryweapon _unit):_hasrifle = true;_prigun = primaryweapon _unit;goto _return
_hasrifle = false
goto _return

Share this post


Link to post
Share on other sites

I'd like to make a few multiplayer maps so I'm watching this thread with great interest.

Share this post


Link to post
Share on other sites

"respawn_west" setMarkerPos getMarkerPos "MarkerName" is not to be used exactly as written.

In the above line of code, "markername" refers to another marker that you have placed and given a name. You would enter that name as "markername" in the line of code.

Share this post


Link to post
Share on other sites

And marker names apparently need to be surrounded with quotes, which is rather counter-intuitive as you'd think they would act as any other object...

Check out the AAS gear saving system, it's a rather decent one. IMO much better than the "spawn with what you had before you died" method that is used in evo/dom, but probably more complicated to implement (then again if you know how to copy...). It allows you to both pick whatever gear you want from the box and save the loadout so you respawn with exactly that every time, plus you can also change gear without saving so your next respawn will bring back the original loadout, which is good if for example you just wanted to grab a stinger for downing the chopper that doesn't respawn often when you normally run around with a javelin or RPG to take down the armored vehicles that normally infest the map ;)

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  

×