Hi All!
I must say I love the speed and quality at which questions get answered on these forums, my favorites 3d development community by a long shot.
Anyway, I'm attempting to write and inventory for my game, just a simple list based button style (like ES Oblivion or Fallout), but ALL the tutorials and sample code I could find was based off of a "slot" type inventory, like in Diablo or Neverwinter Nights.
I'm trying to find a way to dynamically draw the item's text and button, but I'm having no luck with the way 3DGS does the TEXTs sepperate from BUTTONS and PANELS... to give an example of what I'd like to do:
Code:
function display_inventory() {
var i = 1;
while(inventory[i*inv_i + inv_name] != NULL) {
string item_name = inventory[i*inv_i + inv_name];
var item_value = inventory[i*inv_i + inv_value];
var item_damage = inventory[i*inv_i + inv_damage];
some_text.string[i] = item_name+string(item_value)+string(item_damage);
some_panel.button[i] = 10,20*i,myBmp,myBmp,myBmp,myFunction,null,null;
i += 1;
}
}
Basically, what this would do (if this was possible) would be to list multiple buttons (with dynamic text over them) that display the item's properties, while allowing me to call a specific function that "uses" the item.
I can't seem to find a way of doing this using panels and buttons, I can generate the text just fine, but I can't run a function when I click that text...
In conclusion, my questions are:
1) Should I be using some other method besides panels and buttons?
2) Because of the lack of "objects", should I even be using C-Script for this?
3) Should I just "suck it up" and use a Diablo-like SLOT inventory system?
I do appreciate any help with this, but I know this is kind of complicated and I don't expect people to do the work for me.
Thanks in advance,
-Aaron