I'm currently working on a store that will handle a bunch of items. The idea is to store categories of items, and and also the items themselves, with the information associated with them.
The store is broken down in to the Following Categories:
Consumables
Movement
Weapons
Armor
I created 4 arrays for each category
I also created 1 way, which holds the 4 arrays
and so on, and so forth (the gives a better description)
I'm basically storing an array, within an array, within another array.
After all that is done. I want to create a loop which will create a dialog window, and dialog items with the desired information (which would be the items which are associated with the categories (movement, weapons, etc). So when I switch to the category Movement in the store, it will pull all the data from the Movement array, and all the other arrays associated with it (the items).
The question is, what is the best way and most efficient way of going by this?
In my opinion, the best way to code a system like the one you described would be using an array of records, each record is an item, they are stored in a 2 dimensional array, the first index being the category and the second - the item number.
I made an example map for you, it is attached to this post, you can start it up and type in "-buy" to see what it does.
I hope this helps you.
Also, this is my first post here so, sorry if I'm breaking any unwritten rules that I don't know about (even though I've lurked the forum for some time).
I don't know what you mean, the variable names are blank.
If you're saying that the variables show up as blank in the editor and they all look the same I don't know what could have caused it, they look fine when I open the map with my editor (patch 13), I've attached a screenshot. Maybe it's a localization problem ? in which case I would like to know how to prevent this from happening.
If you're saying that all the values in the variable array are blank, they are populated at Map Initialization with the items_addItem() function in the items_init trigger.
Hi,
I'm currently working on a store that will handle a bunch of items. The idea is to store categories of items, and and also the items themselves, with the information associated with them.
The store is broken down in to the Following Categories: Consumables Movement Weapons Armor
I created 4 arrays for each category I also created 1 way, which holds the 4 arrays
and so on, and so forth (the gives a better description)
Heres a crappy graphic representation of my idea: http://yfrog.com/j4arraysetupp
I'm basically storing an array, within an array, within another array.
After all that is done. I want to create a loop which will create a dialog window, and dialog items with the desired information (which would be the items which are associated with the categories (movement, weapons, etc). So when I switch to the category Movement in the store, it will pull all the data from the Movement array, and all the other arrays associated with it (the items).
The question is, what is the best way and most efficient way of going by this?
Any help would be great.
Hi Hippo,
In my opinion, the best way to code a system like the one you described would be using an array of records, each record is an item, they are stored in a 2 dimensional array, the first index being the category and the second - the item number. I made an example map for you, it is attached to this post, you can start it up and type in "-buy" to see what it does. I hope this helps you.
Also, this is my first post here so, sorry if I'm breaking any unwritten rules that I don't know about (even though I've lurked the forum for some time).
thanks for the reply.
The map gives me some ideas, however all the variable names, etc are blank. (what that on purpose?)
anyway, thanks again for the help.
Glad I could help.
I don't know what you mean, the variable names are blank.
If you're saying that the variables show up as blank in the editor and they all look the same I don't know what could have caused it, they look fine when I open the map with my editor (patch 13), I've attached a screenshot. Maybe it's a localization problem ? in which case I would like to know how to prevent this from happening.
If you're saying that all the values in the variable array are blank, they are populated at Map Initialization with the items_addItem() function in the items_init trigger.
Please clarify.
@hddante: Go
included a side by side comparison.
in case the picture didn't work heres a direct link http://img265.imageshack.us/i/weirdk.jpg/