General Game Maker Language (GML) support. The programming language used in Game Maker and Game Maker: Studio.
Questions tagged [game-maker-language]
125 questions
4
votes
1 answer
Adding cycles to a Minimum Spanning Tree without moving the points?
I am generating a dungeon layout for a video game. I have created the rooms, spaced them out using seperation steering, and created a fully connected weighted, undirected graph of the rooms. Then I calculated a MST using Prim's Algorithm, all using…

Timothy Mitcheson
- 41
- 2
4
votes
1 answer
GameMaker 2D Visibility
I would like to implement in GameMaker exactly the same thing as in this article: http://www.redblobgames.com/articles/visibility/.
The code for it is available there in different languages, but I can't figure out how to effectively port it to GML.…

TheTurnipKnight
- 41
- 1
3
votes
1 answer
I want to know how transformed "a-(a%b) " to "a&(~b)" (snapping grid formula)
When I searching about Snapping grid function. Actually it is Tile Collide.(You maybe know I learning GMS2 because of tags..)
It is not important for my question.
Cut to the chase, I learned about this formula.
pos.x - (pos.x % gridwidth) <- this…

JINU_K
- 133
- 7
3
votes
1 answer
My GML shuffling array function is alway returning the same result
I'm trying to make a shuffling array function in GML. Here's what I tried, with argument0 being the array to shuffle and argument1 being the size of this array:
///Shuffling array function
//argument0: the array to shuffle
//argument1: the size of…
user5455540
3
votes
1 answer
Game would not run in game maker and it said "cannot use function/script name for a variable,using"motion_add"
this was happening to me as I tried to make an astroids game on game maker. I put in the code motion_add[image_angle, 0.2] and it was working fine then it said
"cannot use function/script name for a variable,using"motion_add"
if you guys could…

new gml user
- 31
- 2
2
votes
2 answers
GameMaker 2.2* => 2.3 Update fix arrays
In new GameMaker 2 update there are so many major changes:
https://help.yoyogames.com/hc/en-us/articles/360011980018
We develop our game (https://store.steampowered.com/app/733460/First_Feudal/) on this engine for 3 years. There was no other way to…

SirCapy
- 295
- 1
- 12
2
votes
1 answer
Game Maker Studio 2 - How to give one input priority over another when controlling the same object?
I'm trying to control an aiming object in a game I'm starting on with two different inputs, one is the left stick so you can aim while moving, and one is the right stick for more precise aim, but I'm having trouble making it so I can control it with…

Skadoodlefap
- 49
- 3
2
votes
1 answer
Game Maker 7 GML array length
I am working in Game Maker 7 using GML in order to create a Main Menu for my game. I have looked for a while now trying to find out what the code is to use the length of an array however I cannot find it. What I have so far is:
var move = 0;
move -=…

AshleyBates
- 21
- 1
2
votes
1 answer
How to show choice in Game maker with gamepad functionality
I am working on a Dragon Warrior - type rpg game in Game Maker studio and can't figure out how to get a show choice option that doesn't use the mouse. I have setup the game to run completely with a gamepad, but when I am confronted with the…
2
votes
3 answers
Game Maker code error
Now I'm making an endless runner where objects are spawned in front on me randomly.
I was told to make a spawnController and globalController object, so I did. Then this code should be put in the controller under step event
if(tick = 32)
{
tick =…

user1947331
- 47
- 2
- 7
2
votes
8 answers
Game Maker Language new line
I am writing a GML script and wanted to know how to make a message appear on the next line:
ex.
show_message("Hello" + *something* + "World")
outputs:
Hello
World

thehollow89
- 21
- 1
- 1
- 3
1
vote
2 answers
String Length changes if it is pulled from file
I'm coding in Game Maker Studio (Toby Fox used it for undertale) and I'm starting to try and work with files. Effectivly, I'm trying to build a custom "level" editor because the built in one for GMS lacks some features I want. So far I have set most…

Majestic_Monkey_
- 33
- 7
1
vote
1 answer
Error on Handle Collisions in Corners - Gamemaker Studio
When I move my character into the walls, the bottom wall and right wall collisions works fine.
Collision walls that work fine
The problem is with the other two walls (the left and top ones), when I'm in collision with'em, my character either drop…

Francesco Riva Reyes
- 11
- 1
1
vote
1 answer
Sorting a list using the quicksort algorithm in Game Maker Studio 2
I am working with Game Maker Studio 2.3.6 to sort the list of character speeds on screen in descending order with an iterative algorithm (bubble sort). However, I plan to have a lot of on-screen characters for some of the battles. Therefore, I…

Gaspard
- 11
- 1
1
vote
1 answer
Variable name autocomplete for VSCode Language Extension (GameMaker / GML files)?
I'm editing GML files (GameMaker Studio) in VSCode. There's a wonderful plugin, GML Support which adds autocomplete for inbuilt GML functions and instances variables along with a bunch of other cool things.
However, VSCode doesn't seem to recognise…

snowbound
- 1,692
- 2
- 21
- 29