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

gml2

  1. R

    Click to move

    I wanted to make a click system to move to my player. I tried to use mp_pontential_step();, it worked but he doesn't find the shortest path, besides swapping sprites with 8 directions. Another thing ... I wanted my enemies to follow a path, and when they get close to the Player, start...
  2. hans

    Fading Script not working

    Im trying to get a script that when given coordinates,a speed to fade at, and a room to go to afterwards, will fade the scene into another room. I dont think the for loop is intializing for some reason I cant figure out. function fade(x,y,fadeSpeed,roomTarget){ var xx = argument[0]; var yy =...
  3. xDGameStudios

    GML [TEXT TUTORIAL] Array Accessor Explained (@)

    GM Version: Studio 2 Target Platform: Windows / All Download: n/a Links: n/a [PROBLEM] When you create a reference of an array and edit it your original array stays the same and only the "copy" gets modified. [EXPLANATION] There are four different array behaviour you need to understand...
  4. W

    Can't assign a return to a variable

    I made (borrowed) a script for drawing buttons to gui and it works perfectly, except I cannot seem to assign a variable to the returned value. Here is the script: /// @function draw_gui_button_sprite(sprite, index, x, y, width, height, main_view); /// @param {index} sprite The sprite to...
  5. I

    [GML2] why collision group invalid ?

    In document ,this function physics_fixture_set_collision_group(), i set each ball create the collision group all 2 i set mouse pressed left create obj_circle, but them not collision 。 only add collision event ,them can collision. why set physics_fixture_set_collision_group(fix_ball ,2)...
  6. SalTheThief

    Movement in GML2 Mobile

    Hi folks, New to GML2 and wanting to make a 2D sidescroller for mobile devices. I wanted to make it so that, when pressing and holding on the left side of the screen, you move left and when,m you press and hold on the right side, you move right. Releasing makes you continue to face that...
  7. A

    GameMaker A question about persistence

    Hi everyone, this is the first time I post something in the forums and I'm very new to GML (but not to programming). I have a few questions about persistence and what would be the best approach. I'm making a metroidvania (I know it's not the best idea for a first game) and my first idea was to...
  8. M

    GML How to make objects rotate

    Is there any way on GMS2 to make a wand or such rotate? One side stay in one place and the other side changing position to follow the mouse? If i;m not making any sense, it is like the hands of a clock. So far i have used the code image_angle = point_direction(x, y, mouse_x, mouse_y); but the...
  9. J

    GameMaker Help

    I need help the code does not work for the left animation and the idle animations
  10. Q

    GameMaker [SOLVED] Spawning four instances at once

    Hello!!! I came across a problem that when I fire a gun, four instances of a bullet are created at once (each on top of other). I really don't have idea what causing this problem :/ I have a parent o_player obj, which have three childs. Each child inherits whole step event from the parent. At...
  11. xDGameStudios

    Question - IDE When will we have a GUI system, is it planned?

    Hi everyone :D This is a question/issue that lives with me for quite some time. One problem that makes me shift from GMS2 to other engines is actually the GUI support.. every time I start working on a project I approach it using GMS2 as I think it is a powerful and capable tool both for indie...
  12. flyinian

    Change/update two object's variables simultaneously?

    I believe I have narrowed one of my issues down to the below line of code. I am making a scroll system and got help to get the scroll wheel to work(it broke the click on scroll bar but, ill deal with that later). The items in the scroll menu wont scroll when I use the mouse wheel(but the...
  13. flyinian

    update an instance's y position when its in the create event?

    I am currently making a scroll system with the mouse wheel and so far so good. However, I can't figure out how I can go about updating an instance's y position when it's created in the create event. I don't think I can move the instance to a step event or another since it's tied to variables in...
  14. J

    GameMaker Question pls answer

    If I have a random_range(1, 5) can it return 1 or 5, or is it only 2,3, or 4?
  15. J

    GameMaker I need help with switching sprites. PLEASE

    This is my code. I'm trying to make a program that changes the sprite when the variable. IDK why this doesn't work. (BTW I changed it to image_index and sprite_index) if (global.characterselection == 1) { sprite_index = sPerson1; } if (global.characterselection == 2) { sprite_index =...
  16. V

    GameMaker Loading strings from a text document GML2

    How would i go about loading this text document list into an array inside of game maker? It only needs to happen once in the game code It's a list of almost all words of the English language. Is there maybe a better option then loading it into an array?
  17. D

    GameMaker [SOLVED] State Machine Not Working Correctly

    Hey guys... I have this issue on a state machine. I'm trying to figure out how melee attacks work and I came across this error where I finish the attack animation but the state doesn't change. This is part of the attack state on my player object: sprite_index = sPlayer_Attack...
  18. S

    GameMaker FOV not quite right

    Evening all, I am hoping someone can help. Following code based on http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#mycode I have put something in place, though it definitely doesn't work as hoped! I'll be honest, whilst I wrote all the code out while following an example...
  19. xDGameStudios

    Discussion [RESOLVED] gml_pragma to instantiate object

    Hi everyone, when using: gml_pragma("global","script_here();") if the given script instantiates a object, the runner crashes. Is this the way it should be?! I'm using the latest update RunTime 2.1.4.218. I came across this because I'm creating modules that need a certain object to be...
  20. J

    Pushing box problem(works one way not other)

    I'm having a problem with my gml script. the objective is to when my sprite walks into the cube it moves in the same direction. but my cube travels through walls and only works when moving right, pushing the cube left results into it moving to the other side of the sprite(left to right). My...
Top