Page 1 of 1
New CPs cannot be captured [Solved]
Posted: Sun Aug 29, 2010 7:13 pm
by RIPJimmy
I am a new modder and when I tried putting a new command post onto the default map (the one you get after munging), the new cp could not be captured. I gave the proper names to all of the regions, spawn paths, and objects, as well as did the proper scripting so that the command post itself will count towards the amount of captured cps, and yet the command post still will not work. I checked the forums and FAQ to see if anything regarding this was there, but I could not find any.
What exactly must I do to fix this?
Re: New CPs cannot be captured
Posted: Mon Aug 30, 2010 5:11 am
by lucasfart
Did you remember to type the right name of the capture region into your cp's settings? Also, make sure the region is on the same layer as the cp, otherwise it won't work.
Re: New CPs cannot be captured
Posted: Mon Aug 30, 2010 12:59 pm
by RIPJimmy
The capture region is the right name (cp5_capture), and I did everything in the conquest layer.
Also, on a minor note, how do I undo and/or delete certain things?
Re: New CPs cannot be captured
Posted: Mon Aug 30, 2010 1:01 pm
by Fiodis
Ctrl z to undo, select and then hit the delete key to delete most things.
As for the capture problem, triple-check the capture region's name, label, and the cp's capture region in its properties box. Make sure they are all the same thing, and the same case letters (in ZE upper and lower-case look somewhat similar). If that's all in accordance, post your LUA.
Re: New CPs cannot be captured
Posted: Mon Aug 30, 2010 2:05 pm
by RIPJimmy
I added the proper names to the command post itself (I forgot to do that) and what regions correspond with it three times, and it still does not work.
Here is my LUA script for GCW conquest
Code: Select all
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
--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"}
--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}
--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:Start()
EnableSPHeroRules()
end
This is the LUA for Clone conquest
Code: Select all
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
--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"}
--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}
--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:Start()
EnableSPHeroRules()
end
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 2:26 am
by lucasfart
This error has nothing to do with your cp's, although as a last resort you could try changing the capture region using the following code in your lua.
Code: Select all
SetClassProperty("cp_name_here", CaptureRegion, "capture_region_name_here")
I'm unsure if i put all the quotes in the right places, but that should work if nothing else does.
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 10:09 am
by Fiodis
I think it may be
Code: Select all
SetClassProperty(cp#, "CaptureRegion", "name_of_capture_region")
but I'm also not 100% sure.
Anyway, Jimmy, post your error log. Sorry, we should have asked for that long before now.
(On a note, it's always best to provide the log yourself without being asked.)
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 10:42 am
by RIPJimmy
Where do I put the code in the lua?
Also, what is the error log called?
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 11:08 am
by DarthD.U.C.K.
the errorlog is created by the modtools.exe when you run your map with it, more informations about it cna be found in the everythingyouneedthread
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 11:18 am
by linksith
I made my own test map to see what could be wrong but I think that the mod tools did not find any region due to mis-spelling or putting the name in the wrong field (field being a typing box), and when you type something make sure the capitalization is the same.
Make sure you put the name of the region into the class properties box or it will not work (I put it in both just to be sure).
Also, just to be on the safe side, make sure you sink the region into the ground.
The mod tools is a nice thing to finding problems. You can find out how to get them to work in the
FAQ thread (it is the fourth question). Once you run the tools open your map like you would in bf2. When you're done, you can go to the C:\ProgramFiles\LucasArts\Star Wars Battlefront II\gamedata folder and your error log will be there.
NOTE: The underlined FAQ is a link.
EDIT: By the way, I believe your LUA is fine.
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 12:14 pm
by RIPJimmy
Ok, I added the region name to the class properties and it can now be captured!
The only problem now is that I can't capture one of the cps but the AI can. Also, I am not 100% if the spawn is working for my new command post, but that could be because I wasn't paying attention.
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 1:17 pm
by linksith
Ok, there are two documents you can use to make cps and other necessary things. They stay pretty basic for the basic things so these things should help you a lot.
There are the documents that come with the mod tools from when you install them, and then there is one of Fierfek's Battlefront guides you can get from
here.
You can get to the mod tools documentation by going to "Start, All Programs, Lucas Arts, Star Wars Battlefront 2, Mod Tools", or just by looking at the picture
Re: New CPs cannot be captured
Posted: Tue Aug 31, 2010 5:56 pm
by RIPJimmy
Ok, I just discovered the solution to the cp capturing problem. I had the region in the wrong place.
And that tutorial you showed me (not the one that came with the editor) looks fantastic. I will definitely use it to help make my map better.
Ok, this problem is solved. The Moderators can make it like that in the topic now.