kill and respawnobject problems [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
fiddler_on_the_roof
1st Lieutenant
1st Lieutenant
Posts: 460
Joined: Wed Nov 12, 2008 5:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

kill and respawnobject problems [Solved]

Post by fiddler_on_the_roof »

for my campaign, several objects have to be killed via lua then respawned 3 objectives later.
however, when i try to play the map, the bf2 log says it cannot find the objects to be respawned.
Hidden/Spoiler:
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "ccp1-1" not found

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "local_vehicle_spawn" not found

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "rep_vehicle_spawn" not found
here is the lua
Hidden/Spoiler:
KillObject("ccp2")
KillObject("ccp3")
KillObject("ccp4")
KillObject("ccp5")
KillObject("ccp1-1")
KillObject("rep_vehicle_spawn")
KillObject("local_vehicle_spawn")
KillObject("ccp_local")
SetProperty("turret1", "CurHealth", 1200)
SetProperty("turret2", "CurHealth", 1200)
SetProperty("turret3", "CurHealth", 1200)
SetClassProperty("7th_inf_paratrooper", "PointsToUnlock", 0)


--objective :goto
Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.icc.obj.obj1", popupText = "level.icc.obj.popup.obj1",
regionName = "cityjump", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}

Objective1:AddHint("level.geo1.hints.movement")
Objective1:AddHint("level.geo1.hints.obj_markers")
Objective1:AddHint("level.geo1.hints.review_objectives")
Objective1:AddHint("level.geo1.hints.sprint")


Objective1.OnStart = function(self)
att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("cityjump_platform", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)

end

Objective1.OnComplete = function(self)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("cityjump_platform")

end



end



--Objective 2

Turret1 = Target:New{name = "turret1"}
Turret2 = Target:New{name = "turret2"}
Turret3 = Target:New{name = "turret3"}

Objective2 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.icc.obj.obj2", popupText = "level.icc.obj.popup.obj2", AIGoalWeight = 0}
Objective2:AddTarget(Turret1)
Objective2:AddTarget(Turret2)
Objective2:AddTarget(Turret3)

Objective2.OnStart = function(self)
att_obj2_destroy1 = AddAIGoal(ATT, "Destroy", 10, "turret1")
att_obj2_destroy2 = AddAIGoal(ATT, "Destroy", 10, "turret2")
att_obj2_destroy3 = AddAIGoal(ATT, "Destroy", 10, "turret3")
att_obj2_dm = AddAIGoal(ATT, "Deathmatch", 10, "turret1")
def_obj2_defend1 = AddAIGoal(DEF, "Defend", 25, "turret1")
def_obj2_defend2 = AddAIGoal(DEF, "Defend", 25, "turret2")
def_obj2_defend3 = AddAIGoal(DEF, "Defend", 25, "turret3")


--Setup callback to show update messages when turrets are killed
turret_count = 3
TurretKill = OnObjectKillClass(
function(object, killer)
if killer and IsCharacterHuman(killer) then
turret_count = turret_count - 1

if turret_count > 0 then
ShowMessageText("level.icc.obj.obj2-" .. turret_count, 1)
end
end
end,
"tur_bldg_recoilless_fel_auto"
)
end

Objective2.OnComplete = function(self)
ReleaseObjectKill(TurretKill)
TurretKill = nil

ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj2_destroy1)
DeleteAIGoal(att_obj2_destroy2)
DeleteAIGoal(att_obj2_destroy3)
DeleteAIGoal(att_obj2_dm)
DeleteAIGoal(def_obj2_defend1)
DeleteAIGoal(def_obj2_defend2)
DeleteAIGoal(def_obj2_defend3)

end



--objective :goto
Objective3 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.icc.obj.obj3", popupText = "level.icc.obj.popup.obj3",
regionName = "ccp0_control", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}

RespawnObject("ccp1-1")
RespawnObject("local_vehicle_spawn")
RespawnObject("rep_vehicle_spawn")
AllowAISpawn(1)
AllowAISpawn(2)
SetUnitCount(1, 6)


Objective3.OnStart = function(self)
att_obj3_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj3_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("ccp0", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)

end

Objective3.OnComplete = function(self)
DeleteAIGoal(att_obj3_aigoal)
DeleteAIGoal(def_obj3_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("ccp0")

end




function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 2)
StartTimer(beginobjectivestimer)
end

function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)

objectiveSequence:Start()

end
is there something else I have to add or do?
Last edited by fiddler_on_the_roof on Fri Aug 06, 2010 8:07 am, edited 2 times in total.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: kill and respawnobject problems

Post by lucasfart »

Is that the props actual name, in terms of the spawn points, or is it just the odf's name you're referencing? Also, try changing the dash in cpp1-1 to an underscore ccp1_1. It might be getting confused by the dash. It might do nothing, but its worth a try. :wink:
fiddler_on_the_roof
1st Lieutenant
1st Lieutenant
Posts: 460
Joined: Wed Nov 12, 2008 5:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: kill and respawnobject problems

Post by fiddler_on_the_roof »

lucasfart wrote:Is that the props actual name, in terms of the spawn points, or is it just the odf's name you're referencing? Also, try changing the dash in cpp1-1 to an underscore ccp1_1. It might be getting confused by the dash. It might do nothing, but its worth a try. :wink:
that is the props name in ze. the cp was named ccp1 before i added the - to see if renaming worked.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: kill and respawnobject problems

Post by lucasfart »

Thats the only thing i can think of, so unless somebody else can help, I'm afraid you're out of luck.
fiddler_on_the_roof
1st Lieutenant
1st Lieutenant
Posts: 460
Joined: Wed Nov 12, 2008 5:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: kill and respawnobject problems

Post by fiddler_on_the_roof »

oh, yay, i solved it. the respawnobject was in the wrong place... :?

--can be locked--
Post Reply