variable

  1. P

    Error with reading files...

    For some reason, the variable READ always returns a zero. Any help would be appreciated Create event: fileId = file_text_open_read(working_directory + "test.txt") Step event: var read read = file_text_read_real(fileId) if read = 0 then exit if read = 1 then instance_create(0,0,obj_green) if...
  2. R

    GML Creating Additional Variables Using Code

    Hello! I'm trying to combine variables using strings and set them equal to a different variable. Example: //In a gun / trap. special = "slow" // or bleed, or several other effects amount = 5 duration = 100 The explosion / bullet then gets the arguments passed to it and then passed to the...
  3. Samuel Venable

     [SOLVED] get gamemaker version?

    I think there should be a way to get from a function or constant what exact version of GameMaker a game was compiled with. GameMaker Studio 2, just like 1.4, has a ton of bugs, especially with HTML5. This would also be useful for people writing extensions because, if a certain update of...
  4. A

    GML [SOLVED]Need portrait to change with text, but only when sentence has finished.

    What I'm trying to do is simply: Let the portrait change whenever the sentence has reached its end and I press "Z". Initially when I pressed Z, even before the sentence finished, the portraits would change before the sentence was finished. if keyboard_check_pressed(ord("Z")) { por_current +=...
  5. T

    Legacy GM Equivalent Variables for Physics

    Something short. Is there an equivalent for hspeed and vspeed in physics variables? I'm not too sure about how phy_speed_x/y and phy_linear_velocity_x/y work.
  6. R

    GML Creating variables for copied instances

    Hi everyone! Let's say I have an object in my room. Then, through some way, I copy this object, creating a new instance of it. I can keep copying it if I want, ending up with multiple instances of that object. What I would like to know is, if it's possible to address a new variable to the...
  7. S

    Loop error, variable unread

    Hello! I have an error or a bug I don't know. Here is my code: ok = 0 do { target = instance_find(village1,random(instance_number(village1))) if target.protection = 0 { if target.player != player { if target.alliance != alliance { if...
  8. J

    Windows Global test????

    I have set this in a script: global.point =0; and in another script: global.point +=5; but I cant seem to figure out how to test this variable :( I have tried a few things but I just keep getting errors. I want to test this variable so that i can delete an instance of an object but can't...
  9. R

    Legacy GM Affect Single Instance (RESOLVED)

    I have 10 instances that work on an AI that I need variables changed when they hit a specific object but ONLY when they hit the object individually. An example would be I have an enemy that when colliding with a trigger its variables are affected but not the other 9 instances of the enemy. it...
  10. A

    GML [SOLVED]Typewriter effect dialog not working on first line of text (array)

    Hi there, I am currently trying to implement dialogue with a typewriter effect (letters appearing one by one), which is working so far except on the first text line. From line 2 and beyond, the typewriter effect works perfectly but for some reason the first line's letter appear all at once...
  11. lukbebalduke

    Legacy GM Built in variables questions

    Hi! I have some questions about the built in variables, so, I'm creating a game and I'm not using any built-in variables other them x, y, depth and visible, but the other variables still being created (right? ) such as speed, direction, gravity, score. Is there any way to avoid that? Does that...
  12. A

    GML [SOLVED] Problem with variable used in array. Incorrect dialog displayed.

    I'm having quite a weird problem (from my perspective at least). I'm using a variable "writing" to store a value to use in an array dail_in[writing]. But what happens now is that in the first two sentences the dialogue reads "0" and only at line 3, and onward, does it start displaying the...
  13. P

    Android How can we check if a variable exists or not?

    Game Maker Studio ditched the variable_local_exists() and variable_global_exists() functions, so my life is harder now in game programming. I found a function called is_undefined, and I rejoiced, thinking that it would help me. Zero. I tried something like this: is_undefined(variable), and...
  14. D

    Legacy GM Unknown global Variable

    FATAL ERROR in action number 1 of Step Event0 for object obj_tank2: global variable <unknown built-in variable>(-1610512732, -2147483648) not set before reading it. at gml_Object_obj_tank2_Step_0 This shows up when i try to run my game, but the only global variable in it is already known and...
  15. W

    GML Help with Variables?

    Hello, I'm gonna make this quick, I have a variable for my player's jump speed and I need to adjust the variable from another object as a jump boost power-up. I thought that the way to do this was to put "global." (the full variable would read "global.jumpspeed") before the variable name but...
  16. M

    Android Compiling creates "uninitialized variable" error

    Hey guys! It's been a while :) Before I get a comment saying there is an error in my code, allow me to explain :p : The game works flawlessly when compiled and ran with the target set to Windows. The error is also showing that it comes from objects that are NOT in the first room and therefor...
  17. D

    GMS 2 [HELP]...[SOLVED]...if image_angle += 1 {global.totalSpinned += 1};

    Why does this not work? "unexpected unary operator +="... What I'm trying to do is make a variable add 1 every degree spinned. DnD and code is welcome to solving!
  18. John Andrews

    [SOLVED]Things after room_goto()

    I just wanted to know if things put after room_goto() in a code are done, for example: if keyboard_check(any) { room_goto(room1); global.room++; } would that make the global variable "room" augment everytime I press any key? ALSO If it is not possible, the is there a...
  19. 2

    Check if Variable equals existing instance id without error if it doesn't

    If I set a variable to an instance id, what do I do to check later if the instance id contained in the variable exists, to avoid it throwing an error when I try to do something to the instance later, if the instance id value in the variable doesn't exist because it was destroyed. Keep in mind...
  20. C

    [solved] Issue passing variables using "with" and "other"

    Hi everyone. My issue is by using the with statement. I'm making a very simple dragon quest style rpg for practice. Basically the player collides with a enemy on the field... then a battleEvent object is created. This battleEvent object creates a playerBattle and a enemyBattle objects, each...
Top