About Store Forum Documentation Contact



Post Reply 
Inventory Memx Container
Author Message
Ozmodian Offline
Member

Post: #31
RE: Inventory Memx Container
Wow, that seems like a pretty big change. Will you be updating all the tutorials and source codes as well? I read the description like 4 times and still can't quite wrap my head around it. I am sure I will get it once i see it in action.

Damn, I only just felt like I was understanding the object and container piece and now I have to re-learn it. I am sure it is for the better.

Thanks for the heads up Esenthel!
05-05-2013 05:59 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #32
RE: Inventory Memx Container
lol ... guess it's back to the drawing board for me too!
05-05-2013 06:36 PM
Find all posts by this user Quote this message in a reply
TheElk Offline
Member

Post: #33
RE: Inventory Memx Container
Over my head...Thats nothing new..lol
05-05-2013 09:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #34
RE: Inventory Memx Container
Hi, this affects only moving items between the world and player's inventory, it's nothing complicated.
Yes tutorials will get updated of course wink
05-07-2013 11:33 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #35
RE: Inventory Memx Container
So after all this time, it's still Memx that causes my greatest problems.
So I want to add, as stupid as possible, an element in the container, at a fixed position. As simple as that. How on earth can I do that?

items[11]=item; - gets me the horrible "could not deduce template argument 'UNUSED' error. What on earth is so hard about this? Can someone help please?

items is the Memx<Item> container, item is the Item object, created previously.
(This post was last modified: 06-19-2013 06:18 PM by AndrewBGS.)
06-19-2013 06:18 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #36
RE: Inventory Memx Container
Given a memx container for example:

Code:
Memx<float>    containerName;

insert as follows:

Code:
flt &value = containerName.NewAt(i);
value = someValue;

all items from the insert point will be moved to the right (memory addresses are preserved though)

If you just want to replace an existing value in that position then I'm guessing you simply need to update the value stored at that memory location so:

Code:
flt &newValue = containerName[i];
newValue = 1.2f;

although I've never tried that
(This post was last modified: 06-20-2013 09:54 AM by Pixel Perfect.)
06-20-2013 09:50 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #37
RE: Inventory Memx Container
(06-19-2013 06:18 PM)AndrewBGS Wrote:  So after all this time, it's still Memx that causes my greatest problems.
This is not related to Memx container at all, this is about Game.Obj (in this case Game.Item) copy constructor, which is not supported.

Instead if you want to create a new item, you can do items.New().create(here insert some Game.ObjParamsPtr)
06-23-2013 04:26 PM
Find all posts by this user Quote this message in a reply
Post Reply