gml 2

  1. flyinian

    (solved)Help with keeping a contextual menu on screen

    I am trying to create a contextual menu and so, far so good besides the fact that I can't figure out how to keep the sub menu open(active?). Menu 1 > sub menu 1 > item 1 , item 2, and so forth. The sub menu is the list of item 1, item 2 and so forth. Mouse Hover on Menu 1 > Should open the sub...
  2. Evan Kinsler

    GML [SEND HELP] Problems in writing code for Button commands and Direction arrays.

    Now, I don't notice what is going on with this current code I am writing. The exact process I folloowed while writing this code is this: -- I create a room, sprite, and an object as a sprite to be used in said room. For the object, I create an event following the following code: left[0] =...
  3. L

    GML Producing text files for the viewer to read

    Hello, I'm working on a short experimental game using Game Maker Studio 2 on Windows! My goal is to have it create and write additional text files that are visible and accessible to the player in the game's folder at certain points throughout the game, however I am not sure how to go about this...
  4. R

    GameMaker Best way to create enemies attack patterns. Shoot em up

    Hello. I am using GameMaker Studio 2.2.1.375, and I am new programming games. I am programming using GML. In this moment I am creating a Shoot em up, and I have a doubt about the creation of enemies attack patterns. I can use Timelines, alarms... Do you know what is the best way to manage the...
  5. J

    GameMaker If statement being ignored in collision event

    Hi guys, first post here, be gentle. I'm making a platformer where the two main mechanics are jumping and kicking. When you kick an enemy while it's in it's walk state, it goes flying away from you in an arc before colliding with the floor or a wall and destroying itself. When you jump on an...
  6. C

    GameMaker Pathfinding: travelling between diagonally adjacent forbidden zones

    Hi folks, any thoughts on the following problem are greatly appreciated! This post comes with the common caveat: noob at this, please be patient :) My aim: to get an instance to pathfind between diagonally adjacent corners of tile-based obstacles. The problem: with mp_grid forbidden zones (in...
  7. D

    GameMaker Enemy collision crashing

    Whenever I my enemy object collides with my player object the game crashes with this error: ___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Step Event0 for object oEnemy...
  8. A

    Question - Code Decode GML file?

    My computer crashed while in GMS2 and now it only loads up some of an objects events, the rest are blank. I'm wondering if there is a way to read the GML file so I can copy the code out of it. Steve
  9. M

    GML Help with FOR LOOPS

    Hi All, I am making a game. The player has no hp at the start, but with each 3 hearts that he gathers, one hp is added. I tried with if statement, with do... until, and I tried a for loop, but nothing seems to work. It either adds just one hp and stops there, or keeps adding infinite number of...
  10. E

    GameMaker Small problem on the Space Rocks Tutorial GML for GMS2

    I just finished the game and it works perfectly but I have a little problem, when I start the game there is small squares inbetween and at the left of the text (https://i.imgur.com/UVDJGEV.jpg), how do I fix that?
  11. W

    Bullet not always destroying enemy

    So I've been trying to destroy my bullet after it hits an enemy (the enemy should disappear and a short death animation will play). However, sometimes the bullet hits the enemy and the death effect will play but the enemy is still there and it can take multiple shots before the enemy disappears...
  12. Lord KJWilliams

    Can you make a game booter in GMS?

    I want to design a program in GMS ( for Windows ) that lets you load other games made in GMS. It displays a list of games in the form of a menu, the user selects the game, and them program loads the game. When the user quits the game, the game menu is loaded again, lists of games that the user...
  13. R

    GameMaker Making a dynamic laser

    Hello, I try to create a beam that suits all types of surface in Game Maker Studio 2, so far I have the following code: while(!collision_line(x, y, x+lengthdir_x(long, image_angle), y+lengthdir_y(long, image_angle), obj_block, 1, 0)){ long++; if (long > room_width+room_height) then...
  14. A

    Simple Code not Working

    Cant for the life of me figure out why this isn't working, and I'm sure the answer is simple. Here is the code below, the card var is supposed to change when pressed, but both of their values are staying null (0) when pressed. The error I believe has to be within the step event for that to be...
  15. D

    GameMaker [Solved] Find a certain sprite in Assets Layer

    Hello people! I have another issue... I'm trying to find a certain sprite I placed on an asset layer, the problem here is, for some reason I can't find them. I tested with certain functions like "layer_get_id("Assets")" in which returns 1, so it found the layer. But when I actually look for...
  16. D

    GameMaker [SOLVED] Check if I came from a certain room

    Hello guys!! So... I have this issue... In my current project, I'm trying to know if I came from a certain room, so I can destroy the transition object to that specific room. I thought making it with global variables, but I failed. Hope you can help me!! ^^
  17. O

    GML I'm new to programming and need some help.

    I'm trying to make a textbox appear when I get close to an NPC but when I get near it and press E it crashes Here's the code I did I'm sure I screwed up, I just can't find out how. if distance_to_object(obj_player) <= 5 { if keyboard_check(ord("E")) instance_create_layer(100, 100...
  18. O

    GameMaker How do I make the start of an RPG battle system.

    I wan't to make an enemy go towards the player when they get to a certain distance near them and when it makes contact with the player takes them to a battle screen with the character and the enemy on screen. I'm going to just attempt this before adding any kind of ui or options to the screen.
  19. P

    GameMaker [SOLVED] Put all values of an array into a function

    I am pretty new to using GML, and after reading the Array section of the manual multiple times, I'm still lost here. I crated a local variable as an array, with 2 objects currently in it, which are the different objects the player can bounce on. My idea when creating the array was to have an...
  20. C

    GML [SOLVED]The scripts is keep looping itself without the 'repeat' function

    So, I try to combine Beyond Us Games' s multi dialogue system with FriendlyCosmonaut's cutscene system. The abomination actually works for the most part. The problem is when the time comes for scrCutsceneDialogue, the game created a lot of dialogue boxes, this is evident because I programmed the...
Top