[?] How to make destroyable statics Non-Destroyable?

Making or wanting help making your own asset? Check in here
Post Reply
ChiefRyza
Posts: 620
Joined: 2008-06-29 07:37

[?] How to make destroyable statics Non-Destroyable?

Post by ChiefRyza »

Hi, I'm using quite a few of the destroyable bunker statics on Operation Tempest, as they fit most into the aesthetic style of long abandoned bases. As I don't feel the need to make new statics as these are quite suitable as they are on my map, I was wondering how to make them non-destroyable and then replicate them, so I could use a mixture of them (Destroyable ones on the beach landing zones to make it easier for the Marines, with non-destroyable ones further inland to comprise the abandoned cold-war era bases with).

What settings in either the .con file or .TWEAK file do I have to change to make the object non-destroyable? I assume the process is exactly the same for all destroyable objects, I just don't want to stuff anything up through trial and error. Cheers in advance!

.con File:

Code: Select all

GeometryTemplate.create StaticMesh bunker_large_destroyable
CollisionManager.createTemplate bunker_large_destroyable

ObjectTemplate.create DestroyableObject bunker_large_destroyable
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator MB03:mb
ObjectTemplate.collisionMesh bunker_large_destroyable
ObjectTemplate.mapMaterial 0 concrete 0
ObjectTemplate.mapMaterial 1 Gravel 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry bunker_large_destroyable

include bunker_large_destroyable.tweak
.TWEAK File:

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2006/5/15 12:52]
GeometryTemplate.setSubGeometryLodDistance 0 0 30
GeometryTemplate.setSubGeometryLodDistance 0 1 120
GeometryTemplate.setSubGeometryLodDistance 1 0 30
GeometryTemplate.setSubGeometryLodDistance 1 1 120
GeometryTemplate.doNotGenerateLightmaps 0
GeometryTemplate.lightmapOverride 0
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
GeometryTemplate.glowing 0
GeometryTemplate.noLighting 0
ObjectTemplate.activeSafe DestroyableObject bunker_large_destroyable
ObjectTemplate.creator MB03:mb
ObjectTemplate.modifiedByUser "mb"
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.isDestructable 1
ObjectTemplate.cullRadiusScale 5
rem ---BeginComp:Armor ---
ObjectTemplate.createComponent Armor
ObjectTemplate.armor.maxHitPoints 100
ObjectTemplate.armor.hitPoints 100
ObjectTemplate.armor.defaultMaterial 78
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.explosionDamage 1
ObjectTemplate.armor.explosionMaterial 78
ObjectTemplate.armor.wreckExplosionMaterial 78
ObjectTemplate.armor.wreckHitPoints 100
ObjectTemplate.armor.timeToStayAsWreck -1
ObjectTemplate.armor.timeToStayAfterDestroyed -1
ObjectTemplate.armor.wreckDelay 0.05
ObjectTemplate.armor.canBeDestroyed 0
ObjectTemplate.armor.showDamageAsDirt 500
ObjectTemplate.armor.addArmorEffect 0 e_mexp_m_prbuilding -0.046982/1.36782/0.058744 0/0/0
rem ---EndComp ---
ObjectTemplate.geometry bunker_large_destroyable
ObjectTemplate.setCollisionMesh bunker_large_destroyable
ObjectTemplate.mapMaterial 0 concrete 78
ObjectTemplate.mapMaterial 1 Gravel 3
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh


Current project: Operation Tempest
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: How to make destroyable statics Non-Destroyable?

Post by Rhino »

[ code ] [ / code ] tags are always best for code, updated your post. Here's what you want to change :)

Red bits = tweaked.
Green bits = changed name, you will also need to change the file name of the .con and .tweak to match the changed name.

.con File:

Code: Select all

GeometryTemplate.create StaticMesh bunker_large_destroyable
CollisionManager.createTemplate bunker_large_destroyable

