About Store Forum Documentation Contact
Donations:
178$/mo



Post Reply 
Inventory
Author Message
Dynad Offline
Member

Post: #1
Inventory
hey,

Ive a question about the inventory, I'm using the auto pickup of items in the world. Is it also possible to equip world items directly to a slot like left/right arm after picking up, i don't really know how to do this.

Thnx,
~Dynad

There is always evil somewhere, you just have to look for it properly.
01-17-2010 11:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Inventory
of course,
you can extend the Player::itemAdded method
and inside it make necesary calls for activating the item
01-17-2010 11:28 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #3
RE: Inventory
OK when i try this i got an conversion problem, probably i am using the wrong syntax for this.

error C2440: '=' : cannot convert from 'Item' to 'EE::Game::Item *'

void Inventory::itemAdded (Game::Item &item){
item = slot[SLOT_ARM_L]();
}

There is always evil somewhere, you just have to look for it properly.
01-18-2010 12:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Inventory
shouldn't you use it the other way around?

slot = item?
01-18-2010 12:11 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #5
RE: Inventory
yea your right >.>

But what is the best way to give a slot an item?

Somewhere in the inventory code there is:

Swap(inv->slot[SLOT_TEMP],inv->slot[i]); // swap temporary with i-th slot

Well at the time i pick an item its not a SLOT_TEMP cause im not holding it with my mouse. So it must be a SLOT_NUM. But how do i know which 1? i guess it must be done with its ID of the item.

Thnx
~Dynad
nvm ive fixed it grin

inv.slot[SLOT_ARM_R] = inv.items.validElm(0);

There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 01-18-2010 01:07 AM by Dynad.)
01-18-2010 12:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply