[Help] BF2 Modding

Making or wanting help making your own asset? Check in here
Post Reply
StevePl4y5
Posts: 385
Joined: 2014-02-02 14:33

[Help] BF2 Modding

Post by StevePl4y5 »

So, I'm trying to learn how to mod BF2, I already know a few basics and stuff, but clearly not enough. I'm creating this thread with a specific question, but I'll surely have a ton of other questions in the future, so I'll just use this thread to ask more questions later.

But right now, I have this. Yesterday, I felt like customizing my vBF2 a little bit, changed a few weapons on kits, changed a few map assets. And then I came across something I couldn't fix. I tried to replace the attack choppers on Dragon Valley with the scout helicopteres from Armored Fury (aka, booster pack 2) which files are located in "Booster Client" and "Booster Server", but when I loaded the map, the helipads were empty. I changed the file again and replaced the scout choppers with vBF2 trans choppers to make sure I was placing stuff in the right place, and it worked fine.

Tried to google it, found nothing. So, I now come to you guys. Hopefully you can help me.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Help] BF2 Modding

Post by Mats391 »

Can you post a bit more information? E.g. the spawner code you modified when it is not working.
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: [Help] BF2 Modding

Post by Moszeusz6Pl »

Did you add that zips to serverarchive.con and clientarchive.con in map folder?

Image
StevePl4y5
Posts: 385
Joined: 2014-02-02 14:33

Re: [Help] BF2 Modding

Post by StevePl4y5 »

I've modified the GamePlayObjects.con of Dragon_Valley, gpm_coop,16.
These are the lines I changed:
rem [ObjectSpawnerTemplate: CPNAME_DV_SP16_refinery_AttakHeli]
ObjectTemplate.create ObjectSpawner CPNAME_DV_SP16_refinery_AttakHeli
ObjectTemplate.activeSafe ObjectSpawner CPNAME_DV_SP16_refinery_AttakHeli
ObjectTemplate.modifiedByUser dgo
ObjectTemplate.isNotSaveable 1
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.setObjectTemplate 1 che_wz11
and
rem [ObjectSpawnerTemplate: CPNAME_DV_SP16_woodyard_AttakHeli]
ObjectTemplate.create ObjectSpawner CPNAME_DV_SP16_woodyard_AttakHeli
ObjectTemplate.activeSafe ObjectSpawner CPNAME_DV_SP16_woodyard_AttakHeli
ObjectTemplate.modifiedByUser dgo
ObjectTemplate.isNotSaveable 1
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.setObjectTemplate 2 she_littlebird
All I changed were the "ObjectTemplate.setObjectTemplate" lines. Like I said, I then replaced "che_wz11" with "chthe_z8" and "she_littlebird" with "usthe_uh60", to see if it would work, and it did. So I'm guessing the problem is in the Booster pack files?

"Booster_client.zip" and "Booster_server.zip" are already added by default on "serverarchive.con" and "clientarchive.con" in the bf2 folder. I'm not sure what you mean with map folder, I can't find those files in there.
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: [Help] BF2 Modding

Post by Moszeusz6Pl »

I though there was added to "serverarchive.con" and "clientarchive.con" in level folder, as minimods works. If it's in main one, it should work. Does any other object from booster work? You could try runing BF in debug mode, to see if you could get any error message about it.

Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Post by Mineral »

Yeah. Its very likely that the booster packs(at least those vehicles) aren't in the core build. You'll need to load them in with the archives.con stuff

Sent from my XT1052 using Tapatalk
Image
StevePl4y5
Posts: 385
Joined: 2014-02-02 14:33

Re: [Help] BF2 Modding

Post by StevePl4y5 »

Ok. So I tried to swap one of the Abrams in Op Road Rage (which is a Armored Fury map) with the Littlebird, and guess what. It spawned, AI got in it and everything, but when I tried to get in:

Image

EDIT:

Turns out, if there are no bots inside of the vehicle, I can use it. Still doesn't work on vBF2 maps tho.
Last edited by StevePl4y5 on 2014-07-25 15:55, edited 2 times in total.
Insanitypays
PR:BF2 Developer
Posts: 753
Joined: 2009-06-13 09:23

Re: [Help] BF2 Modding

Post by Insanitypays »

StevePl4y5 wrote:Turns out, if there are no bots inside of the vehicle, I can use it. Still doesn't work on vBF2 maps tho.
This is an easy fix. There's a bf2 sp64 pack for armored fury. Look that up.

It has updated ai files allowing bots to use all of the armored fury vehicles.

You just need to take the littlebird files from their zip and copy paste them over your own. That should work.

