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

Adding New Material Map Side?

Recommended Posts

No problems adding a new weapon map side for a mod but I don't seem to able able to add a new projectile material. Is it even possible?

This is the materialManagerDefine.con file that I mounted in the same area as the mods original.

rem *** New uber material

Material.active 600

Material.name "nuke explosion material"

Material.type 2

Material.friction 1

Material.elasticity 0

Material.resistance 0.01

Material.projectileCollisionHardness 5

Material.minDamageLoss 0

Material.maxDamageLoss 1

Material.overrideNeverPenetrate 1

And this is the materialManagerSettings.con file that I mount with it.

Run MaterialManagerdefine.con

MaterialManager.createCell 600 0

MaterialManager.damageMod 100

Am I doing this wrong? Or is it just working and maybe my settings are wrong? The idea is that it should penetrate anything in its explosion range. Somehow I think it is not even working and when I use material 600 it just gives up and gives me some wussy default material without crashing.

Share this post


Link to post
Share on other sites

Well, your only collision cell is your new material against the 'default' material ( 0 ) which is rarely used ( only be mistake ) . To test if it works you should create a few additional initiator<>target cells and add some collision sounds . That'll make it easier to test the stuff.

Another hint: If you declare your materialdefines and -settings in the tmp.con of your map you don't need to manually edit init.con after each map save. Let us know if it does work.

Share this post


Link to post
Share on other sites

Thanks for the response. Rather then trying to add a new material via the map I thought I would check and see if the code I was using would even work. I altered (after storing the original zip away ;) ) the mods materiel's with the editor and checked it in game again. I still can't get the explosion to penatrate ground/buildings or even sand bags. And BTW the collision cell being set to zero seems to give me a damage mod of 100 across the board with all materials. Or so the editor says. Thanks again.

Ohh and congrats on the release of your mod! Some of the better AI I have seen yet in BF2.

Share this post


Link to post
Share on other sites

Did you add things like

Material.damageLoss 1000
Material.maxDamageLoss 1000
Material.penetrationDeviation 0

