Thank you everyone at GT for helping me figure out how to campaign script, so far I only have 1 objective but at least it works.... sort of.... I'm preatty sure my coding is spot on, what i'm having a problem with is that for some reason my localizations are not showing up. I get a [null] popup for all of the text that I had entered into the localization tool, and it also appears that the game is not recognising my rally point region and can't find the arrow pointer thingy for the hud.
here are the relavant error messages
Hidden/Spoiler:
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2264)
ShowPopup() has been depricated. Please remove all references to it in code
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "victoryTimer" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "delayTimer" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "hud_objective_icon_circle" not found
Message Severity: 2
.\Source\ActiveRegion.cpp(186)
Region "rallypoint1" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2359)
Region "rallypoint1" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2359)
Region "rallypoint1" not found
and here is the mission chunk of my lua just in case I messed that up too
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 5)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 5}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:Start()
end
Sorry for being such a nub, its my first attempt at a campaign.
Re: Campaign scripting partial fail
Posted: Mon Jan 11, 2010 9:41 pm
by Fiodis
Perhaps you could toss in an AcitvateRegion prior to trying to stick a marker to it?
Re: Campaign scripting partial fail
Posted: Mon Jan 11, 2010 10:08 pm
by wishihadaname
I don't think that's the problem, i've looked at some examples of vanilla missions and they don't use that function before setting a goto objective. Also it doesn't help with getting my localizations working. IDK ill try it and report back in a bit.
edit1: I've looked through my lua and found this line right below the SetMemoryPool lines, what does it do and do I need to change it?
LPR_conquest corresponds to the game mode configured in ZE. The line is saying to load all level/layer data included in LPR_conquest. This is the line that actually loads your physical map.
You never give MapAddEntityMarker an object to put the marker on. Its first parameter is supposed to be the object you want it point at. Instead, you gave it hud_objective_icon_circle. Also, MapRemoveEntityMarker's parameter is supposed to be the object you're removing the marker from too.
Re: Campaign scripting partial fail
Posted: Mon Jan 11, 2010 10:33 pm
by wishihadaname
ohh.......... so if my region is located in the campaign layer then I need to add a line to tell the script to read the campaign layer of ZE too right?
Re: Campaign scripting partial fail
Posted: Mon Jan 11, 2010 10:54 pm
by bobfinkl
wishihadaname wrote:add a line to tell the script to read the campaign layer of ZE too right?
No, you can't load more than one layer like that at a time, you have to use either the campaign layer or conquest layer (I highly suggest the campaign layer).
Re: Campaign scripting partial fail
Posted: Tue Jan 12, 2010 1:10 am
by wishihadaname
Ok, thank you, I've got one last problem though. It seems that my localization tool has now been saving the localizations I made. Whats the differance between scopes and keys? I think I may have used them backwards. Because I added LPR as a scope under level and the added my messages and popups as keys under LPR. But when I save, exit out of the localizer and then open it again, everything except LPR is gone.
Re: Campaign scripting partial fail
Posted: Tue Jan 12, 2010 1:18 am
by Maveritchell
bobfinkl wrote:
wishihadaname wrote:add a line to tell the script to read the campaign layer of ZE too right?
No, you can't load more than one layer like that at a time, you have to use either the campaign layer or conquest layer (I highly suggest the campaign layer).
Gee shucks, that is funny, I am going to have to tell a couple of my working scripts that they need to stop working, because they shouldn't be.
Re: Campaign scripting partial fail
Posted: Tue Jan 12, 2010 7:54 am
by Fiodis
Don't you always load at least two (base and one mode) anyway (unless you set it up not to)?
Re: Campaign scripting partial fail
Posted: Tue Jan 12, 2010 12:40 pm
by [RDH]Zerted
No, one normally includes the base layer into the ZE configured game mode.
You can load multiple game modes. It's quite interesting to load an enclosed map into a space or land map. You can easily do that with the FakeConsole's code input command.
Re: Campaign scripting partial fail
Posted: Tue Jan 12, 2010 7:36 pm
by wishihadaname
Ok well I made a bit of a mistake when I placed objects. I played EVERYTHING into the conquest layer. Is there some way to make it so that campaign uses both the camapaign layer and the conquest layer? I intended the conquest to be a much smaller map then the campaign so I don't really want to just have the same layer for both game modes.
Re: Campaign scripting partial fail
Posted: Tue Jan 12, 2010 8:13 pm
by KnightsFan
I believe you can just add more layers into the ReadDataFile piece, using the same syntax as with units. I can't seem to find where I saw this, though, so it may not work...
So change
ReadDataFile("ABC\\ABC.lvl", "ABC_conquest")
to
ReadDataFile("ABC\\ABC.lvl", "ABC_conquest", "ABC_campaign")
or whatever your world/layers are named.
Re: Campaign scripting partial fail
Posted: Wed Jan 13, 2010 7:22 pm
by bobfinkl
Maveritchell wrote:Gee shucks, that is funny, I am going to have to tell a couple of my working scripts that they need to stop working, because they shouldn't be.
That gave me a good laugh, but a bit more on-topic, must be another one of the random unfixable bugs I've been getting recently.