• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Help with programming ENUM for Game Maker 8.1

dharrison

Member
Hi there makers!

I need some ideias on how to make a custom script that emulates enumerator (enum) in GM 8.1
I've tried to create a script with 2D Arrays that stores a value and enumerates it, but I wasn't successful.

The logic is:
  • Name your enumerated list
  • Store X values
  • Assign int numbers to each value
  • Return the number if the list and the value is called by an object

Any tips on how to do that?
 

FrostyCat

Member
You can't directly measure the length of an array or pass them around in legacy GM 8.1, that was introduced in GMS 1.3. You should use ds_list instead.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
To be more specific, attempting to assign or return an array in GM8.1 will instead assign/return the first item, which might explain any unusual side effects that you might be seeing.
 
Top