Adding vehicles (FAQ)
Moderator: Moderators
Adding vehicles (FAQ)
Hi, I have a couple of questions regarding adding vehicles (getting started guide not helpful)
1. do you need to add the vehicle files to you odf (or other) file? when you are adding vehicles?
2. lets say i'm trying to add a speeder. what exactly do I need to type in when i add the vehicle object?
1. do you need to add the vehicle files to you odf (or other) file? when you are adding vehicles?
2. lets say i'm trying to add a speeder. what exactly do I need to type in when i add the vehicle object?
- elfie
- Field Commander
- Posts: 931
- Joined: Fri Jan 25, 2008 8:26 pm
- xbox live or psn: no live
- Location: Coruscant, Jedi Temple
- Contact:
Re: adding vehicles
make sure when you are adding vehicles that the vehicles are on your lua. That is in data_ABC/common/scripts. So if you wanted to add multiple vehicles in a mpa your lua should look like this
Hidden/Spoiler:
-
- Hoth Battle Chief
- Posts: 3132
- Joined: Sun Dec 09, 2007 11:45 pm
- Projects :: No Mod project currently.
- Location: A Certain Box Canyon
Re: adding vehicles
In common odf there is a thing called something vech_spawns.. put that in, type in what you want to spawn in character type on the right (or the first box) and then put it in the .ua
Re: adding vehicles
thanks. just to clarify it a bit, what exactly do I need to do to put just a couple of speeders on a map?
- Eagle Eye
- First Lance Corporal
- Posts: 129
- Joined: Thu Nov 01, 2007 12:44 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Belgium
- Contact:
Re: adding vehicles
I wrote a little tut for you:
NOTE: This tutorial is only for adding shipped vehicles from the assets and not from custom sides
1. Open your map in ZE
2. click on the Object tab under Edit mode
3. open the "com_item_vehicle_spawn.odf" under data_modID/common/odfs/com_item_vehicle_spawn.odf
4. place the vehicle spawn object somewhere on your map and click on it.
5. now at the left side, you see somewhere under label "team", choose the team to which you want the vehicle to belong.
You can see what team the rep or cis is in the lua: (by example this is the c con lua:)
So if you want to place a vehicle for use by the rep team, you have to choose 1 in the team field.
6. NOTE: Control regions are optional, this step can be skipped.
Now, before we fill in the Object Instance box at the right side, we need to create the needed region for the vehicle:
Go to "region" in the edit mode and create a new box shaped region called (cp name)+_control. example: cp1_control. Also paste the same name into the Class Properties beside the region ID.
Place this region around the vehicle spawn.
Now click on the cp you chose(in the example: cp1) for which the vehicle belongs to. In the object instance box of this cp you should have the captureregion, controlregion, spawnpath...etc. We placed a control region for the vehicle so we will fill in the control region the name we gave to the region. cp1_control in the example.
7. Click on the vehicle spawn and you'll see on the right in the object instance box "controlzone". Fill in here only the name of the cp (ex: cp1).
Go back to your lua and look for the team you chose for the vehicle, the defending(DEF) or attacking(ATT) team.
So the rep is the attacking team and the cis is the defending team.
So go back to the object instance of the vehicle and go down in the box. If you choose now for example the rep team (ATT) go in the box looking for ClassRepATK. Fill in the name of the vehicle in this field.
In this tutorial we're gonna use vehicles from the assets.
So to find the name of a vehicle you want to use, go to:
BF2_ModTools\assets\sides\<the side you choose>\ in here open this side's req file(rep.req for my example). Now you see a whole list of items used in the side.
I will now choose the rep_fly_gunship_sc as my vehicle.
8. The last step you have to do is calling in the lua which vehicle you want to use.
Go to your lua script. I work with rep and cis in my example so i have to go in the c_con.lua script.
You will now see the following lines:
Now add the vehicle name in this line:
Do not forget to add the , if u place the vehicle after another name like in my example.
9) Munge the map and test!
Thats it! I hope this will help you and if someone found something wrong or a thing I forgot please post so i can update my tutorial!
NOTE: I'm dutch so i hope you can understand it
NOTE: This tutorial is only for adding shipped vehicles from the assets and not from custom sides
1. Open your map in ZE
2. click on the Object tab under Edit mode
3. open the "com_item_vehicle_spawn.odf" under data_modID/common/odfs/com_item_vehicle_spawn.odf
4. place the vehicle spawn object somewhere on your map and click on it.
5. now at the left side, you see somewhere under label "team", choose the team to which you want the vehicle to belong.
You can see what team the rep or cis is in the lua: (by example this is the c con lua:)
Hidden/Spoiler:
6. NOTE: Control regions are optional, this step can be skipped.
Now, before we fill in the Object Instance box at the right side, we need to create the needed region for the vehicle:
Go to "region" in the edit mode and create a new box shaped region called (cp name)+_control. example: cp1_control. Also paste the same name into the Class Properties beside the region ID.
Place this region around the vehicle spawn.
Now click on the cp you chose(in the example: cp1) for which the vehicle belongs to. In the object instance box of this cp you should have the captureregion, controlregion, spawnpath...etc. We placed a control region for the vehicle so we will fill in the control region the name we gave to the region. cp1_control in the example.
7. Click on the vehicle spawn and you'll see on the right in the object instance box "controlzone". Fill in here only the name of the cp (ex: cp1).
Go back to your lua and look for the team you chose for the vehicle, the defending(DEF) or attacking(ATT) team.
So the rep is the attacking team and the cis is the defending team.
Hidden/Spoiler:
In this tutorial we're gonna use vehicles from the assets.
So to find the name of a vehicle you want to use, go to:
BF2_ModTools\assets\sides\<the side you choose>\ in here open this side's req file(rep.req for my example). Now you see a whole list of items used in the side.
I will now choose the rep_fly_gunship_sc as my vehicle.
8. The last step you have to do is calling in the lua which vehicle you want to use.
Go to your lua script. I work with rep and cis in my example so i have to go in the c_con.lua script.
You will now see the following lines:
Hidden/Spoiler:
Hidden/Spoiler:
9) Munge the map and test!
Thats it! I hope this will help you and if someone found something wrong or a thing I forgot please post so i can update my tutorial!
NOTE: I'm dutch so i hope you can understand it
Re: adding vehicles
thanks a lot for the tutorial. I followed it, but no vehicles appeared on my map. do you need to move the vehicle files into your maps directory at all?
- Eagle Eye
- First Lance Corporal
- Posts: 129
- Joined: Thu Nov 01, 2007 12:44 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Belgium
- Contact:
Re: adding vehicles
If you take the name rep_fly_gunship_sc for example out of the rep req's folder, are you sure you placed the vehicle name under the right data lvl in the lua?inteletwiggy wrote:thanks a lot for the tutorial. I followed it, but no vehicles appeared on my map. do you need to move the vehicle files into your maps directory at all?
Hidden/Spoiler:
EDIT: maybe this is the problem: if you take an vehicle with legs, be sure you update these lines in lua:
Hidden/Spoiler:
Hidden/Spoiler:
Code: Select all
SetMemoryPoolSize("CommandWalker", x)
All command vehicles require a special memory pool in addition to the other steps for adding vehicles, for instance the MTT from SWBF1 is setup as a mobile CP so you would need to add this:
Code: Select all
SetMemoryPoolSize("CommandHover", x)
Code: Select all
SetMemoryPoolSize("CommandFlyer", x)
-
- Jedi
- Posts: 1056
- Joined: Fri Aug 14, 2009 12:32 am
Re: Adding vehicles [Solved]
i followed the tut but i get a fatal error?
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Adding vehicles [Solved]
You need to give us more details than that (and post your debug log)...
- AgentSmith_#27
- Rebel Warrant Officer
- Posts: 302
- Joined: Thu Feb 11, 2010 3:10 pm
- Projects :: No Projects I am ready to unveil
- xbox live or psn: No gamertag set
- Location: Zeroeditor
- Contact:
Re: Adding vehicles (FAQ)
I'm working on my first ever map (land) and atm I got a rep capital ship in the sky, with a cp in it and I managed to get anakin's star-fighter to spawn on board but when I try to enter it my pc crashes, so anyway here's my entire log from after running it with the modtools exe:
oh, I realize this is horribly long but as I said it's my first map so I have no idea what's important in here
oh, I realize this is horribly long but as I said it's my first map so I have no idea what's important in here
Hidden/Spoiler:
- Eggman
- Master Bounty Hunter
- Posts: 1516
- Joined: Mon Jul 16, 2007 1:30 pm
- Projects :: Battlefront Chronicles
- Location: Las Vegas
Re: Adding vehicles (FAQ)
You're missing the .odfs for the weapons. Copy them over to your side folder with the vehicle and you should be good to go.Message Severity: 3
.\Source\EntityFlyer.cpp(5594)
Flyer "rep_fly_anakinstarfighter_sc" weapon 1 "rep_weap_fly_anakin_cannon" not found
Message Severity: 3
.\Source\EntityFlyer.cpp(5594)
Flyer "rep_fly_anakinstarfighter_sc" weapon 2 "rep_weap_fly_anakin_missile" not found
A really helpful tip for finding things in your error log: the first you should do when you open it up is press ctrl + f and search for "Message Severity: 3" (without the quotes). That'll find any CTD causing errors 99% of the time.
-
- Jedi
- Posts: 1003
- Joined: Sun Mar 12, 2006 7:16 pm
- Projects :: Space - Boarding Action
- xbox live or psn: No gamertag set
Re: Adding vehicles (FAQ)
I'm not familiar with this one, but I'd infer that you should open ZE and ensure there is a region named "cp5_region" in your uber mode's layer, or the base layer.Message Severity: 3
.\Source\CommandPost.cpp(519)
Couldn't find CP spawn region "cp5_region" for uber mode
You're supposed to use the name of the CP in the ControlZone part of the vehicle spawn properties, which is covered in the Getting Started doc. Make sure you read the docs at least once.Message Severity: 3
.\Source\VehicleSpawn.cpp(135)
Vehicle spawn missing command post "cp5_control"
Make sure you've properly referenced the CPs in the lua.Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to index a nil value
stack traceback:
(none): in function `AddCommandPost'
(none): in function `ScriptPostLoad'
- AgentSmith_#27
- Rebel Warrant Officer
- Posts: 302
- Joined: Thu Feb 11, 2010 3:10 pm
- Projects :: No Projects I am ready to unveil
- xbox live or psn: No gamertag set
- Location: Zeroeditor
- Contact:
Re: Adding vehicles (FAQ)
New post edited into old post: Well apparently it didn't work, after all your tips I got it to work for a while then I did some more work, searched the log for severity 3 after it crashed, fixed those etc. And now it just crashed, all I have left are the Message severity: 2 problems that were always there
- hammythepig
- Master Sergeant
- Posts: 175
- Joined: Mon Nov 24, 2008 6:05 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Canada
Re: Adding vehicles (FAQ)
Eagle Eye, that tut saved my life. Thanks so much.
-
- Master Bounty Hunter
- Posts: 1519
- Joined: Fri Dec 18, 2009 8:02 am
- Projects :: CTF Arenas
- Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı
Re: Adding vehicles (FAQ)
(To AgentSmith)
It looks like you loaded your map twice?
It looks like you loaded your map twice?
- AgentSmith_#27
- Rebel Warrant Officer
- Posts: 302
- Joined: Thu Feb 11, 2010 3:10 pm
- Projects :: No Projects I am ready to unveil
- xbox live or psn: No gamertag set
- Location: Zeroeditor
- Contact:
Re: Adding vehicles (FAQ)
I don't even remember what the problem was but it's long since goneCressAlbane wrote:(To AgentSmith)
It looks like you loaded your map twice?
- skelltor
- Sith
- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: Adding vehicles (FAQ)
do you need zero editor working to add vehicles to stock maps? like thourgh lua editing if so what do i add in?
- DarthD.U.C.K.
- Master of the Force
- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Adding vehicles (FAQ)
when you understood the tutorial completely you will know
- skelltor
- Sith
- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: Adding vehicles (FAQ)
ok i reread the docs and from what i gathered you do need zero editor if that is correct how did arc commander and new ships in space?
- DarthD.U.C.K.
- Master of the Force
- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Adding vehicles (FAQ)
i meant the tutorial in this thread (but rereading the docs never hurst anyway)DarthD.U.C.K. wrote:when you understood the tutorial completely you will know