Jump to content
Sign in to follow this  
acidcrash

Deleting markers ingame

Recommended Posts

righty, im working on a mission which i have markers that follow units on the map, here is the script so far and all works fine

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

"outpostmarker" setMarkerPos [(getpos outpost select 0), (getpos outpost select 1), 1]

~2.5

goto "loop"

<span id='postcolor'>

now what i want to do is that if the unit is wiped out the marker is deleted, on a side note, how do you make it so that the marker follows the group, not just the unit with the name. I tried using a group name, outpost=group this, but this didnt work

Share this post


Link to post
Share on other sites

Properly deleting a marker is not possible, but you can simply move it offmap by using negative xy values like

"outpostmarker" setMarkerPos [-100, -100, 0]

Alternatively, you can resize it to zero:

"outpostmarker" setMarkerSize [0, 0]

A group as such does not have a well defined position (the units are scattered). Instead, the easiest is to you use the position of the groupleader:

_groupPos = getPos (leader groupName)

Share this post


Link to post
Share on other sites

hi, thanks for the reply, the marker size worked perfect, but not sure how to implement the group part. as it is now, this is my script

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

"outpostmarker" setMarkerPos [(getpos outpost select 0), (getpos outpost select 1), 1]

~2.5

?not (alive outpost):"outpostmarker" setmarkersize [0,0]

goto "loop"

<span id='postcolor'>

i was thinking maybe it would be

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_groupPos = getPos (leader outpost)

#loop

"outpostmarker" setMarkerPos [(getpos _groupPos select 0), (getpos _groupPos select 1), 1]

~2.5

?not (alive _groupPos):"outpostmarker" setmarkersize [0,0]

goto "loop"

<span id='postcolor'>

but when i tried it it didnt work sad.gif

Share this post


Link to post
Share on other sites

hi, try this

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

_groupPos = getPos (leader outpost)

"outpostmarker" setMarkerPos [_groupPos select 0, _groupPos select 1, 1]

~2.5

?"alive _x" count (units outpost) == 0: "outpostmarker" setmarkersize [0,0]

goto "loop"<span id='postcolor'>

_groupPos is already a position array [x,y,z], so it is not necessary to use getPos on it.

I also changed the condition for the marker-deletion. Now it becomes true when all units of the group outpost are dead.

The "alive" command can not be used on groups directly.

Hope this works,

Spinor

Share this post


Link to post
Share on other sites

You could set the marker type to "empty".

From the comref-

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">markerName setMarkerType markerType

Operand types:

   markerName: String

   markerType: String

Type of returned value:

   Nothing

Description:

   Set marker type. Type may be any of: "Flag", "Flag1", "Dot", "Destroy", "Start", "End", "Warning", "Join", "Pickup", "Unknown", "Marker", "Arrow", "Empty".

Example:

   "MarkerOne" setMarkerType "Arrow"

<span id='postcolor'>

eg. "MarkerOne" setMarkerType "Empty", an empty marker is invisible on the map.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×