OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Jim666 on 26 Jan 2005, 16:46:55

Title: Attaching markers to units
Post by: Jim666 on 26 Jan 2005, 16:46:55
Ive seen this been done before in a multiplayer map, well ALOT of multiplayer maps. I want a few markers to be attached to playbale units.

How would i got about doing this
Title: Re:Attaching markers to units
Post by: nominesine on 26 Jan 2005, 19:04:25
Make a loop and use the setMarkerPos command repeatedly. Once every 10 seconds should be enough.
Title: Re:Attaching markers to units
Post by: rhysduk on 27 Jan 2005, 12:21:08
From a script i made:

Code: [Select]
#Loop

_unit = West_2; _mark = "West_2_Marker"
?(alive _unit): _mark setmarkerpos [getpos _unit select 0, getpos _unit select 1]
?(!alive _unit): _mark setmarkerpos [0,0]

Goto "Loop"

Let me explain what it does:

_unit = West_2 = West_2 is the name of the unit you want tracked.
_mark = "West_2_Marker" = Is the name of the marker you want attached to the unit.

Thats all you need to modify to get the script to follow a unit.

PM/Email me if you got questions.

Rhys
Title: Re:Attaching markers to units
Post by: Jim666 on 28 Jan 2005, 23:01:56
So if i want to add multiple units is just add them lines again or?
Title: Re:Attaching markers to units
Post by: rhysduk on 29 Jan 2005, 18:43:55
Yes all you need to do is add the three lines and change what i said.
Code: [Select]
#Loop

_unit = West_2; _mark = "West_2_Marker"
?(alive _unit): _mark setmarkerpos [getpos _unit select 0, getpos _unit select 1]
?(!alive _unit): _mark setmarkerpos [0,0]

_unit = West_1; _mark = "West_1_Marker"
?(alive_unit): _mark setmarkerpos [getpos _unit select 0, getpos _unit select 1]
?(!alive_unit): _mark setmarkerpos [0,0]

Goto "Loop"


Rhys
Title: Re:Attaching markers to units
Post by: Jim666 on 29 Jan 2005, 18:56:36
Thanks mate
Title: Re:Attaching markers to units
Post by: rhysduk on 29 Jan 2005, 18:57:16
No Problem.