Class markers do not remain [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Class markers do not remain [Solved]

Post 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.
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: class markers do not remain

Post by nobody3 »

Maybe you have to remove the marker after the unit dies with MapRemoveClassMarker
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: class markers do not remain

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: class markers do not remain

Post 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).
Post Reply