Yellow Entity Marker Won't Show [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
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Yellow Entity Marker Won't Show [Solved]

Post by LitFam »

This is my script
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- CIS Attacking (attacker is always #1)
CIS = 1;
REP = 2;

-- These variables do not change
ATT = CIS;
DEF = REP;

function ScriptPostLoad()

DisableAIAutoBalance()
SetAIDifficulty(10,10,"medium")
SetAIDifficulty(10,10,"hard")
SetTeamAggressiveness(CIS, 1.0)
SetTeamAggressiveness(REP, 1.0)
SetDefenderSnipeRange(170)
SetAttackerSnipeRange(170)

-- This would go into ScriptPostLoad()
-- and you would have one for each team capturing CPs

OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.CHR." .. pName .. "_r") -- Show this string to all teams
end,
1 -- Team number for the strings (don't forget to change me)
)

OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.CHR." .. pName .. "_g") -- Show this string to all teams
end,
2 -- Team number for the strings (don't forget to change me)
)

-- the ".." is Lua's concatenate, ie connecting two strings together
-- If the post's name was "cp1" then the line above should create "level.VNV.cp1_r"
-- Just make sure you have a localized string for each side and CP otherwise it will show as "NULL"

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}
cp10 = CommandPost:New{name = "cp10"}
cp11 = CommandPost:New{name = "cp11"}
cp12 = CommandPost:New{name = "cp12"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

IsEntityMarked = 0
mark = OnCharacterDispenseControllable(
function(character, controllable)
if GetEntityClass(controllable) == FindEntityClass("cis_inf_Sergeant_Slick") then
charunit = GetCharacterUnit(character)
if IsEntityMarked == 0 then -- This is line 98.
MapAddEntityMarker(charunit, "hud_objective_icon", 3.0, 1, "YELLOW", true)
IsEntityMarked = 1
elseif IsEntityMarked = 1 then
MapRemoveEntityMarker(charunit)
IsEntityMarked = 0
end
end
end
)

IsEntityMarked = 0
mark = OnCharacterDispenseControllable(
function(character, controllable)
if GetEntityClass(controllable) == FindEntityClass("rep_inf_clone_trooper_F") then
charunit = GetCharacterUnit(character)
if IsEntityMarked == 0 then -- This is line 98.
MapAddEntityMarker(charunit, "hud_objective_icon", 3.0, 1, "YELLOW", true)
IsEntityMarked = 1
elseif IsEntityMarked = 1 then
MapRemoveEntityMarker(charunit)
IsEntityMarked = 0
end
end
end
)

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)
conquest:AddCommandPost(cp10)
conquest:AddCommandPost(cp11)
conquest:AddCommandPost(cp12)

conquest:Start()

SetUberMode(1);

EnableSPHeroRules()

AddDeathRegion("deathregion1")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")
AddDeathRegion("deathregion4")

end

---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()

--tell the game to load our loading image
ReadDataFile("dc:Load\\common.lvl")

ReadDataFile("ingame.lvl")

DisableAIAutoBalance()
SetAIDifficulty(10,10,"medium")
SetAIDifficulty(10,10,"hard")
SetTeamAggressiveness(CIS, 1.0)
SetTeamAggressiveness(REP, 1.0)
SetDefenderSnipeRange(170)
SetAttackerSnipeRange(170)

SetMaxFlyHeight(300)
SetMaxPlayerFlyHeight (300)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("dc:sound\\CHR.lvl")
ReadDataFile("dc:sound\\UW2.lvl;UW2cw")
ReadDataFile("sound\\yav.lvl;yav1cw")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul")

ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hero_anakin")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_trooper_A",
"cis_inf_battle_droid_A",
"rep_inf_artillery",
"cis_walk_small_spider",
"cis_walk_tridroid",
"rep_inf_clone_trooper_B",
"cis_inf_battle_droid_B",
"rep_inf_clone_trooper_C",
"rep_inf_clone_trooper_D",
"rep_fly_gunship",
"rep_inf_clone_trooper_E",
"cis_inf_battle_droid_C",
"rep_inf_clone_trooper_F",
"rep_inf_clone_trooper_G",
"cis_inf_Sergeant_Slick")

