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

gml 2

  1. D

    GameMaker How to move a object to a coordinate

    So, im really new with the engine and I have really little experience with java so i ask sorry beforehand for my english and my newbie skills. Anyway im trying to make a title screen, so I made a sprite with the the tile put it in an object and put it in the first room, I made some lines of code...
  2. H

    GML [SOLVED] Top down shooter bullet direction problem

    GMS 2 IDE v2.2.0.343 Runtime v2.2.0.258 Hi! My teacher gave me some code to figure out on my own, but I have gotten really freaking stuck on one little bit of the game. It's a top down asteroid shooter, and everything works the way I want to, exept when i fire a shot, the obj_shot goes the...
  3. T

    GML Reading JSON files in gms 2

    I had the idea to make a game, where you could have the game window, and another comand prompt open. in the command prompt you could type in programmed commands that would edit variables in a json file. i've fully coded the command prompt in python and it works well, but how do i load variables...
  4. A

    Bullets not appearing

    Hello all. I am making my game via the Gamemaker 2 Shaun Spalding tutorial with minor adjustments for my liking. I have just finished it making the spawners but when I ran it, no bullets were shooting out like they have been for most of the project, in fact its only been a problem until now. I...
  5. S

    GameMaker Calculating Fov from a ds_grid

    Afternoon all, I have my world info stored in a ds_grid as a bitmask and my entities are mapped on to another ds_grid. My intention is to track what tiles are currently visible by recalculating the field of view (FOV) whenever the player ends a turn in a different space to where they started...
  6. T

    GameMaker ds_map_find_value and json parsing

    Hello, I did try to get some information from a push event, but I don't know how to handle the json inside the returning "data" structure. var data = ds_map_find_value(async_load, "data"); show_message_async("Data:#"+string(data)); "data" contains json as far as I can see. I would need to...
  7. J

    GameMaker obj moves towards player then orbits it?

    Hi, my question in GML: I want to have an object orbit or swarm around the player object once it reaches it. My hangup is after the collision occurs would I then just use lengthdir to create the orbit? Or is there a simpler way? JB
  8. EricPB

    GameMaker Launching along angle [SOLVED]

    var _dirlaunch = point_direction(x,y,o_tongue.x,o_tongue.y); var _launch = 20; hSpeed = lengthdir_x(_launch,_dirlaunch) vSpeed = lengthdir_y(_launch,_dirlaunch) Above you can see the code I am using to try and achieve my purpose, below it is a diagram for the intended effect. This code exists...
  9. M

    Code Review

    Hello, I am extremely not used to posting and am totally new to GameMaker. Could you please help me? This code is ok, but the top and bottom collisions are not really accurate, and the code seems to not really be the best that there is. Here is a part of my code: #region input...
  10. xDGameStudios

    Discussion [REQUEST] A way to import multi-script in single file

    In GMS1 it as possible to use #define to create scripts inside single file. Is there a way in GMS2 to import a *.gml with multiple #define scripts into GMS2 that automatically separates it in diferent files? This would be extremely helpful sometimes when coding it is nice to have everything...
  11. V

    "Unexpected Syntax Error" using mod

    Hi everybody, I'm trying to create an on-screen stopwatch, and I have an error coming up when I try to use "mod." Here's the line of code with the error: s = s mod (rs*60); All it tells me is that there's an unexpected syntax error. Does anyone know what's wrong? Thanks in advance!
  12. V

    Picking a random sprite without duplicates

    I am incredibly new to programming, and I am trying to have the game pick a random sprite from the image index without having any duplicates. I have the randomization working just fine, and I know I should use an array to do the rest, but I don't even know where to begin with that. This is what...
  13. Donald Harris

    GML [solved]Need help with an 'Unterminated String Literal' error

    The following: var str = "\" Throws an 'Unterminated String Literal' error. This applies to any string where a backslash follows a quotation ending.
  14. xDGameStudios

    Discussion [SUGGESTION] instance_is_deactivated

    Hi everyone, I would like to suggest and ask you how do you approach this "problem". You have a custom structure (defined as an array) that needs to be freed if the target it operates on is destroyed. example: my_structure[0 /* target */] = instance; my_structure[1 /* velocity_x */] = 2...
  15. O

    GML Possible json_decode memory leak?

    Hey everyone, I'm having a memory leak issue when using json_decode but only when the top level structure is an array. I'm finding the leak when I use game_restart() which is leading me to believe that some of the nested data structures generated are not actually being destroyed when I destroy...
  16. P

    Trying to get Hitstun/Hitstop to work

    Been spending some time trying to get a hitstop function working and I am extremely close but just barely missing the mark that I need to hit. Object.Hitstun if global.hitstop { var time = current_time , ms = 120; do { } until( ( current_time - time ) >= round( ms ) ) {}; return (...
  17. J

    GameMaker Collision Problems

    v2.1.4.285 I am using a basic collision system(place_meeting) for my 2d platformer. But due to my tileset having to be snapped to the grid(middle centre) for edges to of tile to show. and I use a !visible object that acts as walls and floor. but I have to use 4 different objects to cover the...
  18. N

    GML [GMS:2] [SOLVED] Weird issue regarding arrays and grids

    So, here's my situation: I have created an array to store details about the actions chosen by a player for a turn based combat system. An example of how this was done would be: actions[count,1] = 0; as you can see, the value of this particular array index is an integer, specifically 0...
  19. C

    GameMaker Help!Combat

    I need help on how to create a fighting system for my fighting game but don't know how to pull it off please could anyone help since I am really new to gml
  20. N

    GameMaker switching between shaders

    Alright, so basically I have an object dedicated to applying a shader at a certain depth, and it resets it at another depth. Now I have multiple shaders and this doesn't work the way I want anymore, my code for changing shaders in specific objects is down below. My setupUniforms function...
Top