Page 1 of 1

couple of questions i really need help with

Posted: Sat Jan 05, 2008 5:24 pm
by wishihadaname
1) how do i get custom units to appear in game

2) how do i get custom vehicles to spawn

3) how do i edit vehicle odfs and get them to work in game

Re: couple of questions i really need help with

Posted: Sat Jan 05, 2008 9:23 pm
by Teancum
Best to start by reading the Complete "How-To" Tutorial Thread at the top of this forum.

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 5:32 am
by PoRCH WooKIE
if you are referring to the custom vehicles from phycofreds archive, most of those are set up so its mostly just a matter of copy and paste then a little editing in the lua

lets say for example you want to add the CIS HAG (available From phycofreds archive)

open BFBuilder Pro open your project, click on sides and create a new side. To keep it simple we will call this side CISHAG. so fill in CISHAG in Side ID the click create. click ok ok ok. now close bfbuilder, and open C:\BFBuilder\Data"YOUR-PROJECT"\Sides\CISHAG
and open the CISHAG_Alpha_032107 rar file (you downloaded from phycofred's archive)

Take all the files out of the CISHAG_Alpha_032107 rar file (except for the HAGReadMe.txt file - you wont need that) and paste all those files into the C:\BFBuilder\Data"YOUR-PROJECT"\Sides\CISHAG
yes overwrite existing files.
ok close up all that business.

That part is over

ok open bfbuilder Pro again and click edit then click gcw mission lua (we will just do GCW so you have idea, get you started) - yes... we are giving the cis vehicle to alliance.
Find the lines:

-- Start sidelvls
ReadDataFile("SIDE\\all.lvl",
"all_inf_basicdesert",
"all_inf_lukeskywalker",
"all_inf_smuggler");
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_basic_tie",
"imp_inf_darthvader",
"imp_inf_dark_trooper");
--end sidelvls

you have to tell your project to call your new vehicle and from where so add this:

ReadDataFile("dc:SIDE\\CISHAG.lvl");

under the "all_inf_smuggler"); line (if you want alliance to have the vehicle) notice the dc: in front of side... that tells the projects its downloaded content

so now it will look like this

-- Start sidelvls
ReadDataFile("SIDE\\all.lvl",
"all_inf_basicdesert",
"all_inf_lukeskywalker",
"all_inf_smuggler");
ReadDataFile("dc:SIDE\\CISHAG.lvl");
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_basic_tie",
"imp_inf_darthvader",
"imp_inf_dark_trooper");
--end sidelvls


scroll down more to the memory pool section, you have to tell the project what type of vehicle it is and how many,
cis hag is a hover vehicle.
so somewhere between where it says --start memory pools and --end memory pools
add this line:

SetMemoryPoolSize("EntityHover", 2)

the 2 is just random, here you put how many of this type of vehicle are going to be in the map (in the case hover vehicles). so it might look like this

--start memorypools
ClearWalkers()
SetMemoryPoolSize("EntityWalker", 3)
AddWalkerType(0, 0)-- 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, 8) -- 8 attes with 3 leg pairs each
SetMemoryPoolSize("CommandWalker", 8)
SetMemoryPoolSize("WalkerBlendUnit", 200)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
SetMemoryPoolSize("EntityHover", 2)
--end memorypools

save and exit.

That is how you add new / custom vehicles to your project. Do it the same for each new type of vehicle being added to the project. To put the vehicle in the game / map (in zeroedit) you now just follow the usual way to add a vehicle. if you dont know how here is some help from majin ravin



How to Add Vehicles to Your Map for SWBF
Author: Majin Revan
Date Created: February 19th, 2005

