Jump to content


Photo

invenory NOOB!


  • Please log in to reply
4 replies to this topic

#1 creators124

creators124

    awesomeliciousmember

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 06 May 2012 - 09:58 PM

ok.Posted Image
I have gone through many examples on inventory making, but I suck at understanding them.Posted Image
All I need is help on understanding how to start one like a simple, click object and it appears in a box. :sweat:
I'm really don't understand the examples I have gone through. :confused:
I just wanna learn how to make one! (please)Posted Image
start me off and tell me how it is done! :geek:
if you like you can direct me to an example and I'll see if it is helping.
  • 0

#2 ellisvlad

ellisvlad

    GMC Member

  • GMC Member
  • 249 posts
  • Version:GM8.1

Posted 06 May 2012 - 10:18 PM

My Inventory example


How it that :)

- Vlad
  • 0

#3 creators124

creators124

    awesomeliciousmember

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 07 May 2012 - 12:30 AM

My Inventory example


How it that :)

- Vlad

what does the "i" stand for?
or is it a variable?
what does "mod" mean?
also I have a lot to look into the draw event!
ps
I made a check "if show = 1" so I can press the I button to show or not show the inventory!
  • 0

#4 MonopolyKing

MonopolyKing

    GMC Member

  • New Member
  • 938 posts

Posted 07 May 2012 - 12:59 AM

I didn't look at the code, so maybe this isn't accurate, but i is usually an arbitrary variable used in for loops which only takes value within said for loop. For example (assuming that such is the case):

for (i=0; i<10; i+=1)
{
//I can access the variable 'i' inside the for-loop
draw_text(x,y+(i*10),string(i));
}

//However, I cannot access that same 'i' variable outside the loop:
draw_text(x-10,y,string(i));

//Should return an error for the variable i was never created/defined/initialized

Also, the mod function, or modulo, in GameMaker (and a lot of other languages) --- divides integer a, by integer b and returns the remainder. So if I have:
var c;
c = 3 mod 4;

c will be assigned the value, 3, because 3 divided by 4 is 0 with a remainder of 3.

Edited by MonopolyKing, 07 May 2012 - 01:01 AM.

  • 0

#5 creators124

creators124

    awesomeliciousmember

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 07 May 2012 - 01:29 AM

I didn't look at the code, so maybe this isn't accurate, but i is usually an arbitrary variable used in for loops which only takes value within said for loop. For example (assuming that such is the case):

for (i=0; i<10; i+=1)
{
//I can access the variable 'i' inside the for-loop
draw_text(x,y+(i*10),string(i));
}

//However, I cannot access that same 'i' variable outside the loop:
draw_text(x-10,y,string(i));

//Should return an error for the variable i was never created/defined/initialized

Also, the mod function, or modulo, in GameMaker (and a lot of other languages) --- divides integer a, by integer b and returns the remainder. So if I have:
var c;
c = 3 mod 4;

c will be assigned the value, 3, because 3 divided by 4 is 0 with a remainder of 3.

Thanks for the info on that for loop!
<3 :P
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users