OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 05 Mar 2005, 13:30:26

Title: Respawn-run-respawn-run
Post by: greg147 on 05 Mar 2005, 13:30:26
Hi all,

Is there a way to make a group of soldiers run falwards, then when they die there is a 20 second wait, and then their bodies are deleted and the group respawns at the original starting place, and follows the same waypoints?

Thanks
Title: Re:Respawn-run-respawn-run
Post by: bored_onion on 05 Mar 2005, 16:16:46
you could use a script. something like:

Code: [Select]
*command to create your group* (sorry I can't remember how atm)

grp leader domove gamelogic

#check

?!alive grp leader: goto "Continue"
goto "check"

#continue
~20
[] exec "thisscript.sqs"

the use of "grp" could be wrong but substitute it for the actual command that sticks a group into an array.
Title: Re:Respawn-run-respawn-run
Post by: greg147 on 06 Mar 2005, 00:14:12
Thanks  ;)
So I put that in a script called 'thisscript', find out the create group command, and it should work?

I'll try it.  ;D
Does anyone know the command for creating a group?  :P
Title: Re:Respawn-run-respawn-run
Post by: bored_onion on 06 Mar 2005, 12:18:21
found this in the official comref to do with the group command so where I wrote "grp" write "group"

group obj

Operand types:
obj: Object
Type of returned value:
Group
Description:
Group in which given unit is assigned. For dead units GrpNull.

Example:
group player == group leader player


to create a group you may just need to create individual units and group them together separately.

EDIT: Having re read my original post there may be some gaping syntax errors which need ironing out. Just fiddle with it or wait for more suggestions.
Title: Re:Respawn-run-respawn-run
Post by: macguba on 06 Mar 2005, 13:15:57
Quote
to create a group you may just need to create individual units and group them together separately.
Wrong.    ;D   Sorry.

Every unit is a member of a group.    (Unless it is dead.)    Automatically.   A unit that is not a member of a group is an impossibility.    If you have a unit, you have a group.  

You can't createUnit a loon except into a pre-existing group.  

If you place a unit in the editor you are by definition creating a group, although you can immediately destroy that group by putting the unit into another group.

AFAIK there is no command to create a group.   The only way to create a group is to place units (including gamelogics) in the mission editor.

The command group returns the group of which the object is a member.     It has nothing to do with group creation.



Returning to the original question, there are certainly dead body deletion scripts in the Ed Depot and I suspect respawning scripts too.
Title: Re:Respawn-run-respawn-run
Post by: bored_onion on 06 Mar 2005, 20:05:48
yeah, listen to macca. he knows what hes talking about
Title: Re:Respawn-run-respawn-run
Post by: greg147 on 06 Mar 2005, 21:34:46
I checked the editors dept, and there were some group respawn scripts, but not really what I needed  :-[

They were more of, when the player gets to a place, units are spawned there. I was kinda looking for more when everyone dies they start again. I'll keep looking though  ;)