AndrewBGS
Member
|
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 |
|
Esenthel
Administrator
|
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 |
|
AndrewBGS
Member
|
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 |
|
gwald
Member
|
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 |
|
krokodilcapa
Member
|
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 |
|
Pixel Perfect
Member
|
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 |
|
krokodilcapa
Member
|
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 |
|
AndrewBGS
Member
|
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 |
|
Harry
Member
|
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
|
|
04-17-2013 07:15 PM |
|
AndrewBGS
Member
|
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
|
|
04-17-2013 07:31 PM |
|