• 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!

variable

  1. J

    sprite_index is behaving strange

    if(kaart = 'diff') { sprite_index = Diff; } this is the code I use to change my sprite. the if statement works, and ive tested it already. I have a list of sprites: Trik Buck Nack Poll Diff whenever I run the code, the sprite changes to Nack, which is 2 places higher in the list. Whenever...
  2. J

    GML Confusing variables, I need help!

    I made a game where you can click on a pack, and you will recieve a card. When you click on this card, the variable changes and in the next room, I want to display this card again, but it keeps on giving me the wrong sprite. I think it is because my variables are not saved correctly. When...
  3. T

    GameMaker How many global.Variables is too much?

    Is it recommended to keep the global.Variables to a minimum? Does it have any noticeable or significant impact on performance or resource management? Does checking every Step for hundreds or thousands of global.Variables negatively impact the game? How much is too much? Cheers
  4. F

    Legacy GM Changing Joint Variables!

    Hey everyone, I'm currently making a character out of ragdoll with the built-in physics of GMS 1.2.1130. I'm having a problem on changing the variables of a certain joint that was created even though I've made a variable within it. I can't seem to find any GMS tutorials about physics that can...
  5. L

    Legacy GM using buffer with var scope

    let say i put var some_buffer = ds_map_find_value(async_load,"buffer"); in network async event, should i delete the some_buffer variable everytime at the end of network async event to prevent memory leaks? i noted that when i delete it, it will cause illegal buffer error sometime
  6. S

    Starting an alarm after variable value has changed

    Been at this for months, still cant find an answer. I have a variable global.spawner, and it is set to 1. After pushing a button the value goes to 2. Once the value goes to 2 I want the next alarm (alarm 1) to start. This will repeat as the values get higher. Right now Alarm 0 starts once the...
  7. G

    Legacy GM Instance variable logic problem

    Ok is very simple, I have an object with this in create event: acc_y = -8; and this in the step event: if (acc_y < 12) { acc_y +0,25} y = y + acc_y; Now i thought that the istances of the object didn't share the internal variables. When I spawn one moster his speed will be like +5, but if i...
  8. N

    Legacy GM When this, skip the next ?

    Hi. I have a quick question, this is my code: if (!place_meeting(x+sign(hsp),y-8,par_ground) && !place_meeting(x+sign(hsp),y-8,obj_pipe)) { with (obj_oneway) { if (place_meeting(x-sign(other.hsp),y+8,other)) { if !(bbox_top > other.bbox_bottom) {...
  9. Coded Games

    Windows thinks a Script is local variable.

    Hello, so I've been building my game in MacOS using GMS2 and when I export to Windows I'm getting a strange error that I don't get in MacOS. Here is the code: if (!ds_stack_empty(global.playStack)) { if (ds_stack_top(global.playStack) != card_teleport && ds_stack_top(global.playStack) !=...
  10. D

    GML A few questions about GML

    There are a few things i couldn't find in reference. 1. About the variables in the following code (script code); for (i = 0; i < 10; i++) { bar = i * 10; foo = bar; } what is the storage class of variable i and variable bar? I believe they are not local variables since we didn't...
  11. Z

    GML Visual Scripted actions doesn't play cause the variable counter doesn't have interger number

    Sorry for my bad english I just need that, I have an event who checks the frames of an animation, but if I play the animation in a different speed, like 0.3 some of the checks will not activate, because instead being in the frame 3, it would be the frame 3.5 How do I fix that?
  12. S

    GameMaker Editting the properties of an object created with instance_create

    I have a hitbox I create in an attack state for the player. Here is my code: bodyHitbox = instance_create_layer(x + 450, y, layer, obj_body_hitbox); object_set_solid(bodyHitbox, true); bodyHitbox.mask_index = spr_player_attack_1_body_hitbox...
  13. W

    Making things clear for readers

    The Mind set of seemingly every other coder but me. "I don't want to type out the WHOLE name of this variable so I'll shorten it to something no one will know the full name of but me, while I continue to type out ALL the lines I need to make the code work". I was just wondering why this is a thing
  14. R

    GML Dynamic Script Output

    Hi everyone! It's been a little while! I hope you're all doing well! I've been having a bit of a brain block today, and I was wondering if anyone knew how to set up a script so that the 'location' of the output of a script could be set at the script's call? What I basically want to be able to...
  15. P

    real("2+a") variable in string in real

    is something like this possible a = 5; str = "2*a" b = real(str) show_message(string(b))
  16. Z

    Add A Value To A Variable [SOLVED]

    Hi everyone ! For an integrated variable as "x", "y", or "depth", if you set : "that_variable" = "that_variable" +- "value" It increase or decrease with a speed of "value". My question may seem a lil silly, but I'm unable to simply add a number to theses variables. (Don't think that's the...
  17. S

    GML Feeding variable names into script

    Hello, so I'm working on a cool new game with online networking. I use DS_Grids to keep track of where the players and other objects in the game are and what their status is, things like that. So when it comes to simulating collisions between the different objects, I would loop through the...
  18. T

    Hp help

    Whenever I go to the next room my hp resets back to its maximum, how can I make it stay the same throughout all my rooms? My Player Object's hp code: if (hp <= 0) { ScreenShake(40,2); audio_play_sound(snEnemydie,5,false); room_restart() } My Enemy's attacking code: with(other) {...
  19. S

    GameMaker Change Variables Of Specific Instances

    I want to edit each instances variables depending on factors. I would also like a way to identify them so I can delete specific instances. Anyone know how to do this?
  20. G

    image_index = other.var won't work....

    Hey all! I'm having trouble with this and I was wondering if I was breaking a rule or if there was something else I needed to try. So my ultimate goal here is that if my character is sneaking, and he's by a door, and you push and hold the action button, then each time you tap the forward...
Top