Page 1 of 2
Ground map questions
Posted: Sun Apr 16, 2006 3:36 pm
by Tohron
I am in the process of making a map where the republic is attacking a CIS city/fortress using ATTEs, tanks, and LAAT transports. However, I have encountered several problems. First of all, I have been unable to spawn any vehicles on the map, despite attempting to follow the instructions in the documentation. Could a member list all of the various requirements needed for a vehicle spawn point to work?
In addition, I have been unable to place any turrents on the map and have them show up when I play it. What do you need to do to place them properly?
Finally, there seems to be some sort of upper-height limit that prevents units from reaching the upper portion of the city. Whenever they try to go above it, by walking or jumping, they seem to get "teleported" back down a bit. What is going on, and how do I increase the 'height limit'?
RE: Ground map questions
Posted: Sun Apr 16, 2006 3:43 pm
by [RDH]Zerted
You need to make sure you've set a memory pool for the turrets.
To increase the level height, change the following lines in your lua:
SetMaxFlyHeight(200)
SetMaxPlayerFlyHeight (200)
Put in a higher number for a higher ceilling.
Posted: Sun Apr 16, 2006 3:48 pm
by -_-
To Spawn Vehicles:
1. Vehicle must be loaded in your .lua
2. Have spawn path in .wld file on your conquest layer and setted up correctly
3. Memorypools
I'll try and do a more detailed guide later.
Re: RE: Ground map questions
Posted: Sun Apr 16, 2006 3:48 pm
by Tohron
[RDH]Zerted wrote:You need to make sure you've set a memory pool for the turrets.
To increase the level height, change the following lines in your lua:
SetMaxFlyHeight(200)
SetMaxPlayerFlyHeight (200)
Put in a higher number for a higher ceilling.
What exactly is a memory pool, and how do you go about setting one?
And for the level height, what is the location and name of the lua file you mentioned? If it is a long list of code, where exactly are those values in it? (aka, halfway down, ect.)
Posted: Sun Apr 16, 2006 3:52 pm
by Tohron
-_- wrote:To Spawn Vehicles:
1. Vehicle must be loaded in your .lua
2. Have spawn path in .wld file on your conquest layer and setted up correctly
3. Memorypools
I'll try and do a more detailed guide later.
Is the spawn path the same one used to spawn infantry. If not, what should the spawn path be titled? (or am I just getting confused and you are thinking of the vehicle spawn object?)
Where is the lua file you load your vehicle into, and could you, say, give a code example for the hailfire droid? (cis_tread_hailfire)
Posted: Sun Apr 16, 2006 4:07 pm
by -_-
Okay, let's start off nice and easy and see if my teaching skillz got any worse

..
First of all, you want to load the Hailfire in your .lua file.
ReadDataFile("SIDE\\cis.lvl",
"cis_tread_hailfire")
Since the Hailfire is classified as a "hover" vehicle, you would need to add this into your lua.
SetMemoryPoolSize ("EntityHover",1) -- add one for every "hover" vehicle
Now, to set it in your .wld file. Vehicles do not spawn the same ways as infantry do. You would need to open you .wld in zeroeditor, and load the conquest layer. Go to the Objects tab, and pick this object following this directory.
C:\BF2_ModTools\data_modid\Common\odfs
Then select com_item_vehicle_spawn, and place it onto the map. Now that you have the spawn placed, you will need to set it up. You'll need to attach it to a CP. By default, CP2 and CP4 are aligned to the CIS. SO in the first slot that saids Control Zone, type in either CP2 or CP4.
By .lua, CIS is assigned as the defending team. In your spawn, page DN and you'll see a slot named ClassCISDef, there, type in cis_tread_hailfire. Save your map and munge, and it should work.

Posted: Sun Apr 16, 2006 4:07 pm
by jkempster
in common were u find health and ammo droids find com_item_vehiclespawn.
place this on the CONQUEST layer.
to do this at the top where it says layer click change then click conquest.
when u place the spawn it will be a grey arrow.
on the right then a box will come up.
for the top box put in what cp u want it to spawn at.
then click page down and for classrepatk enter rep_hover_barcspeeder.
i chose barc speeder as it is in the scripts already. if u want say a tank for republic
then go onto assets/sides/rep and open rep.req. here u see a list of republic stuff.
u will see here rep_hover_fightertank.
so go to data_***/common/scripts/***/then open the ***c_con.
scroll down to ReadDataFile and put in "rep_hover_fightertank" so it fits into the list
with the rest of them.
this works for all vehicles accept walkers i believe.
so just repeat the process
for all sides.
Posted: Sun Apr 16, 2006 6:04 pm
by Tohron
Sigh....
I don't want to sound demanding, but can someone please tell me where to find the .lua file(s) that are being referred to? I can't modify anything if I don't know what I'm supposed to be modifying, or where to find it.
Also, how do I set which team is attacking and which is defending? What are the differences for placing mobile command post vehicles, if any? Turrents?
Posted: Sun Apr 16, 2006 6:21 pm
by -_-
C:\BF2_ModTools\data_modid\Common\scripts\datamodid
Posted: Sun Apr 16, 2006 6:49 pm
by Tohron
-_- wrote:C:\BF2_ModTools\data_modid\Common\scripts\datamodid
Thanks for the help, but either something is wrong with my mod tools, or I am not getting something. First, the ID of my mod world is TOR. I went to C:\BF2_ModTools\data_TOR\Common\scripts , and I then looked for a .lua file named dataTOR. It did not exist. Am I doing anything wrong?
Posted: Sun Apr 16, 2006 6:51 pm
by Penguin
look for TORc_con.lua
Posted: Sun Apr 16, 2006 6:52 pm
by -_-
Tohron wrote:-_- wrote:C:\BF2_ModTools\data_modid\Common\scripts\datamodid
Thanks for the help, but either something is wrong with my mod tools, or I am not getting something. First, the ID of my mod world is TOR. I went to C:\BF2_ModTools\data_TOR\Common\scripts , and I then looked for a .lua file named dataTOR. It did not exist. Am I doing anything wrong?
C:\BF2_ModTools\data_TOR\Common\scripts\TOR