to every material you want to penetrate? The damage a projectile deals after passing through a material is calculated via damage = damageloss/maxdamageloss - projectiledamage, which is why the M95 deals 190 damage so it can get into a cockpit (dealing 90 damage inside which is enough with a head modifier of 1.5. I guess it'll be the same with explosions.

The trick is to have a huge weapon damage but low damage modifiers (in your case it doesn't matter though if it's supposed to kill everything instantly anyway).

Share this post


Link to post
Share on other sites

Hmm, maybe its time to tell us what you want to achieve with your new material. Its not a trivial task to change all materials to a new damageMod and it might have sideeffects throughout the game.

If your material should cause damage when touched you could check out material ID 666 . This material does inflict very high damage to every object getting in contact with it.

Share this post


Link to post
Share on other sites

Hmm, maybe its time to tell us what you want to achieve with your new material. Its not a trivial task to change all materials to a new damageMod and it might have sideeffects throughout the game.

If your material should cause damage when touched you could check out material ID 666 . This material does inflict very high damage to every object getting in contact with it.

Just tried 666 and it was fail. :(

As to what I am trying to do.....

screen073.jpg

screen075.jpg

Edit: Before a rough terrain lightmap.......Looks like crap........

screen053.jpg

Its a fictional map for the FH2 mod called Kummersdorf. Whoever gets control of the center flag can drop a low yield nuke that (should) kill anything in a 200 meter radius. As of now it works great unless you happen to be behind or in a building (in a shallow trench behind a small hill ect ect..) at ground zero. So it feels like a penetration problem to me anyway :huh:

If any feels bored and up the challenge I can upload just the nuke files (4MB) or my work in progress map with everything in place (20+MB) up to filefront. It may be easier for you guys to see what I have got going on here rather them my dumb self trying to explain things.

My initial problem still stands in regards in finding a way to alter/add materials map side. But it seems that before I worry about that I should at least find a way to solve my penetration issues and get it to work.

Edited by Lainer

Share this post


Link to post
Share on other sites

I've done some tests. All these penetration settings are for projectiles only, explosions cannot penetrate (unless I missed a line enabling that). Also, the ground can never be penetrated. If there's an explosive and penetrating projectile it will explode every time it hits a surface, however the actual explosion will not penetrate. You'll want to find another way to handle the nuke (maybe python?).

Share this post


Link to post
Share on other sites

Add the TearGas effect to your nuke :

ObjectTemplate.gasCloudType TearGas
ObjectTemplate.gasCloudDamage 100
ObjectTemplate.blurryVisionTime 2
ObjectTemplate.blurryVisionHoldTime 0
ObjectTemplate.minGasCloudRadius 195
ObjectTemplate.maxGasCloudRadius 205
ObjectTemplate.gasCloudRadiusTime 10

Add these lines to one of your SpriteParticleSystems in the effect. You need to play around with the values.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

Add the TearGas effect to your nuke :

ObjectTemplate.gasCloudType TearGas
ObjectTemplate.gasCloudDamage 100
ObjectTemplate.blurryVisionTime 2
ObjectTemplate.blurryVisionHoldTime 0
ObjectTemplate.minGasCloudRadius 195
ObjectTemplate.maxGasCloudRadius 205
ObjectTemplate.gasCloudRadiusTime 10

Add these lines to one of your SpriteParticleSystems in the effect. You need to play around with the values.

Wonderful! I looked at the code of the actual tear gas grenade from Special Forces and dropped the code in at the proper spot. Only problem I seem to be having is that it kills me from about double the range. I am assuming that the radius for this originates from the particle effect itself and not the actual center of the effect as a whole? I will have to do a little more tweaking (maybe set it upon the column effect with a slightly reduced radius) but I think you set me upon the right path. Thanks a bunch fella!

Share this post


Link to post
Share on other sites

I wouldn't rule out the possibility of a DICE programmer confusing diameter with radius :P and while playing around with medical repair- and supply weapons i found some anomalies with radius coding for these , too.

Share this post


Link to post
Share on other sites

I can't win.......I finished the map up to the point I was ready to show it to the map team guys and now things have gone screwy.

So I packed the map and tested it with my wife via a lan connection. Everything seemed swell up until I tried to nuke her. If she is out in the open the explosion kills her (because the weapon is FH2's HE arty with a big radius and 90000 damage)...However if she was in a building she would just get the teargas effect (well the screen goes black and white and looks a little crappy FH2 uses custom shaders and all) but she wont die. I even tried dropping it on the both of us cowering under the same table and she lived while I died. Now when she hosts the game we have the same problem with me getting the teargas bit but not the dead part. So this seems to be a server client issue. Should I waste peoples time and try this on a dedicated server? Or do my issues run much deeper?

Please help me kill my wife. ;)

The link if anyone can take a look at my mess.

http://www.filefront.com/15858367/kummersdorf.rar/

Share this post


Link to post
Share on other sites

Add a supply object to the effect with a damageSpeed of 100. I've done that with the 21CW mod, works very well ;)

You can even add multiple objects with different radius and damageSpeeds to simulate a degrading effect of the nuke the more you're away from it.

Edited by Terran

Share this post


Link to post
Share on other sites
Add a supply object to the effect with a damageSpeed of 100. I've done that with the 21CW mod, works very well ;)

Thats true for singleplayer but will not work in network games.

Share this post


Link to post
Share on other sites

Uhm, the teargas effect does work in network, provided you have added it to e.g. a projectile (as done in the SF 'nade) - but the radius settings are not necessarily what you expect :P . As far as i remember bergerkiller at one time worked on a nuke effect and his solution was to raise a hemisperic gas cloud slowly by the effect to simulate the increasing damage radius of a nuclear.

Share this post


Link to post
Share on other sites

So the problem is that you cannot add something "useful" to effects in multi player?

Well, then maybe using a timebomb might be working. The projectile has an object spawner attached with a spawn delay one second less then it's TTL. It spawns a supply object like described before. That should work as I was doing that successfully before making the medic bag similar to the one in BF2142 (works in multiplayer).

Edited by Terran

Share this post


Link to post
Share on other sites

Yes, that would work. After all we have spawnable 'Killer' objects in the mod which do work in network games. here's some code from them:

ObjectTemplate.activeSafe PlayerControlObject AxisKiller
ObjectTemplate.modifiedByUser "mscho"
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.createdInEditor 1
rem ---BeginComp:Armor ---
ObjectTemplate.createComponent Armor
ObjectTemplate.armor.maxHitPoints 310
ObjectTemplate.armor.hitPoints 300
ObjectTemplate.armor.defaultMaterial 27
ObjectTemplate.armor.hpLostWhileUpSideDown 0
ObjectTemplate.armor.hpLostWhileInDeepWater 0
ObjectTemplate.armor.hpLostWhileCriticalDamage 30
ObjectTemplate.armor.waterLevel 0.2
ObjectTemplate.armor.deepWaterLevel 0.7
ObjectTemplate.armor.explosionDamage 0
ObjectTemplate.armor.explosionRadius 0
ObjectTemplate.armor.explosionMaterial 60
ObjectTemplate.armor.wreckExplosionMaterial 60
ObjectTemplate.armor.wreckHitPoints 1
ObjectTemplate.armor.timeToStayAsWreck 1
ObjectTemplate.armor.timeToStayAfterDestroyed 1
ObjectTemplate.armor.criticalDamage 305
rem ---EndComp ---
ObjectTemplate.geometry omaha
ObjectTemplate.setCollisionMesh omaha
ObjectTemplate.mapMaterial 0 wood_material 27
ObjectTemplate.drag 20
ObjectTemplate.mass 200
ObjectTemplate.floaterMod 0.01
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate S_AxisKiller_Ambient
ObjectTemplate.addTemplate S_AxisKiller_AmbientDamaged
ObjectTemplate.addTemplate AxisKiller_KillObject
rem -------------------------------------

ObjectTemplate.activeSafe Sound S_AxisKiller_Ambient
ObjectTemplate.modifiedByUser "mscho"

ObjectTemplate.activeSafe Sound S_AxisKiller_AmbientDamaged
ObjectTemplate.modifiedByUser "mscho"

ObjectTemplate.create SupplyObject AxisKiller_KillObject
ObjectTemplate.modifiedByUser "mscho"
ObjectTemplate.createdInEditor 1
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.team 1
ObjectTemplate.radius 30
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 1
ObjectTemplate.damageSpeed 500

The 'omaha' geometry is a little dummy but comes with collisionmeshes. You can probably use any geometry with colmeshes. This object self-destructs after approx. 10 seconds - adjust this in its armor component.

Share this post


Link to post
Share on other sites

Found a super easy way to make this work.

It is kind of along the same lines as what you guys all talked about. Though I was able to do it in the effects editor just by adding a supply object to the nuke as a child.

This was the code it spit out.

ObjectTemplate.create SupplyObject e_exp_nuke_SupplyObject

ObjectTemplate.modifiedByUser "Jeremiah"

ObjectTemplate.createdInEditor 1

ObjectTemplate.floaterMod 0

ObjectTemplate.hasMobilePhysics 0

ObjectTemplate.material 666

ObjectTemplate.radius 200

ObjectTemplate.workOnVehicles 1

ObjectTemplate.damageSpeed 100

Have not tested it yet with other people so I am not getting my hopes up like did with the stupid gas effect. But so far it seems to work. And it ends when the effect ends.

Share this post


Link to post
Share on other sites

Found a super easy way to make this work.

It is kind of along the same lines as what you guys all talked about. Though I was able to do it in the effects editor just by adding a supply object to the nuke as a child.

This was the code it spit out.

ObjectTemplate.create SupplyObject e_exp_nuke_SupplyObject

ObjectTemplate.modifiedByUser "Jeremiah"

ObjectTemplate.createdInEditor 1

ObjectTemplate.floaterMod 0

ObjectTemplate.hasMobilePhysics 0

ObjectTemplate.material 666

ObjectTemplate.radius 200

ObjectTemplate.workOnVehicles 1

ObjectTemplate.damageSpeed 100

Have not tested it yet with other people so I am not getting my hopes up like did with the stupid gas effect. But so far it seems to work. And it ends when the effect ends.

Ok adding shit in the effects is fail....But I used the same code in the weapon and it worked great. Great bit for those that need things to die no matter where they hide. Thanks all that have helped!

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  

×