About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Inventory Problem
Author Message
iraq Offline
Member

Post: #1
Inventory Problem
Hi,
I wanted to make inventory in my game so I decided to use example code: "02 - Inventory". I was mix that code with "17 - Camera Collisions". As a result I receive game, but I want to do "auto-picking up" without using mouse. Can u transform code to auto-pickup, please? I can't do this :(
Sorry for my English wink
12-13-2009 11:09 PM
Find all posts by this user Quote this message in a reply
Seba Offline
Member

Post: #2
RE: Inventory Problem
You have it in BM.
Quote:void Player::autoPickUp()
{
Memb<Game::Obj*> obj;
Vec test_pos=pos()-Vec(0,ctrl.height()/2,0);
Game::World.objQuery(obj,Ball(2,test_pos),OBJ_ITEM);

REPA(obj)
if(Item *item=CAST(Item,obj[i]))
if(item->type==ITEM_WEAPON && item->mesh && Dist(test_pos,item->mesh->box*item->matrixScaled())<=ctrl.radius()+0.1f)
{
AddMessage(S+"Picked up "+item->name);
itemPickUp(*item);
}
}
Check in Player.cpp
12-14-2009 08:17 PM
Find all posts by this user Quote this message in a reply
iraq Offline
Member

Post: #3
RE: Inventory Problem
thx man grin
(This post was last modified: 12-16-2009 08:26 PM by iraq.)
12-16-2009 08:26 PM
Find all posts by this user Quote this message in a reply
Post Reply