Posted: Sun Apr 16, 2006 7:03 pm
by Tohron
Thanks, I just realized my mistake both from here and the thread I made for space. I've found the data for maximum height, and think I have figured out how to add vehicles as available units, but I will still need an explanation on how to create memory pools for turrents.
Posted: Sun Apr 16, 2006 7:15 pm
by -_-
SetMemoryPoolSize("MountedTurret", 15)
Posted: Sun Apr 16, 2006 7:39 pm
by Tohron
-_- wrote:SetMemoryPoolSize("MountedTurret", 15)
Is that just for one certain type of turrent, or does that encompass all types (including sonic turrents, dish turrents, ect.) If not, do you replace that with the individual turrent name?
Also, I didn't get this completely from last time, does the 15 there mean that you could place at most 15 'mounted turrents' and have them show up?
Also, to add the turrent directly, do you simply place them as objects?
Posted: Sun Apr 16, 2006 8:23 pm
by -_-
That works for all of them. I'm not sure what the number does ._. And yes, you put them as objects

Posted: Tue Apr 18, 2006 6:09 pm
by Tohron
OK, today I just realized that there are 2 files describing CW conquest, a LUA file and a BAK file, which might explain why my max height modifications are not working. After looking at the documentation for various things, I modified both files to attempt to incorporate my 2 dish turrents, two remote rocket turrents, 1 hailfire droid, 3 republic fighter tanks, two atte's, and the two command posts I added, as well as modifications to the max heights. Now the level crashes during the loading screen. I am posting the relevant sections from each file; since I am rather new at this, could someone take a look to see where I am messing up?
EDIT: I've deleted the BAK code since that's just backup.
From the LUA file:
-- 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"}
cp6 = CommandPost:New{name = "cp6"}
--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:AddCommandPost(cp6)
conquest:Start()
EnableSPHeroRules()
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()
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(200)
SetMaxPlayerFlyHeight (200)
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("sound\\yav.lvl;yav1cw")
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_hover_fightertank",
"rep_hero_anakin",
"rep_walk_atte",
"rep_hover_fightertank",
"rep_hover_barcspeeder")
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",
"cis_tread_hailfire",
"cis_hover_aat")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_guided_rocket",
"tur_bldg_hoth_dishturrent",
"tur_bldg_tower")
SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},
},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
}
SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_anakin")
-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
AddWalkerType(3, 0) -- 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", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize("MountedTurret", 15)
SetMemoryPoolSize("MountedTurret", 15)
SetMemoryPoolSize("MountedTurret", 15)
SetMemoryPoolSize("MountedTurret", 15)
SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:TOR\\TOR.lvl", "TOR_conquest")
ReadDataFile("dc:TOR\\TOR.lvl", "TOR_conquest")
SetDenseEnvironment("false")
I know this is hard to look through, but I don't think I know enough to debug it myself. If anyone can do this, thanks.
Posted: Tue Apr 18, 2006 7:10 pm
by Penguin
the .bak file is short for backup, when ever you munge it creates a .bak file from the lua.
Posted: Wed Apr 19, 2006 9:08 am
by Tohron
Well, if nobody is willing to look through thay, could someone at least answer these questions?
Is the Remote Rocket turrent obsolete or something? This was one of the first reasons I thought of for why my level crashed on the loading screen.
Do you add a leg configuration section to the memorypools for every walking vehicle you have?
Sigh... this really would work so much better if someone looked through that code... if anyone does, they should remember to highlight it because I might have made a spacing error.
Posted: Wed Apr 19, 2006 9:22 am
by Stager00
I dont know for sure if it causing your crashes...but you have alot of multiple-entries in your .lua ( SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize ("EntityHover",1)
SetMemoryPoolSize ("EntityHover",1)
Theres no reason for the redundancy. instead of 4 seperate entries...just increase the nuber from 1 to 4 ("EntityHover",4)