use geom1 of static instead of 0

Making or wanting help making your own asset? Check in here
Post Reply
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

use geom1 of static instead of 0

Post by Mineral »

hey, I was wondering if there was a way to make an object use the geom1 (dest version) from the start instead of the normal one. Without re-exporting them. It's about the house_dest series. Is there a way? Or is there even a way to make them use the dest version? (how is this coded,cause they can't seem to be destroyed) and then spawn a invisible object inflicting damage at the start of round to make it destroy itself as a work around? :p
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: use geom1 of static instead of 0

Post by Rabbit »

Image

AfSoccer "I just don't see the natural talent."
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: use geom1 of static instead of 0

Post by Mineral »

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

Re: use geom1 of static instead of 0

Post by Mineral »

so, I tried making the house_dest series only show their dest geometry with coding similar to other destroy-able buildings. But it keeps giving me a CTD without an error. It's almost 100% the same as the bunkers on kashan.

I'll drop in all the code I got. Quite a few people are interested in this technique so any help would be appreciated.

house_dest_6b_part1_destonly.con:

Code: Select all

GeometryTemplate.create StaticMesh house_dest_6b_part1_destonly
CollisionManager.createTemplate house_dest_6b_part1_destonly

ObjectTemplate.create DestroyableObject house_dest_6b_part1_destonly
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator MB03:mb
ObjectTemplate.collisionMesh house_dest_6b_part1
ObjectTemplate.mapMaterial 0 penetrable_wood 0
ObjectTemplate.mapMaterial 1 wood_solid 0
ObjectTemplate.mapMaterial 2 ceramic_tiles 0
ObjectTemplate.mapMaterial 3 concrete 0
ObjectTemplate.mapMaterial 4 stairs_wood 0
ObjectTemplate.mapMaterial 5 stairs_concrete 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry house_dest_6b_part1

include house_dest_6b_part1_destonly.tweak
house_dest_6b_part1_destonly.tweak:

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2006/5/15 12:52]
GeometryTemplate.setSubGeometryLodDistance 0 0 50
GeometryTemplate.setSubGeometryLodDistance 0 1 150
GeometryTemplate.setSubGeometryLodDistance 0 2 300
GeometryTemplate.setSubGeometryLodDistance 1 0 50
GeometryTemplate.setSubGeometryLodDistance 1 1 150
GeometryTemplate.setSubGeometryLodDistance 1 2 300
GeometryTemplate.doNotGenerateLightmaps 0
GeometryTemplate.lightmapOverride 0
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
GeometryTemplate.glowing 0
GeometryTemplate.noLighting 0
ObjectTemplate.activeSafe DestroyableObject house_dest_6b_part1_destonly
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 1
ObjectTemplate.armor.hitPoints 0
ObjectTemplate.armor.defaultMaterial 97
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.explosionDamage 1
ObjectTemplate.armor.explosionMaterial 98
ObjectTemplate.armor.wreckExplosionMaterial 98
ObjectTemplate.armor.wreckHitPoints 1000
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 house_dest_6b_part1
ObjectTemplate.setCollisionMesh house_dest_6b_part1
ObjectTemplate.mapMaterial 0 penetrable_wood 1003
ObjectTemplate.mapMaterial 1 wood_solid 15
ObjectTemplate.mapMaterial 2 ceramic_tiles 82
ObjectTemplate.mapMaterial 3 concrete 78
ObjectTemplate.mapMaterial 4 stairs_wood 35
ObjectTemplate.mapMaterial 5 stairs_concrete 34
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh

it's similar for the other buildings.

house_dest_6b_part2_destonly.con:

Code: Select all

GeometryTemplate.create StaticMesh house_dest_6b_part2_destonly
CollisionManager.createTemplate house_dest_6b_part2_destonly

ObjectTemplate.create DestroyableObject house_dest_6b_part2_destonly
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator MB03:mb
ObjectTemplate.collisionMesh house_dest_6b_part2
ObjectTemplate.mapMaterial 0 penetrable_wood 0
ObjectTemplate.mapMaterial 1 wood_solid 0
ObjectTemplate.mapMaterial 2 ceramic_tiles 0
ObjectTemplate.mapMaterial 3 concrete 0
ObjectTemplate.mapMaterial 4 stairs_wood 0
ObjectTemplate.mapMaterial 5 stairs_concrete 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry house_dest_6b_part2

include house_dest_6b_part2_destonly.tweak
house_dest_6b_part2_destonly.tweak:

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2006/5/15 12:52]
GeometryTemplate.setSubGeometryLodDistance 0 0 50
GeometryTemplate.setSubGeometryLodDistance 0 1 150
GeometryTemplate.setSubGeometryLodDistance 0 2 300
GeometryTemplate.setSubGeometryLodDistance 1 0 50
GeometryTemplate.setSubGeometryLodDistance 1 1 150
GeometryTemplate.setSubGeometryLodDistance 1 2 300
GeometryTemplate.doNotGenerateLightmaps 0
GeometryTemplate.lightmapOverride 0
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
GeometryTemplate.glowing 0
GeometryTemplate.noLighting 0
ObjectTemplate.activeSafe DestroyableObject house_dest_6b_part2_destonly
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 1
ObjectTemplate.armor.hitPoints 0
ObjectTemplate.armor.defaultMaterial 97
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.explosionDamage 1
ObjectTemplate.armor.explosionMaterial 98
ObjectTemplate.armor.wreckExplosionMaterial 98
ObjectTemplate.armor.wreckHitPoints 1000
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 house_dest_6b_part2
ObjectTemplate.setCollisionMesh house_dest_6b_part2
ObjectTemplate.mapMaterial 0 penetrable_wood 1003
ObjectTemplate.mapMaterial 1 wood_solid 15
ObjectTemplate.mapMaterial 2 ceramic_tiles 82
ObjectTemplate.mapMaterial 3 concrete 78
ObjectTemplate.mapMaterial 4 stairs_wood 35
ObjectTemplate.mapMaterial 5 stairs_concrete 34
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
shed_dest_destonly.con:

