• 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. 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?
  2. 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...
  3. A

    Stay with a same walue when changing room

    Hello ! My hero got 3 hp and when he lose 1 hp and switching room he got 3 hp ! So plz help me to know how make in way than when he is changing room he stay with 2 hp ! I'm using the room_goto command (i don't know if its usefull to say that because i seen another way to change room) so is that...
  4. Y

    Legacy GM variable not set in irrelevant object

    So gamemaker is saying that I'm not setting a variable in a object that isn't even related to the code. here is the code: with(Obj_Mognorian_Spawner_Forest_1){ switch(global.Selected_Mog){ case 1: MogOne.Hp -= irandom_range(MogOne.Damage_Min_Rec, MogOne.Damage_Max_Rec) case 2...
  5. A

    Windows Crash because "unknown variable" wasn't set

    I am creating a little game and now this crash appears: But when the code on the named position has already been run a few times. I don't understand how to fix this crash. Any help? The Code: (all variables used in the code have 100% been set before.)
  6. S

    GameMaker Player Inputs Setting to True?

    I have this input script: key_attack_lmb_up = ((((point_direction(x,y,mouse_x,mouse_y) >= 45) && (point_direction(x,y,mouse_x,mouse_y) < 135))) && (mouse_check_button_pressed(mb_left))); key_attack_lmb_right = ((((point_direction(x,y,mouse_x,mouse_y) >= 315) &&...
  7. J

    GameMaker Not Recognizing Defined Variable (???)

    Hi there, I'm an intermediate GMS2 coder and have come across a bug that I cannot figure out for the life of me. I've used this technique many times and I have never had this issue. What I'm trying to do is simple: Create an instance from another instance, then set variables for the new instance...
  8. M

    Game Mechanics troubles with a rogue-like game

    For a school project I'm making a rogue-like game based on the mobile game which is turn/gridbased Unfortunately I'm having some problems with the changing of the turns and I'm wondering if anyone has some tips to make my game work. I've thought of a global variable or something to check if the...
  9. A

    Legacy GM [SOLVED] Score only adds once

    HI there, Ok, in my prototype you use your cursor to move player and collect objects while avoiding others. Now each time I collect "obj_col_1" I want it to add +1 to my variable "Score" (not built-in "score"). But at the moment it only adds +1 after the first collection and then it stays at...
  10. S

    GameMaker How to create attack animation?

    Me need a add animation attack, when i tap "E". What variable does this???
  11. N

    Showing message string and variables

    I thought this code would have worked but it didn't, can someone please help me with the right way to do it. show_message("Level Status: "+room_caption+"#Coins Remaining: " +instance_number(Coin)+"#Fuel" + health);
  12. A

    GML All children of a parent share the same variables..? [SOLVED]

    I have a variable called hp. It's on the obj_slime create event. The slime is also parented to par_enemy. The problem is that, I have an attacker, and I don't wanna copy huge chunks of code for every single enemy in the game. So I created a parent for all enemies, and the when the attacker...
  13. Daniel Mallett

    send variable name

    does anyone know how to send a variable name rather than it's contents to a script. I want to achieve the following. Hopefully that makes sense. spt_script(variable_name); -------------- script -------------- argument0 ++;
  14. Z

    Legacy GM [SOLVED] variable = function

    I'm beginning my endeavor into networking and have been coming across many a code containing something I don't entirely understand and have been unsuccessful in finding a definitive answer to. When defining a variable as a function, what is it being set to? Is it coming up with a value that I'm...
  15. D

    Legacy GM Question on organizing large arrays

    Hello again. I am trying to figure out if my current method is the most efficient and organized way to store complex variables or if there's something I am overlooking. My enemies have attacks. Each attack has to store: 3 or 4 separate integer values (If less than 5, do X. If less than 8, do...
  16. X

    GML Is it possible to create a variable with a name that is the value of another variable?

    For my game that involves networking, all I've been doing in terms of vital data storage and retrieval is just create some ds_maps (They may be tedious sometimes, but I like them, now that I fully understand them) and store various pieces of data as keys and their values in various different...
  17. T

    GameMaker 2 Variables Turn into 1 Help

    Hello Im trying to make a system so that i can turn two variables into one Sorta like this R1E=1 R2X=3 R1EX = R1E And R2X =================== R1EX = 13 =================== or another example R1E=5 R2X=9 R1EX = R1E And R2X ==================== R1EX = 59 ==================== Anyone know of any...
  18. T

    Question - IDE Debugger and Temp Variables

    I must be doing something wrong, for when I am in the debugger, I cannot see the values of temp variables -- even in the watch window. I am on a Mac if that makes any difference.
  19. Didjynn

    how to have access to a variable inside an object called with a variable ?

    Hello everybody, I began to create a "scan system" for my game. So I have a lot of instances of an objet which have a sprite of a 32*32 square. Each of these square contains the code to scan all instances around it (8 possible instances around). so I made this : if faction = 1 { if...
  20. A

    true false for bullet instances

    Hi guys, Lil "ammo issue" here... Where / what would be the best method to store a true/false state of one bullet of thousands? (This means for every instance, ever created) I have a basic setup for it and it works, but they're moving SO fast and registering at their target properly Buuutt...
Top