About Store Forum Documentation Contact



Post Reply 
inventory help
Author Message
craksy Offline
Member

Post: #31
Re: inventory help
sorry for keep asking stupid questions but i still dont understand it really :/
i tried:
void create(ObjParams(
but it doesnt seem to take any arguments... also if i type ObjParams. nothing comes up, so it doesnt have any functions either :/
so what excactly do i put in void create?

also i went through the Game Basics tutorials, and i didnt see __super::create anywhere :/

its kinda sad, that i make you do half of my code, but at least i will (hopefully) be able to do it myself next time...
01-11-2009 06:42 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #32
Re: inventory help
nah! i am so fucking stupid!
found it in the "custom parameters" tutorial... how could i over look that? :S

anyway thanks for all your help smile
01-11-2009 07:14 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #33
Re: inventory help
ok, i got the inventory system working more or less...
it picks up the items, and an icon pops up in the next available slot!

1. now i have some new questions:
2. how do i make the icons dragable? bet its something like, extensding the "Image" clas, and put some kinda event on it?
3. how would i make hit detection on equipment slots, so i can make him wear the stuff?
4. i dont see anywhere, explaining how to make costum GUI styles... did i miss something?
5. now i made each item have an icon! how would i, when in the inventory, find out which item the icon relates to? so i can make the right item drop on ground, or make him wear it?

i am really sorry for bothering you with all my questions, but i just got so excited about this smile

thanks in advance smile
01-13-2009 03:45 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #34
Re: inventory help
I'll make a tutorial about it
01-13-2009 03:51 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #35
Re: inventory help
all of it? :O
like in a complete inventory tutorial?
01-13-2009 03:59 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #36
Re: inventory help
I guess so
01-13-2009 04:02 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #37
RE: inventory help
Hi.. im having somewhat similar problems..
Code:
    if (Ms.b(0))
        {
        if (Item *item = CAST(Item,ResourceManager::getCurrentObject()))
            {
            Vec pos;
            SinCos(pos.z,pos.x,angle.x+PI_2); // set direction according to player angle
            pos *=ctrl.radius()+0.5;          // set radius    according to player controller radius
            pos.y=ctrl.height()*0.2;          // set vertical  position
            pos +=T.pos();
            ResourceManager::getCurrentObject()->pos(pos);
            }
        //use.set(cskel,"anim/damien/usedoor.anim"); // initialize "right-hand swing to left direction" attack animation
        }

This is finally how i got the object to respond somehow.
I tired itemPickUp(*item) but didnt have any luck.
Im not sure what i was missing there and i know its hard to understand from such a small piece of code, but if it rings any bells please let me know.. otherwise i will have to and do the item picking like this.
02-12-2010 11:11 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #38
RE: inventory help
what are you trying to achieve?
what is your problem?
02-12-2010 04:25 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #39
RE: inventory help
just basic pickup item, drop item system..
as there is in the World with character tutorial or the inventory tutorial.
for some reason im not getting any behavior with the itemPickUp function.
I have managed to create the grabbing manually.. and now im experimenting with
item->pickedUp();
This seems to pickup the item but the mesh still stays on the spot?
Strange.. i guess im able to create a whole new system for item picking just by manually deleting stuff and creating them again when needed.
02-12-2010 07:52 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #40
RE: inventory help
you need to call Chr::itempickup

Item:::pickedup will be called automatically
02-12-2010 08:30 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #41
RE: inventory help
yeah thats what i was doing..
that code was inside extended player class.
02-12-2010 10:01 PM
Find all posts by this user Quote this message in a reply
Post Reply