OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Pr0ph3t on 01 Apr 2005, 22:03:23

Title: JOIN THE ARMY
Post by: Pr0ph3t on 01 Apr 2005, 22:03:23
heheh just kidding.

I want a little island with 30 men on it and every time you approach one it joins your group if you have under and up to 12 men. Is there a quick trigger way to do this?
Title: Re:JOIN THE ARMY
Post by: nominesine on 01 Apr 2005, 22:53:03
A nice little script that will teach you how to do this can be downloaded from the editors depot:

http://www.ofpec.com/includes/download2.php?id=157

The script takes units from other groups to replace losses in your own squad.
Title: Re:JOIN THE ARMY
Post by: Pr0ph3t on 02 Apr 2005, 01:59:21
That's a pretty good tut.. I thought I had read every one in existence.. However, I'm thinking of more of a trigger way to do this.

Is there a way to do this through the init field of a unit and a big trigger?
Title: Re:JOIN THE ARMY
Post by: dmakatra on 02 Apr 2005, 03:41:49
Dunno if this'll work. Should work in theory.

_array = [loon1,loon2,loon3,etc]
_i = 0

#loop
? ((player distance (_array select _i)) < 10) : [(_array select _i)] join (group player)
_i = _i + 1
? _i > count _array : _i = 0
~0.05
goto "loop"

:beat: *Gets Shot* :beat:
Title: Re:JOIN THE ARMY
Post by: Pr0ph3t on 02 Apr 2005, 05:51:49
This does look very convincing. I'll post my results when I'm at this point
Title: Re:JOIN THE ARMY
Post by: macguba on 02 Apr 2005, 15:22:51
I think ECP includes a feature a bit like this.