gml

  1. R

    SOLVED Difficulties with 2-Dimensional Array

    Hello, I am attempting to utilize a 2D array for a top-down shooter game. Essentially I have a sprite-less object which is the "director" for the enemy spawning algorithm and I am wanting to initialize the array to store the "points" assigned with each unique enemy. Then I will assign a maximum...
  2. G

    GML [Solved] Suggestions on how to create an "scratch-off ticket"-like effect

    Hello everyone! I want to create something like one of those "scratch off" tickets, where you uncover a portion of a graphic based on where the mouse is. I thought about using a surface to help create a mask, but since they are volatile, all the uncovered bits are lost when focus is lost. I...
  3. El Maul Cosa

    GML gp_select not working on Android

    Hello, i made an instance that deactivate an instance layer for the UI if you are using an gamepad in Android, for some reason the select button doesn't work to do that, other buttons like start or the buttons that i put in this code are working perfectly. Is there a way to use "gp_select" on...
  4. The Water Is Shallow

    GML Can I use the value that only exists in some items in the struct?

    { textArray:[ {text:"text1"}, {text:"text2", color:c_aqua}, {text:"text3"}, {text:"text4"}, ], defaultColor:c_black, port: SprPortChar1, name: "Char1", nameColor: c_black, } << It can be awkward because it's written in a translator >> I...
  5. I

    GML Fonts not working... but only in certain places

    Hey all. I'm running into an issue with my fonts. I have 10 buttons for a level select - each one is using a base class for buttons that has a defined "button_text" string variable to draw as text. Here is the parent's class draw event: draw_self(); //draw self draw_set_font(fnt_btn); //set...
  6. AceKiron

    GML How to make the player fall through semisolids when not standing on top of them?

    I'm making a 2D platformer and am also using semisolids (you can move horizontally through them, and you can move vertically up when colliding with them, but not fall downwards). However, when the player is not standing on top of semisolids but still colliding with them, I want them to fall...
  7. I

    SOLVED Making a timeline read more than one line of code

    Hey all, first time posting so bear with me. I have a timeline for a cutscene that has the following code: //Draw character draw_sprite_ext(spr_matilda_explain_mclose, -1, -32, 96, 1.349091, 1.411429, 0, c_white, 1); //Draw First Batch of Text //Set needed variables draw_set_color(c_white)...
  8. G

    How can I save function to a JSON file?

    Hello! I have an inventory: function createItem (_name, _description, _effect) constructor { name = _name desc = _description effect = _effect } itemList = { item : new create_item ( "Name", "Description", function() { // adding to...
  9. S

    SOLVED GML Dynamic Camera Zoom Help

    Hey guys, I have a camera I set up based on FriendlyCosmonaut's video with a few adjustments here and there. The main mode I use for my game is the follow mouse peek, where the camera is centered on the player but moves a bit toward the direction of your mouse. What I want to happen is when I...
  10. rui.r6o

    GML Get ID of executing function from within it

    Is there a way to get the ID/reference of the function that is currently executing? Simple example: var fn = function() { var recurse = /* ??? */; if (choose(true,false))) recurse(); } I'm trying to build an advanced runtime reflection based system, but the only thing that is...
  11. grsegames

    GML Basic tile collision problem

    I'm having issues with Tile Collision. The issue I'm having is when I create a tile set for auto tiling, the player is moving through the tile on the top left and top right corner of the tile. But the others seem to be unaffected. Here are pics and description of the problem in detail. First I...
  12. G

    GML Is there a way to get the audio sample being sent for playback, or its file name/path?

    Hello all! I'm working on a game where music is a strong aspect of both gameplay and visual style. One of the effects I want to do requires knowing what is currently playing (or about to be played) to create an effect from it, much like a visualizer. 1) Is it at all possible to poll any part...
  13. S

    GameMaker #SOLVED How to query object above instance

    Hey there! I would like to put in a ledge grab mechanic for the player, so I'm trying to find if there is a wall object above the instance of the wall that the player is currently colliding with. The methods I've tried haven't worked out so far. Most recently I've tried if...
  14. The Water Is Shallow

    GML Can a random function produce the same value as the input value?

    randomTextArray = [ [ "random text1", ], [ "random text2", ], [ "random text3", ] ]; text = textArray[floor(random(array_length(randomTextArray)))] < It can be awkward because it's written in a translator > I used a random function to implement...
  15. G

    GML How to store a function WITHOUT running it within an array?

    Hello. I am currently making an RPG, and am working on turn-based battles. As a part of this, my enemies and all their related data are stored as Structs within the main battle object when battle begins. Their 'actions' are determined through an array of functions (as shown in the image) and are...
  16. D

    SOLVED Help! room is overdrawing

    basically im making a sniper game for a gamejam, and everything were working propely, until i make more levels //in control create event global.complete = false; global.chances = 3; next_room = -1; //in control step event if (global.complete == true) && (!instance_exists(obj_stage_finished)){...
  17. C

    All enemies die when I kill one

    Gun code: BB Create firingdelay = 2; recoil = 2; x = obj_player.x; y = obj_player.y; image_angle = point_direction(x, y, mouse_x, mouse_y); begin step x = obj_player.x; y = obj_player.y; var _dir = point_direction(x, y, mouse_x, mouse_y); var _diff = angle_difference(_dir, image_angle)...
  18. J

    Object: obj_inimigo Event: Step at line 5 : got 'if' expected ':'

    I have the following problem: Object: obj_inimigo Event: Step at line 5 : got 'if' expected ':' Object: obj_inimigo Event: Step at line 5 : got '(' expected '}' The code is: var range = 300 switch(estado){ case "parado" if(distance_to_object(obj_player)<= range){...
  19. SkyBuilder1717

    GML 3d bug - background tiling don't work

    When I was doing 2.5D, my background stopped being extended by X and Y (Tiling has been turned on)
  20. K

    GameMaker How do I do Object Rotation with a gamepad? (GML Visual)

    I'm working on trying to make a twin-stick shooter-styled game in GML Visual, and I'm having some issues getting it working. I've got movement down entirely, but my big issue is the gun itself! I'm trying to set up a pointer that'll rotate around the player to tell them what direction they're...
Top