Assigning a material to a PCO problem

Ask questions, discuss ideas, get answers
User avatar
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

Post by Apache Thunder »

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.
ImageImageImage
I have cameras in your head!
User avatar
285mods
Posts: 22
Joined: Tue Dec 03, 2013 12:58 am
Location: US
Contact:

Re: Assigning a material to a PCO problem

Post by 285mods »

Apache 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.
none of the bullets in the game interact with the barrel-pco.. only grenades, expacs, and bombs
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
Image
Image
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.

285mods
User avatar
285mods
Posts: 22
Joined: Tue Dec 03, 2013 12:58 am
Location: US
Contact:

Re: Assigning a material to a PCO problem

Post by 285mods »

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
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.

285mods
User avatar
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

Post by Apache Thunder »

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
I noticed this code in your first post. It's missing quite a lot for a normal PCO. Probably because it was originally a passenger position. You need to add the collisionPhysics command to the host PCO:

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
It's also recommend to add the collision physics command to the child objects the WespeEntry and WespeTower are connected to.

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. ;)
ImageImageImage
I have cameras in your head!
User avatar
285mods
Posts: 22
Joined: Tue Dec 03, 2013 12:58 am
Location: US
Contact:

Re: Assigning a material to a PCO problem

Post by 285mods »

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)

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
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..
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.

285mods
User avatar
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

Post by Apache Thunder »

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)

Code: Select all

ObjectTemplate.delete Wespe_Gunner_PCO1

ObjectTemplate.create PlayerControlObject Wespe_Gunner_PCO1
(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.
ImageImageImage
I have cameras in your head!
User avatar
285mods
Posts: 22
Joined: Tue Dec 03, 2013 12:58 am
Location: US
Contact:

Re: Assigning a material to a PCO problem

Post by 285mods »

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)

Code: Select all

ObjectTemplate.delete Wespe_Gunner_PCO1

ObjectTemplate.create PlayerControlObject Wespe_Gunner_PCO1
(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.
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?
He is no fool to lose that which he cannot keep, To gain that which he cannot lose.

285mods
User avatar
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

Post by Apache Thunder »

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.
ImageImageImage
I have cameras in your head!
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Assigning a material to a PCO problem

Post by freddy »

Vilespring 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
yep most likely, it doesnt have any ObjectTemplate.hitpoints or ObjectTemplate.maxhitpoints
User avatar
285mods
Posts: 22
Joined: Tue Dec 03, 2013 12:58 am
Location: US
Contact:

Re: Assigning a material to a PCO problem

Post by 285mods »

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..

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
Post Reply