Page 1 of 1

Disable the item kit

Posted: Sat Apr 30, 2011 6:50 pm
by anselmus
When the soldier dies, lets his kit in place for a few seconds, giving opportunity to other soldiers (players) take the kit.
Is it possible to disable or reduce the time?
It is possible to change this property?

Re: Disable the item kit

Posted: Sun May 01, 2011 5:53 pm
by Apache Thunder
My BFH mod features this.

Simply add this code line exactly as it appears to your kit(s):

Code: Select all

ObjectTemplate.setHasMobilePhysics 1
You can also use an invisible geometry for the kit since it will immediately sink under the terrain anyway. This code won't disable the kit, it merely allows it to fall through the terrain. Most normal kits in most mods don't have a collision mesh on the main geometry. (the one you see when the kit is on the ground). Hence the sinking through terrain and becoming unavailable for players to pick up. In the unlikely event your kit(s) do have a collision mesh, do NOT disable collision physics! It will result in client side bugs like kit weapon icons not working. Just remove the collision meshes and your good to go. :D

Don't expect the timeToLive or the timeToLiveAfterDeath codes to work on kits. They have no effect. However in BF2, the timeToLiveAfterDeath command does work and adding mobile physics is therefor unnecessary.

Re: Disable the item kit

Posted: Sun May 01, 2011 7:57 pm
by Swaffy
Isn't there a line of code that tells the game how long the weapon kit can sit on the ground brfore disappearing?

If there is, you can set that to 0.01 and it should disappear.

Re: Disable the item kit

Posted: Sun May 01, 2011 9:48 pm
by archer
I observed it to be exactly 30 seconds. I had looked through kits and soldiers code, but found nothing. Could it be hard-coded?

Re: Disable the item kit

Posted: Sun May 01, 2011 10:08 pm
by Apache Thunder
In BF1942/BFV, it's hardcoded. You can either make them disappear with mobile physics or have them last 30 seconds. Nothing in between unfortunately.

Re: Disable the item kit

Posted: Sun May 01, 2011 11:07 pm
by archer
Hmm... use GravityModifier to make it sink slower?

Re: Disable the item kit

Posted: Sun May 01, 2011 11:50 pm
by Apache Thunder
GravityModifier is only known to work on Sprites/Particles and Projectiles. I have not seen it work on anything else. Sorry.

Re: Disable the item kit

Posted: Mon May 02, 2011 4:30 am
by Swaffy
I made it work on my shoes, it's fun. I jump over my house, sneak over barbed wire fences, jump over
the moon ... float past my neighbors as they sit and watch the grass grow.

Re: Disable the item kit

Posted: Mon May 02, 2011 6:28 pm
by anselmus
Ok, I'll try it.
Thanks