This tutorial is for any beginning mapper on how to add vehicles to a map for SWBF. This tutorial will not include how to modify vehicles for your map. Let’s get started:
1. Run BFBuilder (found in the main folder of the mod tools, HTML type application) and create a new project. Name it whatever you would like to name it. Let’s use the name Test1 for this tutorial.
2. When it is done, make sure your mod is loaded in BFBuilder. Click on Edit Test1 and wait for Zeroedit to load. When it loads, if a prompt comes up, hit “I Agree.”
3. Terrain implementation shall not be explained in this tutorial, so please choose Wire under the Terrain View: box on the toolbar. After that, choose Object under the Edit Mode: panel on the toolbar.
4. Make sure the Action in the Edit Object: panel is set to Place. Browse for com_item_vehicle_spawn.odf in DataTest1\Common\ODFs. Once you find it, select it and place it near the command post that you want it to spawn for.
5. Choose Select under Action and in the Object Instance panel fill in the correct name of the ControlZone. The name of the ControlZone is the name of the command post that you are setting the vehicle for. To find out that name, select the command post object and find out. If it is CP1, type that into the ControlZone area in the Object Instance panel for your vehicle spawn. Modify the numbers of the other entities if wanted.
6. If you have your attacking army is set as the Rebel Alliance or the CIS (default set up), enter in the spawn name of the vehicle in the correct box. So, if it is set to default armies, CP1 is set as attacking. If you are adding a vehicle to the CP1 ControlZone, you will need to type in the spawn names for the vehicles in ClassAllATK and ClassCISATK. The spawn names of those vehicles can be found in Assets\Sides\CIS\cis.req or Assets\Sides\ALL\all.req. If you want to spawn an Alliance Combat Speeder, you would type all_hover_combatspeeder in the box under ClassAllATK in the Object Instance panel. Make sure you type in values for what the vehicles are for the opposing teams if the base is captured. If you only want certain armies to have vehicles for a certain base, do not enter the vehicle spawn name of the other armies
7. Add any other vehicles that you would like to add. All vehicles are added the same way, no exceptions. Make sure that you are typing in the vehicle in the correct Class___ATK or Class___DEF areas. The Galactic Empire and the Galactic Republic are set as defending armies by default. That means that side 2 is for defending and side 1 is for attacking. Hence, CP2 is a defending command post by default. You can change which command post is for what team under the Team area in the Object Edit: panel for a command post. The value of 3 is locals, and the value of 0 is neutral.
8. Save your map. You must overwrite the file DataTest1\Worlds\Test1\World1\Test1.wld when saving. Exit Zeroedit.
9. In BFBuilder, choose Edit and choose the GCW Era Mission LUA or the CW Era Mission LUA option accordingly.
10. If you choose GCW Era Mission LUA, look under the file for the line ReadDataFile("SIDE\\all.lvl",. If you had added the Alliance Combat Speeder to your map, you must type "all_hover_combatspeeder", under "all_inf_basicdesert",. Now, scroll down until you can see the following lines:
-- Level Stats
ClearWalkers()
AddWalkerType(0, 0)
-- AddWalkerType(1, 4)
AddWalkerType(2, 0)
--SetMemoryPoolSize("EntityHover", 12)
--SetMemoryPoolSize("EntityFlyer", 5)
-- SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
-- SetMemoryPoolSize("EntityTauntaun", 0)
-- SetMemoryPoolSize("MountedTurret", 22)
SetMemoryPoolSize("PowerupItem", 60)
-- SetMemoryPoolSize("SoundSpaceRegion", 85)
SetMemoryPoolSize("EntityMine", 40)
--SetMemoryPoolSize("Aimer", 200)
-- SetMemoryPoolSize("Obstacle", 725)
--SetMemoryPoolSize("EntityLight", 150)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:Test1\\Test1.lvl")
SetDenseEnvironment("false")
--AddDeathRegion("Sarlac01")
-- SetMaxFlyHeight(90)
-- SetMaxPlayerFlyHeight(90)
11. You must remove the “--“ (comment outs) before the SetMemoryPoolSize("EntityHover", 12) line. You may change the number at the end of the line to accommodate for the amount of this type of vehicle in your map. Make sure you uncomment the lines for flying vehicles if you have those in your map. As for large walkers such as the AT-AT and the AT-TE, this area might look a bit like my Naboo: Encounter (Version 2.0)’s GCW Era Mission LUA, here:
-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -4)
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(2, 4) -- 4 atats with 2 leg pairs each
AddWalkerType(1, 14)
SetMemoryPoolSize("CommandWalker", 4)
SetMemoryPoolSize("WalkerBlendUnit", 200)
SetMemoryPoolSize("EntityHover", 20)
SetMemoryPoolSize("EntityFlyer", 20)
SetMemoryPoolSize("EntityCarrier", 10)
-- SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
-- SetMemoryPoolSize("MountedTurret", 100)
SetMemoryPoolSize("PowerupItem", 60)
-- SetMemoryPoolSize("SoundSpaceRegion", 85)
SetMemoryPoolSize("EntityMine", 40)
SetMemoryPoolSize("Aimer", 160)
-- SetMemoryPoolSize("Obstacle", 725)
--SetMemoryPoolSize("EntityLight", 150)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:Nab3\\Nab3.lvl")
SetDenseEnvironment("false")
--AddDeathRegion("Sarlac01")
-- SetMaxFlyHeight(90)
-- SetMaxPlayerFlyHeight(90)

