Jump to content


Photo

Inventory?


  • Please log in to reply
5 replies to this topic

#1 K Man 1112

K Man 1112

    GMC Member

  • Validating
  • 14 posts

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.
:unsure:

#2 Mailas

Mailas

    Send in the Mail

  • GMC Member
  • 5391 posts
  • Version:GM:Studio

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.
  • 0

#3 LaLaLa

LaLaLa

    GMC Member

  • New Member
  • 511 posts
  • Version:GM8

Posted 22 December 2008 - 11:51 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.
:unsure:

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.

EDIT: lol exactly what he said while I was typing.

Edited by LaLaLa, 22 December 2008 - 11:52 PM.

  • 0

#4 K Man 1112

K Man 1112

    GMC Member

  • Validating
  • 14 posts

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 T. Westendorp

T. Westendorp

    GMC Member

  • New Member
  • 1270 posts

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

Edited by T. Westendorp, 24 December 2008 - 04:16 PM.

  • 0

#6 K Man 1112

K Man 1112

    GMC Member

  • Validating
  • 14 posts

Posted 26 December 2008 - 04:04 PM

Thanks a ton.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users