After seeing Swaffy's Exploding Barrels Mod I decided I wanted something like that in my mod.. I am using all existing 1942 templates to create this.
I have had some success so far with spawning the Wespe_Gunner_PCO1. I want an invisible PCO so non-modded clients won't be seeing weird stuff all over the map.
Main Invisible PCO
Code: Select all
rem *** Wespe_Gunner_PCO1 ***
ObjectTemplate.create PlayerControlObject Wespe_Gunner_PCO1
ObjectTemplate.NameTagOffset 0/-0.1/0
ObjectTemplate.setNetworkableInfo WespeBodyInfo
ObjectTemplate.aiTemplate WespeCannon
rem -------------------------------------
ObjectTemplate.addTemplate WespeEntry
ObjectTemplate.setPosition 0.4/0/0.5
ObjectTemplate.addTemplate WespeTower
ObjectTemplate.setPosition 0/0.585/-0.202
Code: Select all
ObjectTemplate.create RotationalBundle WespeTower
ObjectTemplate.geometry Wespe_Tower_M1
rem -------------------------------------
ObjectTemplate.addTemplate WespeGunBase
rem -------------------------------------
Code: Select all
ObjectTemplate.create RotationalBundle WespeGunBase
rem -------------------------------------
ObjectTemplate.addTemplate WespeCannon
rem -------------------------------------
Code: Select all
ObjectTemplate.create FireArms WespeCannon
ObjectTemplate.geometry Wespe_Cannon_M1
This spawned a barrel with the WespeCannon sticking out of it, so I made a tiny custom mesh file in gmax and named it Wespe_Cannon_M1.
Now when I spawn the Wespe_Gunner_PCO1, it shows up as a normal looking barrel.
Everything seems good, except when I shoot the barrel (Wespe_Gunner_PCO1) the projectile goes thru the barrel (PCO) with no interaction at all.
This would indicate to me that there is no material assigned to the PCO, but what I can't understand is that ExPacs, Grenades, and Bombs will destroy the barrel (PCO) just fine.. but bullets have no effect at all. At first I added the standard Light Armor Material ID 45. When this had no effect I made a new, custom material ID 283 and added that.. same results as before, explosives will destroy the barrel, while guns have no effect on it.. So I thought maybe it's the splash damage from explosives, but the main cannon from a tank doesn't damage the barrel at all even when I shoot the ground around the PCO.. it doesn't damage the PCO at all.. I thought maybe the Material needs to be assigned to the actual mesh object (WespeTower) so I tried that and still no interaction. Bullets go right thru the mesh, the knife doesn't interact with it either. I also noticed that I can ram a jeep into the barrel PCO at full speed and it will not damage the jeep at all, but if i try that on a nearby stecrate it will damage the jeep.
Somehow, the PCO must have a Material that the explosives can interact with, but projectiles cannot.. Explosives have 2 Material IDs, I assume one for the object (Grenade) and one for the Damage..
But I am at a loss on how to solve this.. if the explosives can damage the barrel, then it seems like there must be a way to make projectiles also damage it.
Below is my mod so far: (at the moment it won't work SSM because I have been trying different things to get the bullets to damage the PCO) but it works to create a local game to test it
Code: Select all
ObjectTemplate.Active Wespe_Gunner_PCO1
ObjectTemplate.cullRadiusScale 4.0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.explosionRadius 15
ObjectTemplate.explosionMaterial 284
objectTemplate.criticalDamage 0.5
ObjectTemplate.hpLostWhileCriticalDamage 0.1
ObjectTemplate.HasArmor 1
ObjectTemplate.HitPoints 1
ObjectTemplate.MaxHitPoints 1
ObjectTemplate.Material 283
rem ObjectTemplate.Material2 283
ObjectTemplate.timetoliveafterdeath 0.1
rem ObjectTemplate.addArmorEffect 0 e_ExplGranade 0/0/0
ObjectTemplate.setVehicleCategory VCLand
ObjectTemplate.setVehicleIcon "Empty.dds"
ObjectTemplate.setMinimapIcon "Empty.dds"
ObjectTemplate.setPcoId 0
ObjectTemplate.GUIIndex 30
ObjectTemplate.Active WespeEntry
ObjectTemplate.setEntryRadius 0
ObjectTemplate.Active WespeTower
ObjectTemplate.Material 283
rem ObjectTemplate.Material2 283
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.explosionRadius 15
ObjectTemplate.explosionMaterial 284
objectTemplate.criticalDamage 0.5
ObjectTemplate.hpLostWhileCriticalDamage 0.1
ObjectTemplate.HasArmor 1
ObjectTemplate.HitPoints 1
ObjectTemplate.MaxHitPoints 1
Here is my complete Mod with all custom projectile materials etc..
http://www.mediafire.com/download/wph65 ... %20Mod.rar
Any help with this is greatly appreciated..