Dropping Items on Death

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

Moderator: Moderators

1 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
Ghost
2nd Lieutenant
2nd Lieutenant
 
Posts: 94

2 Fri Jul 18, 2014 8:13 am

No scavenger achievement?
User avatar
virus
Ensign
Ensign
 
Posts: 64

3 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
Ghost
2nd Lieutenant
2nd Lieutenant
 
Posts: 94

4 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
C--
Sorry....
 
Posts: 3299

5 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
Ghost
2nd Lieutenant
2nd Lieutenant
 
Posts: 94

6 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
C--
Sorry....
 
Posts: 3299

7 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
virus
Ensign
Ensign
 
Posts: 64

8 Sun Jul 20, 2014 6:34 pm

Fortunately I enjoy learning how to code.
User avatar
Ghost
2nd Lieutenant
2nd Lieutenant
 
Posts: 94


Return to Coder's Hangout

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron