Disable the item kit

Ask questions, discuss ideas, get answers
Post Reply
anselmus
Posts: 82
Joined: Sun Oct 18, 2009 6:42 pm

Disable the item kit

Post 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?
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Disable the item kit

Post 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.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Disable the item kit

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
archer
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów
Contact:

Re: Disable the item kit

Post 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?
dzn.battlefield.pl - my Bf1942 modding website
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Disable the item kit

Post 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.
ImageImageImage
I have cameras in your head!
User avatar
archer
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów
Contact:

Re: Disable the item kit

Post by archer »

Hmm... use GravityModifier to make it sink slower?
dzn.battlefield.pl - my Bf1942 modding website
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Disable the item kit

Post by Apache Thunder »

GravityModifier is only known to work on Sprites/Particles and Projectiles. I have not seen it work on anything else. Sorry.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Disable the item kit

Post 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.
anselmus
Posts: 82
Joined: Sun Oct 18, 2009 6:42 pm

Re: Disable the item kit

Post by anselmus »

Ok, I'll try it.
Thanks
Post Reply