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.
Edit:
I assume there is a way to do this without using OnCharacterSpawn with a player.
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.
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).