gml

  1. GGJuanPabon

    GML What functions do you recommend to me to explore for this game?

    So far, I have only done platform games, with remote control (Up, Down, Left, Right). But now I want to do something different. Something like this. It works by clicking or touching where I want to go. With 3 important points. 1) With Click or Touch I move to the point. 2) I avoid...
  2. A

    GMS 2 Only One Item Is Drawing In My Inventory.

    I'm sorry that I have to make another thread so soon. This probably wouldn't have happened if I remembered to make a backup as I usually do before adding something else and I made too much progress to go back to a previous version. So, still following the same tutorial from last time (though I...
  3. Kiwi

    3D Rotate sprite from centre, not from side (GMS2) [SOLVED]

    I'm playing around with 3d at the minute which is quite fun, I've learned how to use vertex buffers and formats to create walls, floors, etc. I'd like my npc's to always face the player, but they seem to be rotating from the side rather from the middle for some reason. I've made this npc spin...
  4. A

    [Solved] My inventory stopped drawing and I'm unsure why.

    I've been trying to get help for this for a while now. So there's that. I've been following this tutorial (but with some things removed to fit what I wanted). I finished the second part and decided to mess around a bit by changing the inv_slots = 15; to "inv_slots = 10" but then it broke; the...
  5. ai_ash

    Problems with for loop in DRAW-event

    Problems with for loop in DRAW-event Greetings, I’m new to coding and wrote my first line of code only a month ago. Been following tutorials on Skillshare & YouTube and currently taking baby steps still. So, I want to draw a grid (tower defence game) in my room and for some reason just can’t...
  6. Alaska Minds

    Object Sprite Direction Tutorial (8 Directions)

    GM Version: Studio 2 (Possibly later versions of Studio 1) Target Platform: Any Download: None (Code below) Links: round(), point_direction(), switch, sprite_index, image_speed Summary: Hello all I'm going to show you how to change your Object's sprite, based on direction. It all starts...
  7. Fluury

    GML Having an instance follow a path starting from a specific point in said path.

    Heya! I've got an issue I need to deal with, but sadly can't put my finger on on how to tackle it. I have a path made up of several points. For each of these points, I sometimes spawn an instance on the exact x/y of said point. This works fine. When the player enters the range of the...
  8. D

    GMS 2 Point to move Sprite animation

    Hey. Trying to make a click to move type of game in Game Maker 2. (GML) I've managed to program the moving itself. But need help programming the character changing sprites based on the direction it is moving in. The character has 4 directions. Left, right, Up and Down. Is here any way to make...
  9. L

    GMS 2 Help with isometric grid calculations

    I'm working on an isometric grid and I thought I'd cracked the maths but I've hit a wall. I'm using draw_line_width() to draw a simple Cartesian grid in the centre of the screen: global.GridLeft = (room_width / 2) - ((global.CellWidth * global.NoOfXCells) / 2); global.GridTop = (room_height /...
  10. Alaska Minds

    Easy Enemy AI (Idle, Chase, Attack, and Flee)

    GM Version: Studio (All) Target Platform: Any Download: None (Code below) Links: Example gif of the code below: https://alaskaminds.org/2020/02/11/game-maker-easy-enemy-ai-idle-chase-attack-and-flee/ Summary: Hello All! I'm going to show you how to create an enemy object that will Idle...
  11. A

    Adding & Deleting Fonts

    I've been getting back into game development using GMS 1.5.x and I want to double-check: I don't recall ever needing to delete fonts, and as a result, I want to know: When should I be deleting fonts? Typically I'd be doing code like the following in a script when loading the game...
  12. tamation

    See if a string contains a substring from a set of words

    I have a ds_list full of words I want to check for, I know that you can use string_count to see if a certain substring appears in a string, but is there a way to set it up so that I can check for if any phrases in the ds_list appears in the string without manually checking each one individually?
  13. FoxyOfJungle

    GML [Solved] ds_maps: How to save/load the room with instances?

    I am making a customizable game where the player will have to build a mall. How do I save all instances of 2 different objects and also save global variables such as score and others (All in the same ds_map)? I need everything to be saved in a ds_map and then use ds_map_write () Save/Load Code...
  14. F

    GMS 2 Getting error that global object is undefined even though it is defined

    I have the following code in one object create event: global.inventory_manager = instance_create_layer(0, 0, "Instances", obj_inventory_manager); This code is definitely being run but then later on when I try and access the global manager with this code: with(global.obj_inventory_manager) {...
  15. tamation

    Forcing a line break with draw_text_ext for strings without spaces?

    I have a system in place right now where the player can type out a string, it reads the keyboard_string input and draws it with draw_text_ext, with the width set to the length of the textbox. It works great, except for when it's spammed with a string with no spaces, then the line break doesn't...
  16. M

    Persistent arrays of object instances without adding to layer

    I'm coming at GML from a C++ background, and I want to have some global state to represent my player character, their inventory etc in an RPG game I've started. I really want to know whether it's possible to create an "array of structs / objects", similar to the following (C++): struct Item {...
  17. Dwighty4000

    GMS 2 Gamepad control - what do I wrong?

    If I try to run with the left knob, then only the up and down run works because nothing works with the gamepad on the left and right. And the directions that work are carried out endlessly after just a short movement! What's wrong here?: #region Laufeingabe var hoch = keyboard_check(vk_up) ||...
  18. Dwighty4000

    GMS 2 Gamepad control - how can i implement it?

    I watched 3 different tutorials but I still not... And I still don't know how it works with the value's correctly. In addition, I do not know how to call that no key is pressed on the controller, as it is on the keyboard: "vk_nokey". Because I have a running animation in a sprite when a key is...
  19. tamation

    [SOLVED] Smooth view with non-pixel perfect movement

    Hi all. I have a player using friction in the move code right now. The view is 256x144, I'm trying to make the player move at a speed of 1.5 pixels, however the speed they move is gradually increased by .1 when they start moving and again decreased by .1 when they stop. There is also a camera...
  20. Aardvark

    GML [SOLVED] Draw tile set after player being idle for specific time

    Hi! I'm fairly new to GMS 2 and GML but I'm a quick learner. I've set-up basic animations for my player based on the direction it's going (8 directions). What I'd like to do is start a frame by frame animation from a given tile set after the player is idle for let's say 5 seconds. Here is...
Top