ReadDataFile("dc:SIDE\\vip.lvl",
"cis_walk_lr57")

SetupTeams{

cis = {
team = CIS,
units = 100,
reinforcements = 1500,
soldier = {"cis_inf_battle_droid_A",65,65},
assault = {"cis_inf_battle_droid_B",5,5},
engineer = {"cis_inf_Sergeant_Slick",1,1},
sniper = {"cis_inf_battle_droid_C",5,5},

},

rep = {
team = REP,
units = 100,
reinforcements = 1500,
soldier = {"rep_inf_clone_trooper_A",65,65},
assault = {"rep_inf_clone_trooper_B", 5,5},
engineer = {"rep_inf_clone_trooper_G",5,5},
sniper = {"rep_inf_clone_trooper_E",5,5},
officer = {"rep_inf_clone_trooper_C",5,5},
special = {"rep_inf_clone_trooper_D",5,5},

},

}

AddUnitClass(REP,"rep_inf_clone_trooper_F",1,1)

-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 25) -- special -> droidekas
AddWalkerType(1, 25) -- 1x2 (1 pair of legs)
AddWalkerType(2, 25) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 25) -- 3x2 (3 pairs of legs)

local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", weaponCnt)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", weaponCnt)
SetMemoryPoolSize("UnitController", weaponCnt)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("Music",33)
SetMemoryPoolSize("SoldierAnimation",656)
SetMemoryPoolSize("PathFollower",weaponCnt)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix",2000)
SetMemoryPoolSize("ParticleTransformer::ColorTrans",1648)
SetMemoryPoolSize("ParticleTransformer::PositionTr",2000)
SetMemoryPoolSize("ParticleTransformer::SizeTransf",1165)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:CHR\\CHR.lvl", "CHR_conquest")
ReadDataFile("dc:CHR\\CHR.lvl", "CHR_conquest")
SetDenseEnvironment("false")

-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")

-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("dc:sound\\CHR.lvl", "CHR_S")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
--OpenAudioStream("sound\\yav.lvl", "yav1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "Christophsis_Soundtrack", 0,1)
--SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
--SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "Christophsis_Soundtrack", 0,1)
--SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
--SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

--OpeningSateliteShot
AddCameraShot(0.716522, -0.015740, 0.697219, 0.015316, 511.727753, 14.296076, 2.373827);
end[/code]
Last edited by LitFam on Mon Aug 14, 2017 6:50 pm, edited 2 times in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Yellow Entity Marker Won't Show

Post by Marth8880 »

Code: Select all

   IsEntityMarked = 0
   mark = OnCharacterDispenseControllable(
   function(character, controllable)
      if GetEntityClass(controllable) == FindEntityClass("rep_inf_clone_trooper_F") then
         charunit = GetCharacterUnit(character)
         if IsEntityMarked == 0 then -- This is line 98.
            MapAddEntityMarker(charunit, "hud_objective_icon", 3.0, 1, "YELLOW", true)
            IsEntityMarked = 1 
->         elseif IsEntityMarked = 1 then    -- there needs to be two equals signs when comparing values
            MapRemoveEntityMarker(charunit)
            IsEntityMarked = 0
         end
      end
   end
   )
There's a syntax error on the line that I marked.
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Re: Yellow Entity Marker Won't Show

Post by LitFam »

Marth8880 wrote:

Code: Select all

   IsEntityMarked = 0
   mark = OnCharacterDispenseControllable(
   function(character, controllable)
      if GetEntityClass(controllable) == FindEntityClass("rep_inf_clone_trooper_F") then
         charunit = GetCharacterUnit(character)
         if IsEntityMarked == 0 then -- This is line 98.
            MapAddEntityMarker(charunit, "hud_objective_icon", 3.0, 1, "YELLOW", true)
            IsEntityMarked = 1 
->         elseif IsEntityMarked = 1 then    -- there needs to be two equals signs when comparing values
            MapRemoveEntityMarker(charunit)
            IsEntityMarked = 0
         end
      end
   end
   )
There's a syntax error on the line that I marked.
Fixed is there a way to make the arrow stay each time that ai/bot respawns?
Post Reply