1. Joky

    GMS 2 [SOLVED] I'm kinda new and i'm not sure what to do here.

    I might sound pretty stupid asking this so sorry about that. But I'm trying to do this: Player obj walks to vault obj and presses z and it changes (escapedoorlocked = true) - (escapedoorlocked = false) But it doesn't work for me. So can someone help me? I'll post code if needed.
  2. D

    Comparing 3 or more variables.

    Hello, guys. I didn't found any info about it, so I ask it here. I have character, which can gaim genetic points of 3 types: red_gene, blue_gene, green_gene. I need to compare all three variables to find the highest of them in case to change color of the sprite to relative one. I know how to...
  3. O

    GMS 2 How do I make a variable hold it's current value in one instance and have it change in another?

    I'm having a script basically repeat itself to draw text in a certain way but when I try to have it run the text won't be placed right create _x[0-3] _X = 0 script draw_text(_x[_X], y, "text"); so what happens is the word goes flying across the screen or is stuck in a loop when I program _X...
  4. F

    Windows Problem with variable

    I´ve got a problem with variables. When i set global.enemyspeed = 2;, and then into the enemy object-step-alarm[2] = 300; Alarm2-global.enemyspeed +=2 alarm[2] = 300; But in the game, the speed is on +2 until next enemy spawns. When next enemy spawns the speed is again on 2. The game...
  5. J

    Points jump to 1640 at the start of a room?

    Hey guys, So I have a shop and points feature in my game. When the player kills enemies he gets points depending on what type of enemy! You get ** points per level which reset if you die or leave the level. When you move to the next level is when the points from your current level get added to...
  6. oldnoob

    Globals - what am I doing wrong?

    I'm ill, fuzzy-headed and simply can't see what I'm doing wrong here. What does 'variable xxx only referenced once' mean? This is the gamestart event of a controller object. Am I doing something or can I blame it on the latest GMS2 update? Many thanks,
  7. K

    Variable doesn't let itself update from multiple different objects

    Hello! I have a problem with my Project I can't really explain it here's a video: All Variable are globalvar's I am a beginner so sorry if this is a easy problem
  8. F

    GML Scene slow loading causing system not to find object

    See I'm working on a RPG was working on the battle system. As the title suggests the scene is actually loading in milli-seconds but function called in micro-seconds so the point is that the title might not be so APPROPRIATE to the discussion. My script: ///@desc battle_enemy ///@arg name...
  9. D

    GMS 2 auto-aim to enemy when he exists or is inside view

    the title says it all. I've made my player shoot to an enemy whenever he(player) is in the air. It all works great, but I don't like the fact that it will still auto-aim to enemy's that are really far away and out of the view. I've messed with it a bit but I end up creating a error since the...
  10. M

    "Trying to index a variable that is not an array."

    I looked for the problem and at first i thought is was in the create event but it wasn't, at least not the main problem. and then i tried looking elsewhere like the place it mentions another problem, my draw script. And here it is: var num = argument0; for (i = 0; i < num; i += 1) { if...
  11. M

    [solved]how do i make all variables return to their initial state?

    i want a script to make all vars of a single object return to what they were in the create event, but with some exceptions like HP, if there is a way to do that without making all variables go to their original state one by one pls tell me
  12. Suzaku

    GMS 2 Why some people use variables like "hsp" and "vsp"?

    I ve seen some people using those variables like that to store hspeed and vspeed, or "grav" to store gravity value and so on. Why they use those variables?How much is that helpful?
  13. giraffeman210

    Drag And Drop Player in game typing

    Can I make a way for the player to type something in my game? I would like the player to be able to type in a number and it sets a variable to that number. I am using GMS 2 and DnD Thanks!
  14. G

    GMS 2 Multiple collisions: getting a value from one instance

    Hello everyone! In my game, the player object may happen to collide with multiple instances at the same time. All of those instances come from a same object, but some of them may carry different values for the same variable. What I need to do is to take the highest of all those values and to...
  15. Smenkare

    ds_map question

    I have equipment system written in ds_map. When i click in inventory some piece of armor i have code similar to this. with(oPlayer) { oPlayer.sprite_index = ds_map_find_value(armory[0],"spriteIdle"); oPlayer.equiped = ds_map_find_value(armory[0],"attackSprite")...
  16. I

    GMS 2 How to set variables for clones of the same object?

    So I am working on a fighting game, and in it (of course) I want to have two players to fight against eachother. The problem is that I have 2 instances of the same object and they both use the same controls. How do I make them have separate "moves"? (I would give some code but I have no clue on...
  17. FacesOfMu

    GMS 2 How to find where/when a variable changes?

    Hi all, I've got an object that seems to change it's layer to -1 at some point and I can't find out where this happens. I've tried searching all uses of the word "layer" in my code to see what each line does, and nothing seems to indicate where the change is happening. I've even added a debug...
  18. X

    GMS 2 enemy code isn't a constant?

    i'm trying to make enemy code (i'm using Shawn spalding's tutorial for melee attacks) but when i try to star the game it says the enemy state should be constant. but i can't make it constant because i'm confused. switch (state) { case ENEMYSTATE.FREE: EnemyState_Free(); break; case...
  19. Pfap

    variable argument scripts

    I have been over the manual sections about scripts and passing arrays to scripts. Maybe I missed something, but I'm making this posting not because I'm having trouble finding a solution I already know of several work arounds. I'm making this posting, because I want to finally figure out how to...
  20. J

    Question - Code Changing the speed of an object also changes the x coordinate

    In a game that I am making I made a flamethrower that spews out little flame objects, but while testing the game I found out that some were getting spawned slightly to the right of where they should be spawning. After I looked through my code I was confused by the fact that nothing should be...