Can I make a [struct] in GML?

T

TheLe99

Guest
Accessing an object's variable is pretty much accessing a property from waht I can tell. So normally, if I want to assign a value to my monster's Armor Class, I'd do this:

ID.ArmorClass = 8;

Is there a way to make ArmorClass a value in a Struct instead of just a variable? Ultimately I want to do this:
ID.Stat.ArmorClass = 8;

If there is a way I can do that, that would be grand (it would help me keep track of all my custom properties).

anyone?
 

FrostyCat

Redemption Seeker
The current method is to combine an enum with an array.
Code:
enum stat_type {
  a,
  b,
  c
}
stat = [3, 5, 7];
Code:
stat[stat_type.c] = 8;
 
T

TheLe99

Guest
The current method is to combine an enum with an array.
Code:
enum stat_type {
  a,
  b,
  c
}
stat = [3, 5, 7];
Code:
stat[stat_type.c] = 8;
So, using your example, I can access "variable a" like this:
Code:
ObjectID.Stat[Stat_type.a] = 9;
Correct?
 
Top