12. You would need all of those walker lines. The MTT would use “CommandHover” instead of “CommandWalker” though. If you want to add an MTT to your map, this part of your file for the CW Era might look a bit like my Naboo: Encounter (Version 2.0)’s CW Era Mission LUA, here:
-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -4)
AddWalkerType(0, 8) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(2, 2) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 4) -- 4 attes with 3 leg pairs each
AddWalkerType(1, 4)
SetMemoryPoolSize("WalkerBlendUnit", 200)
SetMemoryPoolSize("CommandHover", 6)
SetMemoryPoolSize("CommandWalker", 4)
SetMemoryPoolSize("EntityHover", 20)
SetMemoryPoolSize("EntityFlyer", 20)
SetMemoryPoolSize("EntityCarrier", 10)
-- SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
-- SetMemoryPoolSize("MountedTurret", 100)
-- SetMemoryPoolSize("SoundSpaceRegion", 81)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
SetMemoryPoolSize("Aimer", 160)
SetMemoryPoolSize("Obstacle", 725)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:Nab3\\Nab3.lvl")
SetDenseEnvironment("true")
--AddDeathRegion("Sarlac01")
--SetMaxFlyHeight(90)
--SetMaxPlayerFlyHeight(90)

13. Now, save the files. Choose Clean Test1 and then Munge Test1. When you are all done, copy the folder in BFBuilder\AddOn into the SWBF game add-on folder Program Files\LucasArts\Star Wars Battlefront\GameData\AddOn.

Now that’s it! Play the game and test it out! Any added vehicles should spawn. Now you can make maps with many vehicles! You are one step closer to becoming a better mapper. Help others that need help with this as well!