Code: Select all

GeometryTemplate.create StaticMesh shed_dest_2_destonly
CollisionManager.createTemplate shed_dest_2_destonly

ObjectTemplate.create DestroyableObject shed_dest_2_destonly
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator MB03:mb
ObjectTemplate.collisionMesh shed_dest_2
ObjectTemplate.mapMaterial 0 Penetrable_Wood 0
ObjectTemplate.mapMaterial 1 Wood_solid 0
ObjectTemplate.mapMaterial 2 Pentrable_Metal_thin 0
ObjectTemplate.mapMaterial 3 Stairs_concrete 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry shed_dest_2

include shed_dest_2_destonly.tweak
shed_dest_destonly.tweak:

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2006/5/15 12:52]
GeometryTemplate.setSubGeometryLodDistance 0 0 50
GeometryTemplate.setSubGeometryLodDistance 0 1 150
GeometryTemplate.setSubGeometryLodDistance 0 2 300
GeometryTemplate.setSubGeometryLodDistance 1 0 50
GeometryTemplate.setSubGeometryLodDistance 1 1 150
GeometryTemplate.doNotGenerateLightmaps 0
GeometryTemplate.lightmapOverride 0
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
GeometryTemplate.glowing 0
GeometryTemplate.noLighting 0
ObjectTemplate.activeSafe DestroyableObject shed_dest_2_destonly
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 1
ObjectTemplate.armor.hitPoints 0
ObjectTemplate.armor.defaultMaterial 97
ObjectTemplate.armor.waterLevel -0.3
ObjectTemplate.armor.explosionDamage 1
ObjectTemplate.armor.explosionMaterial 98
ObjectTemplate.armor.wreckExplosionMaterial 98
ObjectTemplate.armor.wreckHitPoints 1000
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 shed_dest_2
ObjectTemplate.setCollisionMesh shed_dest_2
ObjectTemplate.mapMaterial 0 Penetrable_Wood 1003
ObjectTemplate.mapMaterial 1 Wood_solid 15
ObjectTemplate.mapMaterial 2 Pentrable_Metal_thin 1000
ObjectTemplate.mapMaterial 3 Stairs_concrete 34
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
Last edited by Mineral on 2013-03-29 16:49, edited 1 time in total.
Image
User avatar
Ason
PR:BF2 Developer
Posts: 1755
Joined: 2012-10-22 10:29

Re: use geom1 of static instead of 0

Post by Ason »

Hey, any news on this? Would be great if someone could get it working.
{ZW}C-LOKE
Posts: 202
Joined: 2012-11-26 20:13

Re: use geom1 of static instead of 0

Post by {ZW}C-LOKE »

Why not take a look at the propane tank in stock bf2 for some cross-reference ideas on this? But if I remember correctly on destructable objects in BF2 engine, they need to be modeled and exported like a vehicle, complete with wreck LOD and mesh. Could be wrong on that, but that's what I remember. But on this last assertion, a heavy feeling of "could be wrong".

Also you could try checking into the destroyable PR bridges. I'll bet that between these two items I've mentioned, plus whatever item you're basing your project off of, there is some code that they each link to. Other than that, don't know what to tell you man. Good luck.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: use geom1 of static instead of 0

Post by Rhino »

One thing you can try is giving it a critical damage of 1, and start hp of 1, so that it collapses into a wreck a second after the round starts?

You should also name the statics better, like "*_wreck"?
Image
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Re: use geom1 of static instead of 0

Post by AfterDune »

Good one. And remove the destruction effects too for that matter :) .
Image
Onil
Posts: 1232
Joined: 2007-08-19 09:50

Re: use geom1 of static instead of 0

Post by Onil »

I'm using this for Dovre PR:Z version.

It is working fine.

I did notice that most wrecked states don't match the actual normal houses, as in there are walls where windows used to be. Only a small number actually has matching wrecks and I suppose that is why the house_dest were never really used as destroyables in PR.

Also, the 2 level house_dest has no coll for the wreck state which means that the windows are bugged and you can't fire out of some. This is fixed in BGF's version but while they fixed the coll of the wreck, they screwed the normal house's coll in which some windows are now bugged. So in both cases, you not use it as a destroyable but you can use either version depending if you want it standing or wrecked.
Image
User avatar
Ason
PR:BF2 Developer
Posts: 1755
Joined: 2012-10-22 10:29

Re: use geom1 of static instead of 0

Post by Ason »

could you/someone explain how to do it? I don't know which files to modify and how to modify them.
Onil
Posts: 1232
Joined: 2007-08-19 09:50

Re: use geom1 of static instead of 0

Post by Onil »

I advise that you just use the normal house_dest versions for now, since if you use the current PR ones or the duplicated wreck versions, both will need light-maps for both standing and wreck states.

Then when the map is almost complete, you can simply replace the ones you want to be a wreck, which is what I'm doing in Dovre. Once i'm done duplicating them and tweaking them, I can upload the files for whoever wants to use them.
Image
User avatar
Ason
PR:BF2 Developer
Posts: 1755
Joined: 2012-10-22 10:29

Re: use geom1 of static instead of 0

Post by Ason »

Great Onil, maybe you can send me a PM when they are ready or just post it here :)
Post Reply

Return to “PR:BF2 Community Modding”