Inventory?
Started by K Man 1112, Dec 22 2008 11:47 PM
5 replies to this topic
#1
Posted 22 December 2008 - 11:47 PM
I want to know how to do kind've like a runescape type inventory that shows up while your playing the game. Please help me.
#2
Posted 22 December 2008 - 11:49 PM
To make an inventory, the best option would be to use an array.
Id love to explain it but you could always just use the search on the forums, and search: Inventory in the Tutorials&Examples section.
Id love to explain it but you could always just use the search on the forums, and search: Inventory in the Tutorials&Examples section.
#3
Posted 22 December 2008 - 11:51 PM
Perhaps you could use an array for each location of the inventory and then have an item snap to the closest avaiable location when the mouse button is released.I want to know how to do kind've like a runescape type inventory that shows up while your playing the game. Please help me.
EDIT: lol exactly what he said while I was typing.
Edited by LaLaLa, 22 December 2008 - 11:52 PM.
#4
Posted 24 December 2008 - 02:12 PM
ummmm..... What exactly is an array? I looked up inventory in tutorials but I'm still confused on what an array is. Please help. I know this sounds kind've dumb since I am a gm master according to the test.
#5
Posted 24 December 2008 - 04:13 PM
Hmmn, tests dont really tell much. And not knowing what arrays are doesn't really help;
Arrays are value's with index numbers, there are 2 types of arrays in GM;
1 dimensional, they have one index number.
2 dimensional, they have two index number.
Normally you would have to define things as following:
variable=0
But a array goes like this:
variable[(index number here)]=0
And in a two dimensional array it would be this:
variable[(first index number),(second index number)]=0
The benefit of using arrays is that you can add more then one value to a single variable, thus making it not only more readable but also a lot easier to code.
T
Arrays are value's with index numbers, there are 2 types of arrays in GM;
1 dimensional, they have one index number.
2 dimensional, they have two index number.
Normally you would have to define things as following:
variable=0
But a array goes like this:
variable[(index number here)]=0
And in a two dimensional array it would be this:
variable[(first index number),(second index number)]=0
The benefit of using arrays is that you can add more then one value to a single variable, thus making it not only more readable but also a lot easier to code.
T
Edited by T. Westendorp, 24 December 2008 - 04:16 PM.
#6
Posted 26 December 2008 - 04:04 PM
Thanks a ton.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