(Note: This tutorial may have resemblances to Saturn_V_SWBF’s tutorial thread on Want to add a Vehicle to your map? Here's how.... It is not a copy of his thread, but a more thorough tutorial, released for many to read, in an easy format to read. I did not look at what he had typed and copied any of it, save maybe one directory line. This is completely original. His thread was used to check to see if I had left out anything.)

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 1:34 pm
by wishihadaname
ok well i got how to add vehicles from psycos website thank you :bowdown: but i still don't get how to get my arcsquad side to spawn i mean i imported the republic side and modded the odfs then i imported cis and then here is the troop section of my lua for referance. the game crashes at the loading screen and im not shure what to do. also i think this side will not work with the regular maps either because it won't let me overwrite the current files hte the rep file i have to make new once like rep_inf_arc_commando who is my attempt to rezerect the clone commander problem is it won't let me save the file as clone commander so i have to change the name. is there any way to get around that?

function ScriptInit()
local CIS = 2
local REP = 1
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(REP,"red", "level.gfs1.objectives.1");
AddMissionObjective(REP,"orange", "level.gfs1.objectives.2");
AddMissionObjective(REP,"orange", "level.gfs1.objectives.3");
AddMissionObjective(CIS,"red", "level.gfs1.objectives.1");
AddMissionObjective(CIS,"orange", "level.gfs1.objectives.2");
AddMissionObjective(CIS,"orange","level.gfs1.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("sound\\tat.lvl;tat1cw");
--end soundlvl

-- Start sidelvls
ReadDataFile("SIDE\\cis.lvl",
"cis_hover_mtt",
"cis_hover_aat",
"cis_fly_maf",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
ReadDataFile("SIDE\\rep.lvl",
"rep_fly_jedifighter",
"rep_inf_arc",
"rep_inf_macewindu",
"rep_inf_jet_trooper");
ReadDataFile("dc:SIDE\\kwing.lvl",
"all_fly_kwing");
ReadDataFile("dc:SIDE\\light_combat_speeder",
"com_hover_light_attack_speeder");
ReadDataFile("dc:SIDE\\atxt_beta",
"rep_walk_atxt");
--end sidelvls
--start loadouts
SetTeamName(CIS, "CIS")
SetTeamIcon(CIS, "cis_icon")
AddUnitClass(CIS, "cis_inf_battledroid",10)
AddUnitClass(CIS, "cis_inf_assault",1)
AddUnitClass(CIS, "cis_inf_pilotdroid",2)
AddUnitClass(CIS, "cis_inf_assassindroid",2)
AddUnitClass(CIS, "cis_inf_droideka",1)
SetHeroClass(CIS, "cis_inf_countdooku")
SetTeamName(REP, "Republic")
SetTeamIcon(REP, "rep_icon")
AddUnitClass(REP, "rep_inf_arc_trooper2",10)
AddUnitClass(REP, "rep_inf_arc_trooper1",1)
AddUnitClass(REP, "rep_inf_clone_pilot",2)
AddUnitClass(REP, "rep_inf_arc_scout",2)
AddUnitClass(REP, "rep_inf_arc_commando",1)
SetHeroClass(REP, "rep_inf_macewindu")
--end loadouts
--start teamstats
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 2000)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 2000)
--end teamstats
--start alliances
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);
--end alliances

