Page 1 of 1

Class markers do not remain [Solved]

Posted: Wed Mar 04, 2015 4:17 pm
by AnthonyBF2
I'm trying to always have 2 characters marked with flashing arrows.

It works but after they have been killed, and respawn, the trackers are removed.

Current code (works, with no error log stuff, just cannot make it stick)
Hidden/Spoiler:
OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
--codes go here--
MapAddClassMarker("cis_inf_droideka_2", "hud_objective_icon_circle", 1.5, ATT, "RED", true)
MapAddClassMarker("cis_inf_droideka_3", "hud_objective_icon_circle", 1.5, ATT, "RED", true)
end
end
)
Thank you. :wink:

Edit:
I assume there is a way to do this without using OnCharacterSpawn with a player.

Re: class markers do not remain

Posted: Thu Mar 05, 2015 8:00 am
by nobody3
Maybe you have to remove the marker after the unit dies with MapRemoveClassMarker

Re: class markers do not remain

Posted: Thu Mar 05, 2015 9:53 am
by Teancum
In my experience the game considers each spawn a new instance of a "player", be it human or AI. So yes, you'll need to wrap that in an OnCharacterSpawn(). It's been too long since I've written any lua, so unfortunately I can't give you an example.

Re: class markers do not remain

Posted: Sat Mar 07, 2015 1:24 am
by Maveritchell
nobody3 wrote:Maybe you have to remove the marker after the unit dies with MapRemoveClassMarker
That's the answer. There's not really a good reason for the class markers (they are class markers, after all) to be tied to instances, but they are. You should refresh them with MapRemoveClassMarker(classname, team).