Charas-Project

Game Creation => Requests => Tutorials => Topic started by: Vlad Shadeu on August 07, 2009, 10:02:41 PM

Title: Explanation needed (and some GM help)
Post by: Vlad Shadeu on August 07, 2009, 10:02:41 PM
(In General) What are arrays, how are they used, and where are they useful?

(Specific) how would one use them in Game Maker?
Title: Re: Explanation needed (and some GM help)
Post by: fruckert on August 07, 2009, 11:27:55 PM
Arrays are a type of variable.
I honestly don't know the technicalities behind it, but it basically makes it so that the specific variable has different indices.
To make an array, do this:
variable[0]
variable[1] (bracket's are important)
They're often used to cut down on how many variables you have, as Game Maker, specifically, has a tendency to delete variables when they're not being called at that moment, causing humongous glitches in step events.
You can use them for damn near everything.
I personally use them for stats, or having different timers in things.
Just experiment, and see what you come up with.
Title: Re: Explanation needed (and some GM help)
Post by: Vlad Shadeu on August 08, 2009, 12:02:52 AM
"indices"?

I'm sorry, i still dont quite get it.
Title: Re: Explanation needed (and some GM help)
Post by: fruckert on August 08, 2009, 12:05:50 AM
Index's.
It's basically storing a bunch of mini-variables inside of one variable.
So then:
global.roomnext[0] can = "room0"
and global.roomnext[1] can = "room1"
Title: Re: Explanation needed (and some GM help)
Post by: Vlad Shadeu on August 08, 2009, 12:14:07 AM
How do i set an individual mini-variable and how do i call a specific mini-variable?
Title: Re: Explanation needed (and some GM help)
Post by: fruckert on August 08, 2009, 12:21:37 AM
Same as a variable.
Just get the variable (vari) and add a bracket with a number in it (vari[0]) in the create event.
As far as I know though, you can only use the ones you call.
Title: Re: Explanation needed (and some GM help)
Post by: Vlad Shadeu on August 08, 2009, 12:32:41 AM
Oh yeah, do you think you could do a little bit on the TACT engine? Just enough to get people interested.
Title: Re: Explanation needed (and some GM help)
Post by: fruckert on August 08, 2009, 12:35:40 AM
Sorry, not at the moment.
As I've mentioned before, too busy.
Title: Re: Explanation needed (and some GM help)
Post by: Vlad Shadeu on August 08, 2009, 12:40:13 AM
Okay then.........