Start Objectives problem!

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
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

Start Objectives problem!

Post by Redline »

I try to start my objective number 1, but all I do get is this:

Code: Select all

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `BeginObjectives' (a nil value)
stack traceback:
	(none): in function <(none):43>
And this is what I've got in my LUA. I've checked it with some campaign scripts but it's still the same.
Why is BeginObjectives a nil value?! =/ It does work in the developer campaign scripts too. :cpu:
In addition, the ewoks are just for my test.

LUA:
Hidden/Spoiler:
[code]function ScriptPostLoad()

EnableSPHeroRules()

KillObject("zombie1")
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil

timePop = CreateTimer("timePop")
SetTimerValue(timePop, 45.0)
StartTimer(timePop)
ShowTimer("timePop")

time = OnTimerElapse(
function(timer)
ShowTimer(nil)

--SetObjectTeam("zombie1", 3)
ShowMessageText("level.trd.wave1",ALL)
ShowMessageText("level.trd.wave1",IMP)
BeginObjectives() <--- Here it does stop
ReleaseTimerElapse(time)
DestroyTimer(timer)
end,
timePop

)
end
end)

--Objective Wave 1, Kill the 50 Zombies

Objective1 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.trd.wave1", popupText = "level.trd.wave1", AIGoalWeight = 0}

Zombie = TargetType:New{classname = "ewk_inf_repair", killLimit = 50}

Objective1:AddTarget(Zombie)

Objective1.OnStart = function(self)
RespawnObject("zombie1")
Ambush("zombie1", 50, 0.5)
zombie_goal = AddAIGoal(50, "Defend", 100, "cp1","cp2")
AddAIGoal(ATT, "Deathmatch", 99999)
AddAIGoal(ATT, "Deathmatch", 99999)
end

Objective1.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(scouts_goal)

end
end
[/code]
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Start Objectives problem!

Post by AQT »

You need this section in the end:

Code: Select all

    function StartObjectives() 
      objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4.0 }
       objectiveSequence:AddObjectiveSet(Objective1)
       objectiveSequence:Start()
end
This is how BeginObjectives knows which objectives to use. Every time you add a new objective, you have to list it there.
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

Re: Start Objectives problem!

Post by Redline »

Thx, me idiot. I didn't notice this. Thanks a lot.
Post Reply