constant

  1. Daniel Mallett

    GMS 2.3+ Macros

    Does anybody know why Gamemaker refers to constants as macros? To me, a macro is something that performs a particular of predefined action. A constant is one value that never changes. This isn't stopping me working I'm just curious. It feels as though I have missed something fundamental in...
  2. Pelican Police

    Switch case must be a constant (except when it's not).

    Why can't a switch statement use variables from a different instance as cases, when it can use variables from the local instance? I don't see how that's any different? Is it something to do with the compiler automatically spotting constants and swapping them out? This causes Compile failed -...
  3. etbunce

    Best Way to Store Constant Configuration

    Hey y'all, I've thought of my own solutions to this problem, but I'd like to throw this out there to see if there are better ideas than mine, since none of mine seem to be super ideal. In my game, the player is able to build different buildings and use certain abilities. Every building/ability...
  4. X

    GMS 2 enemy code isn't a constant?

    i'm trying to make enemy code (i'm using Shawn spalding's tutorial for melee attacks) but when i try to star the game it says the enemy state should be constant. but i can't make it constant because i'm confused. switch (state) { case ENEMYSTATE.FREE: EnemyState_Free(); break; case...
  5. jana

    [SOLVED] Macro code error

    I'm following the manual's instructions for creating a macro, and I'm getting an error as I type this code in the script editor: #macro NUMSETS 106 http://www.screencast.com/t/dGJwi4QNPm This link in the manual shows the same syntax I'm using...
  6. zendraw

    Legacy GM [SOLVED]:Getting keys that are not constants

    Hi, how do you get a key that is not a constant in gms1? for instance the brackets [ ]. i was thinking about the chr() but im not sure how wuld work. any ideas?
  7. gnysek

    Discussion [Proposal] named instances info getting

    Since GM:S 1.x and in GMS2 too, we can set name for instances placed in room editor. As they were numbered from 1000000 up in pre-GMS, they now are usually named "inst_XXXXX" where XXXX is a hex number. Later on, you can use this variable inside code, since in fact inst_XXXX constant is just an...
  8. T-bond

    Discussion Different macro values of different configuration

    The new macro definition method is super cool, and long wanted. But for now, I can't figure out the way how to change their value depending on the current configuration. In GMS 1.4 for every configuration selected there was a separate Macro editor, so for example I could toggle between the...
  9. N

    Legacy GM Question about Macros

    Say I have an array of attributes holding the stats of a character stats[1] being strength stats[2] being dexterity, and so on. But I have so many stats and interactions to keep track of, it gets confusing and unreadable. Example: if stats[26]<stats[23] { stats[26]+=stats[32]/room_speed...
  10. ZeDuval

    Legacy GM Macro/Constant of Project vs Extension difference bug(?)...

    Hey friends! Whoever would accuse me of being a Macro/Constant-addict, would be right. I love 'em and use 'em very often to "hide" variables with long names for example. A GM-project can have constants, accessible in the ressource tree structure in a menu, which must btw be the worst menu ever...
  11. F

    Legacy GM Issues when using Macro constant

    I have problems when compiling. When I attempt to use a Macro constant in my code, the compiler will throw an assignment exception (and signs where I'm pretty sure that they're not needed). I suspect that the compiler itself is broken. PS: This will happen on any exporting platform.
Top