global variable

  1. J

    Confused by what this error means?[Solved]

    ERROR!!! :: ############################################################################################ FATAL ERROR in action number 1 of Create Event for object obj_player: global variable <unknown built-in variable>(-1610512733, -2147483648) not set before reading it. at...
  2. R

    How to work variables

    Hello, I'm currently working on a university project and have been advised to use variables to achieve the goals I want for my project. However, the problem is that I don't know how to set them up or how to work them. For my game, I want my character to possess certain abilities when he...
  3. A

    GML Other checkpoints disappear when I collide with specific one

    When I touch obj_checkpoint it is set to change its sprite when it's activated (collide with player). But when the checkpoint I collided with changes its sprite, the other checkpoints disappear. The reasoning behind this code I got from this video by Shaun Spalding. I'm not sure what the...
  4. B

    Changing variables based off rooms

    I have a space level that I want to include in my game. Do I simply make my variables global and go into my room and subtract and add to the variable at will? For example, in the space level I want to decrease the jump speed.
  5. jana

    [SOLVED] global not set before read

    I have a menu with a play button object. The left mouse event has the following code: room_goto(rm_Level1); When I click, I get this error: obj_counter is an object physically placed in the room. I do not get this error if I place rm_Level1 at the top of the objects list and run it first...
  6. D

    Permanently increasing an objects speed with each click

    Hey guys, Hoping for some help with a problem I can't figure out. I have a ball object in my game that bounces around in random directions upon creation, and off the walls of the room. I have a series of buttons at the bottom of the screen that I want to use to do two things: Change the...
  7. W

    Windows [SOLVED] Not set Before reading it....?

    Hi guys i have a problem on game maker with a game that im working on.... and i keep getting an error tell me that i have not set a value before the program has read it , but i have.... maybe i did it wrong please help and reply ASAP error: global variable <unknown built-in...
  8. K

    Global Variables not working

    I have a obj_variables that is persistent that handles all my global variables for my game. Here is what the code looks like right now In Create globalvar foyerdark; foyerdark = false; In Step if foyerdark = true { with (obj_Foyer) && (obj_picframe_foyer){ image_index = 1;} } if...
  9. C

    Global Variable vs Objects

    General question here. I have an object which spawns blood patterns. An enemy's blood trajectory changes based on how they were killed. I'm thinking about implementing global variables for each. This would mean the game checks global variables for each blood instance. Is this a practical use of...
  10. X

    How to code to store the score in a global variable temporarily then reset the room

    How can i code to store the score in a global variable temporarily then reset the room. Then add code to the oGame creation event where it resets the score. Add a check for that global variable. If the global variable is more than 0 then set score to equal the global variable and make the...
  11. H

    Legacy GM [SOLVED] Lag when checking if joysticks are plugged in

    Hello. I am making a 2 player game, and I need to check if there is 1 or 2 joysticks plugged in. If there is one, player one moves using keyboard. If there is none, player 1 moves with keyboard too. If there are 2 joysticks plugged, player 1 can move with keyboard and with one of the...
  12. T

    [SOLVED] Putting global variable into sprite index?

    Alright so in my game I have a companion creature which will (hopefully) eventually be one of 200 creatures. They also have a battle object and instead of having to write out for every possible companion is it possible to put the global variable inside of the sprite index? Here's what I mean...
  13. Freedom2Fight

    Using [font_add_sprite_ext]

    I asked about fonts some time ago at the Game Design, Development and Publishing . I wanted to use font_add_sprite_ext but I had concerns about the memory leak risk. Then I was I told that I can add and store the font in a global variable when the game starts, then the font will be available...
  14. P

    Legacy GM SOLVED: Global Array Reading Problem

    I'm getting some very strange things happening with an array right now, and was wondering if anyone would know what is going on. I have an array (global variable) called targetChara, pertaining to target character information. The array has been set up as shown, in a function called...
  15. R

    I don't understand this error out of range?

    ___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Draw Event for object obj_input_controller: Push :: Execution Error - Variable Index [1,769] out of range [1,-1] -...
  16. D

    Legacy GM [SOLVED] Where should global variables be initialized?

    Hi, I'm new to GM Studio (running 1.4), and have followed a few tutorials successfully, making a couple simple games. I'm trying to figure out where the best place is to initialize a global variable such that you won't run into the "global variable .... not set before reading it" error. My...
  17. P

    global variable on mulitplayer

    so in frustrations ive scrapped my old character customization design and decided to refrence a tutorial. specificly this one- for the TLDR's here- basically he uses global variables to know what sprites to use in his character. if i were to use that method, would it be multiplayer...
  18. XirmiX

    Legacy GM [Solved] Setting a global variable?

    Strangely, when I set up a global variable in one object's create event and then make an if statement in create event of another object checking whether that variable is true/false or some number, it gives me an error saying "the variable isn't set"... What the heck? Can I not check for global...
Top