gml

  1. GLITCHGOO

    GMS 2 Various questions

    1. How do you detect if an instance is touching another instance? 2. How do hitboxes work? im more used to having 4 seperate hitboxes each detecting which is touching which, but if theres an easier way im all ears! 3. How do you "shrink" a sprite? (i.e. a pixel art sprite and a normal art sprite...
  2. Waldemar Lima

    GMS 2.3+ Where can I find the internal GML callbacks available so that dlls can call them?

    Hi guys, I'm trying to create an external DLL, and I would like to know where I can find all the callbacks available in GMS so that external libraries made in C++ can use them externally. callbacks example : typedef void(*GMLAsyncFunctionPointer) (ds_map_ID, int); typedef...
  3. L

    Pls Help

    Wich tutorials should I read/watch to learn GML without copy and pasting? What level of skill is required to develope an indie game like UNDERTALE? Please I'm new in this coding world!
  4. Armored Dragon

    GML Binding Of Isaac-like Map Generation

    Well, I'm having some problems figuring out how to make a procedural map generation. What I know is that I want map gen like in Binding Of Isaac, where you have a list of pre-made rooms to generate the map of each floor. The Algorithm is simple (in theory, of course): Before the Floor start...
  5. PixelMochii

    Issues with storing Hex Colours in an array

    Hiya, I'm attempting to store a bunch of hex colours into a 2d array so that I can access them later to randomise colour schemes, but using the $ symbol in my array returns an invalid syntax error. Does anyone know how to store colours in this form without gamemaker hating it? the 2D array I...
  6. IcyIcing

    How to make player stop when interacting with npc

    In my game, when the player interacts with a npc I have an arrow that lets them pick options but each time it moves up and down the player also moves. This is the same when I press left to right. When this happens, the textbox follows and player but the text on the main textbox will stay where...
  7. Krazytv

    GML var _txtb_x = textbox_x + text_x_offset[page]; giving me an error message

    Hello! I've been following this tutorial pretty closely and I've been having problems figuring out why this error is happening https://youtu.be/6Bzj7GdSkJI So far besides this one, there haven't been any errors ___________________________________________...
  8. B

    SOLVED Help - Loading JSON level data into a 2d array

    Hi all, I'm having issues in trying to work out how to read a JSON file into a 2D array. I've written code to set up a JSON file containing all of my level data for all levels of my game. The basic idea is that I have an array with a level number and then I have a struct within that level array...
  9. Lightmind

    Getting a variable from 2 different objects.

    Sorry if the title isn't clear enough for what I'm about to say. Basically, I want my player to take damage when touching an enemy. So, the player hp - enemy dmg, but I don't know how to put 2 variables from different objects into 1 line of code.
  10. SymbolShift

    Modifying contents of a tile (colour and shifting)

    I've searched the manual and forum and I'm unable to find an answer to this one, however the answer may be a flat out "no can do". I've attempted to visually simplify what I'm trying to achieve in GML (with GMS 2.3.6.595) Assume I have an 8x8 tile (as illustrated): 1) Is there any way to...
  11. MartinK12

    SOLVED Rotating rectangle collision - Top Down Tank

    I have problem with detecting collision when Top Down Tank is rotating near wall, I use rectangle with rotation mask. I have this code for the right side direction. The problem is when I press d once it shows no collision. But in the next step tank is already inside a wall and stuck. I do not...
  12. KyleRansford

    GMS 2.3+ How to Move an Object that is Following a Relative Path?

    For instance, I have a game with an auto scrolling camera, and I want to have an enemy appear and stay on screen while following the same speed as the auto scrolling camera. But, with the normal relative path function, the object just stays where it's at following the path no matter if I put y...
  13. Lightmind

    Weird double jump that isn't meant to be there?

    Basically, I have made code for jumping. But, if I press the jump button twice quickly, it does a double jump for some reason, and I need to fix this. I am making a metroidvania, so you can probably see why a double jump isn't going to be good at the start of the game where there would be so...
  14. Lightmind

    Why am I getting a weird double jump?

    When I do jump, he jumps, and if I quickly press the jump button, he does a short hop. But, if I do a short hop, then press the jump button again, he does a weird double jump, making him jump higher. As I am making a Metroidvania(inspired by Hollow Knight), I can't have this. Is there any way to...
  15. S

    GML How to Trigger an Object to Move?

    I'm currently experimenting in GMS2, and I've been trying to find a way to make an object move when called to do so by the player. The way I set it up is, I made an object disguised as a floor tile called "obj.SpearTrigger". Ideally, this object, when stepped on by the player, will cause another...
  16. H

    SOLVED draw a sprite on all objects

    To make doors in my game, I use 'draw_sprite' to draw an animation on a object (the object itself doesn't have a sprite assigned): draw_sprite(spr_door_animation, image_index, obj_door.x, obj_door.y); When placing multiple 'obj_door' in my room however, GameMaker chooses the coordinates of...
  17. Lightmind

    Why is my player freezing in midair when attacking?

    I've got a moving, jumping , and attacking player. He can attack on the ground fine, but when I jump and attack in midair, he freezes in midair, mid-animation, and im not sure why. Any help appreciated. This is my script: if (attack) state = PLAYERSTATE.ATTACKSLASH; Script code: function...
  18. L

    Get Result of Async / Promise from JavaScript in Gamemaker

    I'm trying to get an result from a fetch in gamemaker. I have a client.js file with the following code: async function getMap(id) { const data = await fetch(`http://localhost:3000/map/${id}`) const map = await data.json() return map } /* Maps looks like this: { id: 1, name...
  19. Lightmind

    How do make an if statement to check if a script is running?

    Basically, I have a script called PlayerState_Attack_Slash and when i press the X button, it runs the script doing an attack. How would I make an if statement in the player or enemy to detect if the enemy is colliding with the player during the attack script e.g. if (obj_player is in...
  20. N

    SOLVED Having trouble with application_surface_draw_enable

    So my game has an object that sets application_surface_draw_enable to false and then apply some effects (shaders and stuff) to the application surface, drawing it to the screen in the post draw event: gpu_set_blendenable(false); draw_surface_ext(surf, window_get_width()/2 - (app_width*scale)/2...
Top