Item array type thing... I'm not really sure

Posted By: openfire2691

Item array type thing... I'm not really sure - 09/14/07 04:32

I was working on adding items to my game and I was wondering if there was an easier way to do it. I need to add information like the name and function name in it as well as numbers like the amount of space it takes up in the inventory, but I want it all to be in one place, sort of like a folder so that I can just use the name and call on the data. I guess it would kind of be like a variable with multiple fields that I can call on like: var itemname[4] = name, function, size, uses;. The only problem is that I'm pretty sure that wouldn't work. How can I make this easier?
Posted By: adoado

Re: Item array type thing... I'm not really sure - 09/14/07 09:09

In Lite-C A struct could be used. For C-Script, I guess the best option is to use an array, or maybe its possible to save the "item data" to plain text files, and dynamically open them at runtime..

Hope it helps,
Adoado.
Posted By: openfire2691

Re: Item array type thing... I'm not really sure - 09/14/07 23:55

A struct is exactly the kind of thing that I need. I guess I just need to set it up as an array. Thanks anyways.
Posted By: adoado

Re: Item array type thing... I'm not really sure - 09/15/07 05:23

You could switch to Lite-C, or maybe if you can, write a DLL to assist you.
© 2024 lite-C Forums