Assigning a material to a PCO problem
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Assigning a material to a PCO problem
Do all bullets not interact or just your custom ones? Also if you change this only as a server side mod, there's a possibility the client will not see any impact effects from the bullets, so they would "seem" to pass through even though on the server, they didn't.



I have cameras in your head!
Re: Assigning a material to a PCO problem
none of the bullets in the game interact with the barrel-pco.. only grenades, expacs, and bombsApache Thunder wrote:Do all bullets not interact or just your custom ones? Also if you change this only as a server side mod, there's a possibility the client will not see any impact effects from the bullets, so they would "seem" to pass through even though on the server, they didn't.
The Material ID 283 which is the custom Collision Material I made was added to interact with all weapons in the game.
here is a confusing ss that that probably wont help.. it's of my game.rfa and shows the custom materials a little.. I added a file called Barrel to both the Collision_Armor directory and to the Damage_System directory.. I also added the custom material to materialmanagerdefine.con and to materialmanagersettings.con


He is no fool to lose that which he cannot keep, To gain that which he cannot lose.
285mods
285mods
Re: Assigning a material to a PCO problem
As far as it seeming to pass thru for clients, it will still damage them from the invisible explosion.. modded clients will of course be able to see the explosion etc..
Here is another video I made comparing the exact same mesh file, 2 different objects. the upright barrel is the Barrel-PCO while the barrel laying on the ground is the stebarrel1. notice that bullets interact with the stebarrel just fine, but pass straight thru the barrel-pco.. these 2 objects are both using the exact same mesh file from StandardMesh.rfa
http://youtu.be/3t6SN_Vrmbc
Here is another video I made comparing the exact same mesh file, 2 different objects. the upright barrel is the Barrel-PCO while the barrel laying on the ground is the stebarrel1. notice that bullets interact with the stebarrel just fine, but pass straight thru the barrel-pco.. these 2 objects are both using the exact same mesh file from StandardMesh.rfa
http://youtu.be/3t6SN_Vrmbc
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.
285mods
285mods
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Assigning a material to a PCO problem
Code: Select all
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 PlayerControlObject Wespe_Gunner_PCO1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
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
Also where are the active commands being loaded from? You need to load them from staticObjects.con file or one of the game mode con files you are doing this in. If you load active commands from a file connected to the map's init.con file, it won't work.




I have cameras in your head!
Re: Assigning a material to a PCO problem
yeah the Wespe Code in my original post was just to show the child objects attached to the Wespe_Gunner_PCO1 etc..
at the moment, the entire mod consists of this code (which I am loading from a Mods.con file in the map directory, same place the ObjectSpawns.con and ObjectSpawnTemplates.con files are) and the stebarrel1_m1 StandardMesh File that is overwriting the original default Wespe_Tower_m1 mesh file
Thats all at the moment.. I think you may have been on to something about the export material settings in gmax.. because after I did that the jeep began interacting with the barrel-pco etc..
at the moment, the entire mod consists of this code (which I am loading from a Mods.con file in the map directory, same place the ObjectSpawns.con and ObjectSpawnTemplates.con files are)
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 45
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.hasRestrictedExit 0
ObjectTemplate.Active WespeTower
ObjectTemplate.Material 45
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
rem ObjectTemplate.Active WespeEntry
rem ObjectTemplate.setEntryRadius 0
Thats all at the moment.. I think you may have been on to something about the export material settings in gmax.. because after I did that the jeep began interacting with the barrel-pco etc..
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.
285mods
285mods
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Assigning a material to a PCO problem
If the active commands don't end up working good for you, you can also try this: (unlike with active command, you can do this anywhere be it in staticObjects.con or map's init.con)
(make sure to use the delete command before you create the object you are deleting. Otherwise you'll just end up deleting the custom object and thus it won't exist and cause a missing child object error CTD. (if said object was addTemplated to anything)
Then you can basically rebuild the entire template. Unlike the active command, you'll need to provide all the code the original had if you want it to use the same code as the original since you're basically deleting the old template and building a new one. With the active command you only included the commands you wanted to change/add.
Code: Select all
ObjectTemplate.delete Wespe_Gunner_PCO1
ObjectTemplate.create PlayerControlObject Wespe_Gunner_PCO1
Then you can basically rebuild the entire template. Unlike the active command, you'll need to provide all the code the original had if you want it to use the same code as the original since you're basically deleting the old template and building a new one. With the active command you only included the commands you wanted to change/add.



I have cameras in your head!
Re: Assigning a material to a PCO problem
Will this allow unmodded clients to connect to my server? and will modded clients be able to connect to other servers that don't have the mod?Apache Thunder wrote:If the active commands don't end up working good for you, you can also try this: (unlike with active command, you can do this anywhere be it in staticObjects.con or map's init.con)
(make sure to use the delete command before you create the object you are deleting. Otherwise you'll just end up deleting the custom object and thus it won't exist and cause a missing child object error CTD. (if said object was addTemplated to anything)Code: Select all
ObjectTemplate.delete Wespe_Gunner_PCO1 ObjectTemplate.create PlayerControlObject Wespe_Gunner_PCO1
Then you can basically rebuild the entire template. Unlike the active command, you'll need to provide all the code the original had if you want it to use the same code as the original since you're basically deleting the old template and building a new one. With the active command you only included the commands you wanted to change/add.
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.
285mods
285mods
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Assigning a material to a PCO problem
It should work so long as you assigned the same network template to the PCO that it had before. It should work much the same way the active command did network wise.



I have cameras in your head!
Re: Assigning a material to a PCO problem
yep most likely, it doesnt have any ObjectTemplate.hitpoints or ObjectTemplate.maxhitpointsVilespring wrote:I believe the wespe gunner PCO doesn't take damage from bullets, no mesh, etc, because damage is determined by hit to the parent PCO, aka, the hull/superstructure
Re: Assigning a material to a PCO problem
After further testing I am convinced that the Mesh has the correct Material assigned to it.. I tried several different materials and have observed how they interact differently to collisions in the game.. for example, exporting the mesh file from gmax while using forcematid to material 220 (M1Garrand Projectile material) will make the barrel create that little metal ricochet sound that a bullet has when striking a metal surface like a jeep.. so crashing a jeep into the barrel both damages the jeep and makes that sound.. setting the mesh file's material to 41 (Soldier Material) make the barrel cry out as the "MaterialManager.setEffectTemplate e_collision_Soldier" sound effect.
So I am convinced that setting the export material to ID 45 is the correct setting from GMAX. Now the problem falls back to why the PCO isn't accepting the line..
So I am convinced that setting the export material to ID 45 is the correct setting from GMAX. Now the problem falls back to why the PCO isn't accepting the line..
Code: Select all
ObjectTemplate.Material 45
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.
285mods
285mods