enum

  1. T

    GMS 2.3+ Ds_list check problem

    I created a ds_list inside a global variable called "global.inventario". I succesfully created a code that make my items apear inside my inventory, the numbers rise when I get more items and decrease whe I use it, but, when it reach "0" I need it to be deleted of my ds_list. There is the...
  2. W

    Choosing a random value from an enum

    How do I do it? I'm trying to pick a random value from an enum for an object at the creation of that object. Do I have to set that enum's value in the create event (to zero) and then make it random in a step event? Or can I set that random value right away in the create event. And, what...
  3. PlayerOne

    Help Using enum in Version 2.3

    Just getting accustomed to the new laylout, but what I'm confused about is how enums work with this new update. This is how its currently looking in the enum script. I'm going through the manual and I can't find what function_enum_fields() does. can someone explain what i need to do to make...
  4. X

    Windows Help me

    its me again, hope you guys can help me again :D . I already made everything, but this thing makes it so that i cant even test and open the game becouse its a "FATAL ERROR". /// @desc Draw black bars if (mode != TRANS_MODE_OFF) <---- is supposed to be a enum but it becomes a variable {...
  5. X

    Windows Enum trans_mode not working

    I have seen a guy with a similar problem but it's different for me. for some reason the "OFF," and "NEXT," don't work. The OFF, turns into a variable and the NEXT, doesn't do anything just stays gray. Please help fast. Code: /// @desc Size variables and mode setup w =...
  6. K

    Switching the enum state and keep moving

    Hi, I have an action rpg project. In the player object i have an enum with 3 states: move state, dash state and melee state. When I´m dashing or attacking the player just stops until it finish the action. It turns out that I´m trying to make the player move when i´m attacking or dashing (before...
  7. Spinningmind

    Bug in builtin function is_real

    Found what seems like a bug in GameMaker Studio 2: is_real() returns false when passed an enum even though enums are treated as ints in every other case I can find. The documentation for is_real says it "returns whether a given variable is a real number (single, double or integer) or not" and...
  8. J

    [Solved] Tower Targeting Mode

    So I've been making a TD and I've been looking at targeting systems. Atm I've been play testing with it shooting at the nearest enemy but I'd like to improve that. I found a comment that seemed very helpful but I've never used ds lists or anything like that so I am really at a loss how to...
  9. B

    Comparing a list of enums and a single variable

    in short i have a list of enums i save for different monsters, for a combat i have a number get randomly generated and assigned to a variable called enemy1, enemy2 etc and that determines what appears, what is the best way to check which monster in the list of enums can be compared to the number...
  10. K

    Referencing to Enums

    Quick Question Guys. In my current project I have written a text file translator that turns text file code into real code. Now the problem is, in the program, I have a bunch of enums, one in particular describing material. And of course I want to tell the textfile, which material it should...
  11. S

    GMS 2 Get a string out of enum

    Not sure if this is possible or not but I have an enum and i want a variable to change to a random string from that list. For example if i have this enum. enum item { none = 0, test1 = 1, test2 = 2, test3 = 3, height = 11, } and i want a variable to change to...
  12. FeetUpGaming

    Problems with enum

    Okay so i have just started using enum's don't quite understand and i'm getting very odd behaviour from them. I'm getting this error: Variable control.<unknown variable>(100004, -2147483648) not set before reading it. at gml_Script_is_near_fire (line 8) - if inst.type = pType.fire Heres...
  13. C

    GML Question about Optimizing Finite State Machines

    Hi there - I recently started messing around with finite state machines, User Events, and enums to create player states. Many of you may already be familiar with this, but the way all of this works is that there's an enum for the player (let's say enum player is idle, move, pickup_item, etc.)...
  14. E

    What is the simplest way to get the order of keypresses?

    I apologize for not posting example code. I've tried several approaches including enum, and switch, and posting my attempts would not be much use. I attempted to code without them, but quickly realized it would be quite bulky with too many if statements to be optimal / manageable. I've also...
  15. Simon Gust

    Legacy GM [SOLVED] enums & array interaction

    Hello, I made some observation I'm kinda confused about regarding enums and global variables / arrays. I wrote this code here enum liquid {type = 5} global.liquid[300] = 5; var b = liquid.type; var t = global.liquid[300]; show_debug_message(string(b)); show_debug_message(string(t)); So you...
  16. G

    GMS 2 [SOLVED] enum v. #macro

    hey all, i was wondering what the differences between enums and macros are when it comes to just using them in lieu of ungrouped numbers, if i do something like this: #macro TSTEP 30 #macro HSTEP 8 #macro VSTEP 12 #macro MSTEP 10 versus enum step { tstep = 30, hstep = 8, vstep = 12...
  17. T

    GML Question about Enumerators

    I'm trying to use enumerators to make my arrays more readable. However I'm running into an issue of sorts; (the fix for which seems like a bunch of manual editing of enum fields, gross lol) the question is whether different enumerators of the same "slot" are different from each other. So for...
  18. A

    GML Enum help please

    Hi, Im working on the player's state machine using enumerators, switch statements, and scripts. my first enum, set in the player object's create event, works good and controls the player's movement. the second enum, which I placed in the same player object's create event, does not seem to be...
  19. P

    GML What to use instead of enum?

    I can't use enum because i am using an older version of game maker, i want something to contain 2 states so like it is suppose to be enum states{ normal, inbed } what do i type to get the same results instead of that?
  20. xDGameStudios

    GML Arrays with (structed) arrays.. or one continued array?!

    I wanted to know what would be best performance wise: enum POINT { X = 0, Y, SIZE } p1 = [2, 4]; p2 = [3, 8]; //array of points arr = [p1, p2]; //or continuous array var i = 0; arr[i + POINT.X] = 2; arr[i + POINT.Y] = 4; i+=POINT.SIZE; arr[i + POINT.X] = 3; arr[i + POINT.Y] = 8; //...
Top