OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ding on 25 May 2010, 00:13:38

Title: The "Leader" command and group unit names, need some help!
Post by: Ding on 25 May 2010, 00:13:38
Hey, heres the situation:

Basically I have created a generic West infantry group in the mission editor and have created a little script so that a marker will follow the squad leader on the players map, which goes like so:

Code: [Select]
_group = _this select 0
_marker = _this select 1

#loop
_marker SetMarkerPos Getpos Leader _group
~0.1
goto "loop"

Now the marker icon im using for the Leader of said group is a green flag, and I'd like all of the units in his squad to have green dots as their markers.. though heres my problem; is their a way to assign markers to the units of a squad without having to give said units individual names in the editor? the leader command works swell for the squad leader but I've not been able to do the same for his men.

any suggestions as to how I can do this without having to assign a name to each individual man?

edit: I've been trauling through some scripts, and tried this for a two man group:

Code: [Select]
_group = _this select 0
_marker1 = _this select 1
_marker2 = _this select 2

_listunits = units _group

#loop
_marker1 setMarkerpos getpos  Leader _group ;; Works Fine up until here
_marker2 SetMarkerpos Getpos (_listunits select 1) ;; caused error here, fixed now works like a charm
~0.1
goto "Loop"

edit #2: I've seen my stupid mistake!
Title: Re: The "Leader" command and group unit names, need some help!
Post by: RKurtzDmitriyev on 25 May 2010, 00:47:41
So do you still need help? :)
Title: Re: The "Leader" command and group unit names, need some help!
Post by: Ding on 25 May 2010, 12:09:41
It's pretty much fine now, I'll just keep using trial and error from now on. Thanks for asking though :)