--start memorypools
ClearWalkers()
AddWalkerType(0, 10)-- special -> droidekas
AddWalkerType(1, 4)-- 1x2 (1 pair of legs)
AddWalkerType(2, 0)-- 2x2 (2 pairs of legs)
AddWalkerType(3, 0)-- 3x2 (3 pairs of legs)
SetMemoryPoolSize("PowerupItem", 25)
SetMemoryPoolSize("EntityMine", 40)
SetMemoryPoolSize("EntityHover", 30)
SetMemoryPoolSize("CommandHover", 3)
SetMemoryPoolSize("EntityFlyer", 15)
SetMemoryPoolSize("MountedTurret", 50)
SetMemoryPoolSize("Aimer", 200)
--end memorypools
--start worldlvl
ReadDataFile("dc:gfs1\\gfs1.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start flyheight
--end flyheight
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("true")
--end denseenvironment
--start birdsandfish
--end birdsandfish
--start deathregions
--end deathregions

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 2:17 pm
by jedikiller32

Code: Select all

ReadDataFile("SIDE\\cis.lvl",
"cis_hover_mtt",
"cis_hover_aat",
"cis_fly_maf",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
ReadDataFile("SIDE\\rep.lvl",
"rep_fly_jedifighter",
"rep_inf_arc",
"rep_inf_macewindu",
"rep_inf_jet_trooper");
'

That needs to become:

Code: Select all

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_hover_mtt",
"cis_hover_aat",
"cis_fly_maf",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_fly_jedifighter",
"rep_inf_arc",
"rep_inf_macewindu",
"rep_inf_jet_trooper");
Also, these:

Code: Select all

ReadDataFile("dc:SIDE\\light_combat_speeder",
"com_hover_light_attack_speeder");
ReadDataFile("dc:SIDE\\atxt_beta",
"rep_walk_atxt");
need to be LVL files, so for example:

Code: Select all

ReadDataFile("dc:SIDE\\light_combat_speeder.lvl",
"com_hover_light_attack_speeder");
ReadDataFile("dc:SIDE\\atxt_beta.lvl",
"rep_walk_atxt");
I'm not really very good with custom sides, lol. So, if my advice helps, I'd be surprised.

Change those things and it should have a better chance at working.

Oh, as an afterthought- you may want to make sure your sides aren't crashing. So, modify the Republic ODF files, without changing the names of the ODF, and then munge. When munging is done, go to the BFBuilder AddOn folder, open your map's folder. Go into there, and you'll see a Data folder. Go in there, then go to _lvl_pc. In there, go to Sides. Your rep.lvl will be in there. Place it in the game's SIDE folder (I assume you know how to do that) and then boot up your game, and see if everything works the way it should. Then you can mess with the map and other things.

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 3:00 pm
by PoRCH WooKIE
I think this might be your problem actually (one that Nova was having before) because your lua looks fine to me
http://www.gametoast.com/forums/viewtop ... =1&t=11984

Ok, the first thing I would recommend is not to use the import Retail Sides feature of BFBuilderPro. What this does is import the whole of the side, including vehicles, weapons etc. This adds about 40Mb per side to your project and makes your munge times much longer than they need to be. Only ever import the stuff you actually want to change, it will keep your munge times low and your sanity intact . The way I do it is to Create a New Side for each unit. ***Saturn labs***

I used to use the Import retail Side feature on BFBuilder Pro because it made making mods quick and easy. l But Everytime used that feature for a map, my map crashed every time once I added a whole second side. Dont know why. So Adding one retail side is ok (although it makes your map huge), but adding a second (or Third) retail side seems to crash maps. This feature is good if you want to add a third faction to your map (like ewoks or gungans) as a third team; and/or to make quick and easy fun mods to play around with - as seen here http://www.gametoast.com/forums/viewtopic.php?t=2068.

If you insist on modding your sides in this way (importing retail side), mod the second side in a new project, munge it, then take the side lvl file out of C:\BFBuilder\AddOn\"YOUR-SECOND-MODDED-SIDE-PROJECT"\Data\_lvl_pc\Side\"YOUR-MODDED-SIDE"
and add that lvl file to your maps ADDon\Side folder once you project is done (or after each munge, whatever)

I think that maybe why your map is crashing.

This thread is almost sticky quality :D

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 3:18 pm
by wishihadaname
Ok hte second to last post by jedikiller, u wayed i need to change the files without changing the names. but it says the odfs are read only so i cannot savethem as they currently are idk how to get around this problem

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 3:31 pm
by PoRCH WooKIE
wishihadaname wrote:Ok THE second to last post by jedikiller, u Sayed i need to change the files without changing the names. but it says the odfs are read only so i cannot save them as they currently are idk how to get around this problem
go to C:\BFBuilder and right click on your project DATAyour-project
so right click on it, go to Properties, click the Read-Only box, Click OK. Now you can save changes to files in your project (like MSH and ODF files for example). You have to do this for each project or you cant save changes. Its the first thing i do when i start a project.

and killer is right you may be able to see if a particular side is crashing my adding the side lvl as a mod to the game and check. But i really think its adding more than one retail side

Re: couple of questions i really need help with

Posted: Sun Jan 06, 2008 8:46 pm
by NovaBlast
Wait, adding two retail sides to your map doesn't make it crash, you just need to follow extra steps (Which I dont know, but phsycofred says there is) to make it work, the reason why it is crashing is because you messed up in your LUA, but I can't say exactly what, because I have never been able to do it, only in mods. Soooo, I would go and ask someone who edited both sides what to do

Re: couple of questions i really need help with

Posted: Mon Jan 07, 2008 3:55 pm
by PoRCH WooKIE
Nova's right, there is a way; but no one left modding BF1 seems to know how exactly. keep trying things i guess.

Adding a new side for modded unit(s), and importing only what you need, is the best way to go though; and it will save you lots of headaches, shorten munge times, and make the download a reasonable size.

Re: couple of questions i really need help with

Posted: Tue Jan 08, 2008 12:52 am
by Laserblast
It should also go without saying that the most of the things on psych0fred's site are geared towards SWBF2. I have no idea what effect variables not native to SWBF1 will due if present in the ODFs.

P.S. What is this problem with retails sides? Crashes, freezes, witches turning people into newts?

Edit: You already stated it was a crash, so the wording was awful in this post. Just wondering, because I have created modified versions of the CIS, GEO, and REP sides and don't recall any major problems...