• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

global

  1. E

    Legacy GM [SOLVED] draw_set... are performing for another objects

    Hello, comrades. I have a problem that I can't solve: When I set a font/colour/alpha and other stuff for my sprites or fonts in one objects Draw Event when I draw something in another object it shows the same properties that I just set. I know that I can use functions like draw_sprite_ext or...
  2. S

    Legacy GM Procedurally Generated Room Names?

    I'm working on a procedurally generated game, and I want to be able to create new rooms when the player leaves the bounds of the current room. I already have the rooms set up in a 'grid' system, that is, the name of each room contains its X/Y coordinates (i.e. room "X11_Y27"). I have it so that...
  3. C

    Storing HTTP response as multiple global variables.

    Hi, I am trying to store a HTTP response as multiple global variables. I don't know if this is the best way to do this which is why I thought I'd post on here. I have a server which returns the levels, experience etc of a player as a JSON format here is an example... { "username"...
  4. B

    Collision counter

    Hi there! I want to make a collision counter. I set to the object's create event to: global.collision = 0; And the collision event to: global.collision += 1; It counts constantly when it's overlapping, but I need just one point / collision. I have no idea, how can I do it.
  5. S

    Legacy GM Can't find MAC OS X tab in Global Game Settings

    I've had to re-name my game I'm developing for the iOS app store. However, going to File > Save As doesn't remove all traces of the old name, as the output folder created on my MAC is still named with the old name. I was told, from a bug report feedback, that in order to rename my game, I need...
  6. M

    GML crazy way to tincker with variables??

    I didn't know what to put in the title for this so I apologize for the click bate ish title My question is can there be two separate objects both programed with the same global.variable but that variable changes it's name based off of some state or position in the room?
  7. M

    GML [solved] turn based strategy game giving me minor problems

    Each player can move two objects per turn. The first object to move can not move even when it is that players turn The second object moves just fine once that players turn comes around. This leads me to believe that the code below is not being referenced by the first object moved and only the...
  8. A

    GameMaker calling Global Variables ONCE? "Game Start" event?

    hi i have a script that holds all my global variables that need to be used in my game. i have put it in the "Game Start" Event part of my player, and i've tried putting it in the first room of my games' "Game Start" Event whenever i go back to that first room, the global variables script is...
  9. 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...
  10. Pfap

    global variable index???

    FATAL ERROR in action number 1 of Create Event for object data_structure_grid: global variable name 'purple1' index (100007) not set before reading it. at gml_Object_data_structure_grid_Create_0 (line 14) - global.purple1 = 1 This is the actual code: //variables for tracking global.red1 = 1...
  11. Y

    Legacy GM [Solved]Help, how to read name (ini_open)

    Hi, I'm having some trouble trying to make my game read a saved name I'm using this to save the input name. (using ini_open) for save (working) since i can see with notepad++ that the name was save correctly var name_input = global.Name ini_write_string("save1", "name", string(name_input)...
  12. Y

    Legacy GM [Solved]Drawing text not working?

    Hi, I'm having a bit trouble with draw_text I have this global variable to store the name set when the game start text = ""; global.player_name = text; I have a room for the player to draw the player name (which is working) but when I want to write the name in a different room, It didn't...
  13. Erayd

    Android Global Built in Error after new update

    Some code that's worked in my game for months just stopped working after the new update went through. I'm thinking perhaps someone might be able to shed some light on the issue here? I'll post the code below for reference, it's only a few lines. Basically I compile the game and I get the error...
  14. B

    How to make variables carry over?

    I am starting to use custom variables. I just made a new variable and made it global. I went into a different object to use the variable so that when it increases in value it changes the arrow controls to WASD, but the error code says that it is not set! I'm so lost when it comes to these...
  15. M

    GML Visual Global variables in rooms

    Hi, I have a problem, I want to put the ultimate score in another room which is the room of game over, but I can`t do it, I tried to do it with a global variable but it`s always on 0 at the game over room. Any advice? I`m using Game Maker 2 and drag and drop.
  16. Pfap

    GML [SOLVED] Global variables and strings

    Hi all, I'm trying to implement this type of code in my game with six objects. My issue seems to be that the global.current_code string isn't being added to, because it works fine with one object. The first object create event: global.current_code = " " spacebar event: if place_meeting( x...
  17. T

    User's Input Controls

    Hello, I'm trying to create changable controls for my options menu. I have an object with a lot of code that creates, places and makes button change colors etc. I'm trying to store every control key into a global variable that the player object will use. In the create event of my buttons obj i...
  18. G

    GML SOLVED question about global variables

    i am new to GML and am trying to learn i have tried looking at the manual and looking online for a answer idk if its because i'm just not understanding it or i am not finding the answer but i am curious if something like this would work and if not how would i get it to work key_enter =...
  19. E

    [SOLVED] Adding a String to an existing string

    So my game is a choose your own adventure style game where the player makes decisions and depending on those decisions they go to certain rooms. I'm trying to make it so theres a string which checks which decision you made and then adds it to an existing string, which then prints on an end...
  20. L

    Legacy GM [SOLVED] How to Refer to Global Vars Dynamically

    I have a generic script that accesses one of several lists depending on a string passed into the script. ///GetResource(type) Resource = argument0; ResourceList = Resource + "List"; // The length of the list ListLength = ds_list_size(global.ResourceList); This fails, though, because there is...
Top