Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,302 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Item array type thing... I'm not really sure #154014
09/14/07 04:32
09/14/07 04:32
Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
openfire2691 Offline OP
Junior Member
openfire2691  Offline OP
Junior Member

Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
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?


When your script isn't working right, usually it's because it's doing exactly what you told it to. -An Unknown Programmer
Re: Item array type thing... I'm not really sure [Re: openfire2691] #154015
09/14/07 09:09
09/14/07 09:09
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
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.


Visit our development blog: http://yellloh.com
Re: Item array type thing... I'm not really sure [Re: adoado] #154016
09/14/07 23:55
09/14/07 23:55
Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
openfire2691 Offline OP
Junior Member
openfire2691  Offline OP
Junior Member

Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
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.


When your script isn't working right, usually it's because it's doing exactly what you told it to. -An Unknown Programmer
Re: Item array type thing... I'm not really sure [Re: openfire2691] #154017
09/15/07 05:23
09/15/07 05:23
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
You could switch to Lite-C, or maybe if you can, write a DLL to assist you.


Visit our development blog: http://yellloh.com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1