About Store Forum Documentation Contact



Post Reply 
Inventory functionality
Author Message
AndrewBGS Offline
Member

Post: #1
Inventory functionality
After having a ton of issues with the tutorial inventory application i realized I have to ask some basic questions about it, since the comments aren't of much help.
The point where I am stuck now is:

HOW are ITEMS added to the inventory.items container?
Also, WHEN is an ITEM object created?

I have to understand these things in order to make my own version of inventory. If anyone can explain to me how these things work I'd really appreciate it. I traced the execution and I have no idea how and where Item objects are created and then added to the items container in inventory.
04-11-2013 02:34 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Inventory functionality
Game.Chr virtual method for getting the item container is used internally, it's called, pointer to items container is accessed, and existing item is moved there.
Those codes are internal in the engine, a hidden Game.Obj method.
04-17-2013 01:21 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Inventory functionality
Right, so that sounds like something I shouldn't touch. I was more interested in where the item in the world starts acting like the Item in my class (the one in tutorials/inventory).
Also, I'd like to know if the Memex<Item> items in the inventory class are... "accessible". I'd like to have 2 Memex<Item> lists in my inventory, one for the equipped items and one for the items in bag. But I have no idea how items get inserted into that list in the first place, so I'm not sure it's a good idea to remove them from one list and add them to another when (un)equipping an item.

Can't I see the implementation of engine functions too? All I managed to see is the declaration with it's comments, which helps, but i could use understanding more about how things work.
04-17-2013 01:34 PM
Find all posts by this user Quote this message in a reply
gwald Offline
Member

Post: #4
RE: Inventory functionality
Look on the store download for object code.
I'm sure it has the code for item which you can change as required.

My Blog
http://www.esenthel.com/community/showthread.php?tid=6043

I hang out at Esenthel IRC Channel
http://webchat.freenode.net/?channels=#Esenthel
04-17-2013 01:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
krokodilcapa Offline
Member

Post: #5
RE: Inventory functionality
gwald: As I know these game object sources aren't avaible anymore on the store. Or I miss something?
04-17-2013 04:44 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #6
RE: Inventory functionality
(04-17-2013 04:44 PM)krokodilcapa Wrote:  gwald: As I know these game object sources aren't avaible anymore on the store. Or I miss something?
They were in my download area last time I looked.
04-17-2013 05:27 PM
Find all posts by this user Quote this message in a reply
krokodilcapa Offline
Member

Post: #7
RE: Inventory functionality
Hmmm... you bought it in the past, am I right? I think Esenthel is removed the possibility to buy these sources, and now the only way to get them if you buy the full EE 2.0.
04-17-2013 05:36 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #8
RE: Inventory functionality
Go to the store, to EE 2.0, then the download link. If you've purchased EE 2.0, the Game Object sorce code is available there in the list of things you can download. smile
(This post was last modified: 04-17-2013 06:10 PM by Rubeus.)
04-17-2013 06:10 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #9
RE: Inventory functionality
So I'm gonna ask a noob question..... What is the use of those Game Object files?
Are they samples of how we should implement the classes of our game objects? Or it's the actual implementation they have in EE which i can't seem to see? Or are they something else?
04-17-2013 06:25 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #10
RE: Inventory functionality
It's prepared classes for different basic types of objects (Items, Static objects etc.). They inherit from Game::Obj class which is base class for all game objects and it belongs to World Manager system (so each object putted in World Editor has one of type which corresponds to one of Game Object class). If you want to extend functionallity of some objects you could make class which derivatives from one of Game Object classes or if your object conception doesn't fit to any of these classes you can derivative directly from Game::Obj class which provides you that objects of your type will be automatically managed by World Manager (drawing, updating etc.).

I hope I explained it clearly and didn't tell anything wrong smile
04-17-2013 07:15 PM
Visit this user's website Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #11
RE: Inventory functionality
Yes, quite clear. I'm studying these things at university, so I have quite a good idea how things work with OOP, inheritance and stuff. I just wasn't sure what these classes were. So I see they are somewhat "base" class for each of those object types. I suppose that's quite helpful.
Thanks for enlightening me smile
04-17-2013 07:31 PM
Find all posts by this user Quote this message in a reply
Post Reply