Jump to content
Official BF Editor Forums
Sign in to follow this  

Destroyable objects and object spawn vehicles

Recommended Posts

I have three quick questions.

First off, how do I make destroyable objects respawn after being destroyed?

Secondly, when I load up my map, my vehicles at certain spawn points are always the vehicle of the opposite team. For example, I have an american UCB that spawns out transport copters. When I initially make them in the bf2 editor, they become american choppers. After I save, the next time I open it or go into the game, the choppers are chinese. Does anyone know how to fix this?

Lastly, I also have jets in the level and they disappear after I save it and leave the editor. Any way to make them stay?

Any reply or help would be greatly appreciated. Thank you in advance.

Share this post

Link to post
Share on other sites

To make destroyable object respawn you have to add it to your object spawner objects list, however i dont know how to do it, then just make object spawner and choose that object from the list.

The wrong side for vechiles, i had it too and im unsure how i fixed it but i think it was this: Choose the vechile, then in tweaker bar is option called "visible team" choose team from it.

For Jets i dont know, are you sure those are linked to a flag and they dont have spawn delay at start and dunno if it could be this too: if you have MEC vs USMC and you add chinese jet, it doesnt work.

Share this post

Link to post
Share on other sites

I fixed both the plane and team problem. You have to make sure that the option in the tweaker bar called vehicle team 1 and vehicle team 2 is not only filled out (Plane problem) but matches the name of the vehicle object from the correct team. Thank you Freor for giving me the help you did. However, i'm still wondering exactly how to make destroyable objects into respawn objects. If anyone could fill me in i'd appreciate it.

Edited by covertmercenary

Share this post

Link to post
Share on other sites

Maybe this could work: Make object spawner and choose any vechile, then in tweaker bar where is defined which vechiles will spawn, just write one of destroyable objects name to that textfield and see if it works.

Share this post

Link to post
Share on other sites
Maybe this could work: Make object spawner and choose any vechile, then in tweaker bar where is defined which vechiles will spawn, just write one of destroyable objects name to that textfield and see if it works.

On the right track but I'm afraid it's not quite that simple. The 2 problems with what would seem to be the most obvious approach as Freor stated is:

1. You can't type into into the VehicleTeam field

2. Even just assigning the destructable barrel as the object spawned wont work (it throws up a network code error, looks like objectspawners dont like destructable barrels, strange because the destructable bridges work? diff = mesh type.)

Luckily there is a workaround but it involves a bit of basic modding.

How to spawn Destructable Barrels.

Navigate to your level folder, bf2/levels/your_map/ if contents are zipped then unzip.

Inside your_map folder create a new folder named customobjects, open the customobjects folder and create a new folder barrel_red, open barrel_red.

Open mods/bf2/Objects_server.zip/staticobjects/common/destroyableobjects/barrel/barrel_yellow/

Copy barrel_yellow.con and barrel_yellow.tweak and paste them in your_map/customobjects/barrel_red/ then marque select, right click and properties and uncheck read only.

Rename the con and tweak to barrel_red.con and barrel_red.tweak, open the con and rename it like this:

GeometryTemplate.create BundledMesh barrel_red
CollisionManager.createTemplate barrel_red

ObjectTemplate.create PlayerControlObject barrel_red
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator FUL-1:ful
ObjectTemplate.collisionMesh barrel_yellow
ObjectTemplate.mapMaterial 0 metal_thin 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry barrel_yellow

include barrel_red.tweak

Note I leave the col mesh and Geom names alone. Also very important I change the Object template type to PlayerControlObject reasons as I noted in point 2.

Do the same for the tweak:

rem *** Generated with Bf2Editor.exe [created: 2005/5/2 17:30]
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe PlayerControlObject barrel_red
ObjectTemplate.creator DPA-1:dpa
ObjectTemplate.modifiedByUser ful
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.saveInSeparateFile 1
rem ---BeginComp:Armor ---
ObjectTemplate.createComponent Armor
ObjectTemplate.armor.maxHitPoints 50
ObjectTemplate.armor.hitPoints 50
ObjectTemplate.armor.defaultMaterial 97
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.explosionForce 12
ObjectTemplate.armor.explosionDamage 150
ObjectTemplate.armor.explosionRadius 9
ObjectTemplate.armor.explosionMaterial 70
ObjectTemplate.armor.wreckHitPoints 0
ObjectTemplate.armor.addArmorEffect 0 e_barrelyello_exp1 0/0/0 0/0/0
rem ---EndComp ---
ObjectTemplate.geometry barrel_yellow
ObjectTemplate.setCollisionMesh barrel_yellow
ObjectTemplate.mapMaterial 0 metal_thin 111
ObjectTemplate.treeCollisionDiameter 0.7
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh

Now before we open the editor we will create a new .con file in levels/your_map/ called tmp.con and in that con file we will type run customobjects\barrel_red\barrel_red.con and then save.

We will also type that same line run customobjects\barrel_red\barrel_red.con in levels/your_map/Init.con right at the bottom like this:

rem -----------------------------------------------------------------------------

renderer.globalStaticMeshLodDistanceScale 1
renderer.globalBundleMeshLodDistanceScale 1
renderer.globalSkinnedMeshLodDistanceScale 1

run customobjects\barrel_red\barrel_red.con

The reason why I am dupilicating that line is simple, when I save in the editor the line in Init.con that I added will be erased, fortunately the init.con contains a line that points to the tmp.con that does'nt get erased. I need the line in the Init.con when working in the editor otherwise the barrel_red is not available in the VehicleTeam selector.

OK time to fire up the Editor.

Load up your unzipped map with the custom barrel_red. Right click near a control point, create ObjectSpawner, click cancel, name it CP_your_flag_barrel_red1

Go to the tweakerbar and click in the VehicleTeam1 selection box, if all went well you should have barrel_red as selectable, to quickly select it press B on your keyboard.

If you are experiencing problems I suggest re-doing the tutorial.


Croupier..... dice2.png

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this