Setting up a Max weapon count for a player?
by Michael Cozzolino · in Torque Game Engine · 07/29/2002 (8:41 am) · 4 replies
I'm using Tim Newell's Inventory manager and I was hoping someone could point me in the direction of how to create a max weapon count so the player can only hold say 2 or three weapons at a time.
Thanks, Coz
Thanks, Coz
About the author
Indie Developer in the Albany NY area. iOS, PC, Mac OSX development. http://itunes.apple.com/us/artist/michael-cozzolino/id367780489
#2
Thanks for the help.
Now I need to figure out how to throw weapons :)
07/29/2002 (10:27 am)
Although your logic was correct I needed to do the check in Weapon::onPickup in weapon.csThanks for the help.
Now I need to figure out how to throw weapons :)
#3
I'm curious tho, why do you need to do it Weapon::onPickup? Its called after ShapeBase::pickup, so I was thinking that you'd want to make the check as soon as possible. From ShapBase::pickup you can get access to the datablock of the item that was just picked up, and thus determine if its a weapon or not.
I'm not actually sure, when does it actually "pick up" the item from the game world, ie remove it from being drawn? I think you're only requirement would be to check before that is being done, wouldn't it?
At any rate, good to hear you're on the right track.
07/29/2002 (10:35 am)
Glad you got it working.I'm curious tho, why do you need to do it Weapon::onPickup? Its called after ShapeBase::pickup, so I was thinking that you'd want to make the check as soon as possible. From ShapBase::pickup you can get access to the datablock of the item that was just picked up, and thus determine if its a weapon or not.
I'm not actually sure, when does it actually "pick up" the item from the game world, ie remove it from being drawn? I think you're only requirement would be to check before that is being done, wouldn't it?
At any rate, good to hear you're on the right track.
#4
07/29/2002 (10:53 am)
Your right. I was just being lazy :) so I did it in Weapon.cs
Torque Owner Dave Strock