ObjectTemplate.create [color=Red]SimpleObject [/color][color=Green]bunker_large_non-dest[/color]
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator MB03:mb
ObjectTemplate.collisionMesh bunker_large_destroyable
ObjectTemplate.mapMaterial 0 concrete 0
ObjectTemplate.mapMaterial 1 Gravel 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry bunker_large_destroyable

include bunker_large_destroyable.tweak
.TWEAK File:

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2006/5/15 12:52]
GeometryTemplate.setSubGeometryLodDistance 0 0 30
GeometryTemplate.setSubGeometryLodDistance 0 1 120
GeometryTemplate.setSubGeometryLodDistance 1 0 30
GeometryTemplate.setSubGeometryLodDistance 1 1 120
GeometryTemplate.doNotGenerateLightmaps 0
GeometryTemplate.lightmapOverride 0
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
GeometryTemplate.glowing 0
GeometryTemplate.noLighting 0
ObjectTemplate.activeSafe [color=Red]SimpleObject [/color][color=Green]bunker_large_non-dest[/color]
ObjectTemplate.creator MB03:mb
ObjectTemplate.modifiedByUser "mb"
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.isDestructable 1
ObjectTemplate.cullRadiusScale 5
ObjectTemplate.geometry bunker_large_destroyable
ObjectTemplate.setCollisionMesh bunker_large_destroyable
ObjectTemplate.mapMaterial 0 concrete 78
ObjectTemplate.mapMaterial 1 Gravel 3
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
I removed the following lines of code from the tweak:

Code: Select all

ObjectTemplate.setNetworkableInfo BasicInfo

Code: Select all

rem ---BeginComp:Armor ---
ObjectTemplate.createComponent Armor
ObjectTemplate.armor.maxHitPoints 100
ObjectTemplate.armor.hitPoints 100
ObjectTemplate.armor.defaultMaterial 78
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.explosionDamage 1
ObjectTemplate.armor.explosionMaterial 78
ObjectTemplate.armor.wreckExplosionMaterial 78
ObjectTemplate.armor.wreckHitPoints 100
ObjectTemplate.armor.timeToStayAsWreck -1
ObjectTemplate.armor.timeToStayAfterDestroyed -1
ObjectTemplate.armor.wreckDelay 0.05
ObjectTemplate.armor.canBeDestroyed 0
ObjectTemplate.armor.showDamageAsDirt 500
ObjectTemplate.armor.addArmorEffect 0 e_mexp_m_prbuilding -0.046982/1.36782/0.058744 0/0/0
rem ---EndComp ---

That should do it, but really if you can, get someone to make a proper "non-dest" version without any wreck models if you can because even thou code wise its not destroyable and you will never see the models "wreck" model, the wreck model is still there, still needs lightmaps and still will drain performance unnecessarily.
Image
ChiefRyza
Posts: 620
Joined: 2008-06-29 07:37

Re: How to make destroyable statics Non-Destroyable?

Post by ChiefRyza »

It is easy to do myself? For now I'll just keep these un-destructible versions (made all the tweaks and just testing it out now) but later on I'll just replace them all with the proper non-destructible versions?
Last edited by ChiefRyza on 2010-09-16 08:32, edited 1 time in total.


Current project: Operation Tempest
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: How to make destroyable statics Non-Destroyable?

Post by Rhino »

well to fully remove the wreck model etc isn't a simple task, isn't too hard if you know what your doing but still a bit time consuming :p
Image
ChiefRyza
Posts: 620
Joined: 2008-06-29 07:37

Re: How to make destroyable statics Non-Destroyable?

Post by ChiefRyza »

Do you have to do it in 3DS Max? If so I might just do it later on when I've built my static modeling skills.
Slowly getting better at it :-P


Current project: Operation Tempest
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: How to make destroyable statics Non-Destroyable?

Post by Rhino »

Ye but its not as simple as just select the wreck and hitting the delete button, gotta lot of fixes to do on the main mesh etc.

If you had the original export scene its is as almost as simple as that with a few minor fixes but for these statics, we dont :p
Image
Post Reply

Return to “PR:BF2 Community Modding”