OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Ironman on 04 May 2008, 09:15:13

Title: Respawn as a group
Post by: Ironman on 04 May 2008, 09:15:13
I was wondering if there are any scripts already out there to make a whole group respawn after every member in the group is dead.

I want this type of respawn because it will limit those akward times when you have 2 guys back at a base and 2 still out in combat. This way you can insert as a whole group again.

Maybe there can be a parameter that once X number of group members die respawn the dead group members.

P.S. Eat the cheese!
Title: Re: Respawn as a group
Post by: Barbolani on 05 May 2008, 16:33:08
Hi,

Check this thread.

http://www.ofpec.com/forum/index.php?topic=31407.0 (http://www.ofpec.com/forum/index.php?topic=31407.0)

You can just change the number of countunits to 2 or whatever
Title: Re: Respawn as a group
Post by: Ironman on 05 May 2008, 19:55:32
I don't see how that works/helps.

Is it clear what I am looking for?

A script that counts the number of men in your group. Then once the whole group dies it respawns whole group back at a base. These should be PLAYABLE characters.
Title: Re: Respawn as a group
Post by: Barbolani on 06 May 2008, 13:29:02
Yes, it helps indeed, you just modify the script with this:

Quote
_marker1 = _this select 0
_units = _this select 1

_group = group player

_countunits = _units

#Update1

"soldierEB" createUnit [getMarkerPos _marker1, _group]

_countunits = _countunits -1

? _countunits > 0 : goto "Update1"

{_x setplayable} foreach units _group

_countunits = _units

#Update2

{alive _x} count units _group < 2: goto "Update1"

sleep 15

goto "Update2"

exit


At the beggining place the player. Place a marker at the base, call it whatever

Exec the script with [nameofmarkerspawnpoint, , numberofunitsinthegroup] exec blahblah.sqs in some init field or whatever.

Then the units are created at the marker position. When all the units die, after 15 seconds they respawn at the marker, EDIT: and after that they are playable.

You cand modify the script so you have the respawn when more or less units die, join the group after respawning instead of being created in your group etc... Its just an idea..

EDIT: I havent tested this....