Dropping Items on Death

This is the development community to discuss tribes mod coding or to ask questions.

Moderator: Moderators

Post Reply
User avatar
Ghost
2nd Lieutenant
2nd Lieutenant
Posts: 94
Joined: Thu Mar 05, 2009 12:53 pm
Location: Mars

Dropping Items on Death

Post by Ghost » Thu Jul 17, 2014 10:35 am

Where can i find the function that drops weapons, ammo, and packs when a player dies? I want to eliminate this from happening so people can't pick up different weapons or ammo.

User avatar
virus
Ensign
Ensign
Posts: 64
Joined: Wed Jun 12, 2013 1:20 am
Contact:

Re: Dropping Items on Death

Post by virus » Fri Jul 18, 2014 8:13 am

No scavenger achievement?

User avatar
Ghost
2nd Lieutenant
2nd Lieutenant
Posts: 94
Joined: Thu Mar 05, 2009 12:53 pm
Location: Mars

Re: Dropping Items on Death

Post by Ghost » Fri Jul 18, 2014 10:07 am

That's pretty much what i wanna do. I wanna eliminate people dropping all of their guns and packs and possibly add a scavenger pack later down the line.

User avatar
C--
Sorry....
Posts: 3299
Joined: Thu Apr 06, 2006 2:32 pm

Re: Dropping Items on Death

Post by C-- » Fri Jul 18, 2014 3:42 pm

Usually the player drops only flag, current weapon and backpack.. The rest you can take if you touch his body after he died.

Look at player::onkilled and ondamage in player.cs
For dropping of the weapon and pack, and look in player::oncollision for the item transfer code to change it.
I don't have the code right now so I can't tell much more. If you need more help say so.

User avatar
Ghost
2nd Lieutenant
2nd Lieutenant
Posts: 94
Joined: Thu Mar 05, 2009 12:53 pm
Location: Mars

Re: Dropping Items on Death

Post by Ghost » Fri Jul 18, 2014 7:16 pm

Thanks for the reply C! :cat:
I deleted the contents of about 6 functions that had to do with dropping items at any given time. Players can no longer drop their weapons while playing, when they die, and i even played around with the function Player::onCollision so now touching a dead body gives you nothing.

EDIT: Am i the only noob left that still codes for this forsaken game?

User avatar
C--
Sorry....
Posts: 3299
Joined: Thu Apr 06, 2006 2:32 pm

Re: Dropping Items on Death

Post by C-- » Sat Jul 19, 2014 12:44 am

No, but you might be coding it for yourself because I see no players anymore... It's still fun tho

User avatar
virus
Ensign
Ensign
Posts: 64
Joined: Wed Jun 12, 2013 1:20 am
Contact:

Re: Dropping Items on Death

Post by virus » Sat Jul 19, 2014 3:29 pm

C-- wrote:No, but you might be coding it for yourself because I see no players anymore... It's still fun tho

User avatar
Ghost
2nd Lieutenant
2nd Lieutenant
Posts: 94
Joined: Thu Mar 05, 2009 12:53 pm
Location: Mars

Re: Dropping Items on Death

Post by Ghost » Sun Jul 20, 2014 6:34 pm

Fortunately I enjoy learning how to code.

Post Reply