I don't remember for sure if they provide separate zips containing assets or if those are included in the map files... I'm sure you'll figure that out

"Go to Heaven for the climate, Hell for the company." -Mark Twain
[/CENTER]
Swishwash
Posts: 1
Joined: 2014-07-27 17:59

Post by Swishwash »

What map editor do you use to edit maps because I really want to make my own map?
StevePl4y5
Posts: 385
Joined: 2014-02-02 14:33

Re: [Help] BF2 Modding

Post by StevePl4y5 »

Thanks you a bunch Insanity, after some google searching I managed to find the BF2ALL64 mod, everything works great now.

Swishwash, we're not talking about making maps here, just changing the assets that spawn at already defined points in a map, which you can do with notepad. Map making is a whole other subject, but it should be fairly easy to find information on that, I'm sure there's a full blown thread about it in this section of the forums. I believe you need BF2 Editor.
UTurista
PR:BF2 Developer
Posts: 985
Joined: 2011-06-14 14:13

Re: [Help] BF2 Modding

Post by UTurista »

*A bit of thread hijack*

Can someone explains what makes a vehicle having a side? For example why is the challenger on the British side?

I've found 3 attributes

Code: Select all

ObjectTemplate.setObjectTemplate <int> <string>
ObjectTemplate.team <int>
ObjectTemplate.teamOnVehicle <int>
I've been using the first argument of .setObjectTemplate to determinate the side but in some levels, for example Bijar Canyons_CQ_16, every spawner has this attribute set twice with value 1 and 2 and rarely the spawners have the other two attributes.

If someone could explaining I would appreciate
Image


Dont question the wikipedia! Just because it reports different things on different languages does not make it unreliable source!
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Help] BF2 Modding

Post by Mats391 »

The thing is done in the ObjectSpawner with

Code: Select all

ObjectTemplate.setObjectTemplate <int> <string>
This defines what should spawn when the flag that this spawner belongs to it capped by a certain team. The integers are 0, 1 and 2. 0 is neutral, 1 opfor and 2 blufor. <string> is the template name of the vehicle to spawn

Code: Select all

ObjectTemplate.teamOnVehicle <int>
I think the int is rather a boolean. Iirc that defines if the object should spawn belonging to the team or as neutral.

Code: Select all

ObjectTemplate.team <int>
This is an alternative way to define which team the spawner belongs to w/o need of flags. The team numbers are same as above. You can also use

Code: Select all

Object.team <int>
when you create the actual spawner object.

In the vehicle you then should have

Code: Select all

ObjectTemplate.dontClearTeamOnExit <bool>
Else the vehicles will go back to neutral (team 0) when you leave them, just like in bf2.
UTurista
PR:BF2 Developer
Posts: 985
Joined: 2011-06-14 14:13

Re: [Help] BF2 Modding

Post by UTurista »

Thanks but then what's the purpose of the multiple settings?

Code: Select all

ObjectTemplate.create ObjectSpawner cpname_bijar_canyons_aas16_idfmain_idf_transheli1
...
ObjectTemplate.setObjectTemplate 1 idf_the_uh60
ObjectTemplate.setObjectTemplate 2 idf_the_uh60
...
ObjectTemplate.team 2
ObjectTemplate.teamOnVehicle 1
This is from Bijar Canyons Infantry AAS
Image


Dont question the wikipedia! Just because it reports different things on different languages does not make it unreliable source!
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Help] BF2 Modding

Post by Amok@ndy »

O_turista_portugues wrote:Thanks but then what's the purpose of the multiple settings?

Code: Select all

ObjectTemplate.create ObjectSpawner cpname_bijar_canyons_aas16_idfmain_idf_transheli1
...
ObjectTemplate.setObjectTemplate 1 idf_the_uh60
ObjectTemplate.setObjectTemplate 2 idf_the_uh60
...
ObjectTemplate.team 2
ObjectTemplate.teamOnVehicle 1
This is from Bijar Canyons Infantry AAS
if team1 is in control of the flag "cpname_bijar_canyons_aas16_idfmain"

this will spawn:

Code: Select all

ObjectTemplate.setObjectTemplate 1 idf_the_uh60
if team2 is in control


this will spawn:

Code: Select all

ObjectTemplate.setObjectTemplate 2 idf_the_uh60
so you can spawn 2 different vehicles depending on how many flags the enemy has for example, you can then switch to a attack helo for example
Image
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Re: [Help] BF2 Modding

Post by AfterDune »

That doesn't work very well if you also assign a team to it though.
Image
Post Reply

Return to “PR:BF2 Community Modding”