Skip to main content
6 votes
Accepted

How to check if all switch objects in a room are set to true?

If my GML is not too rusty, the following should work: ...
Quentin's user avatar
  • 1,188
5 votes

Why are the randomly generated numbers not random?

This is intended: NOTE: This function will return the same value every time the game is run afresh due to the fact that GameMaker: Studio generates the same initial random seed every time to ...
TheCell's user avatar
  • 103
4 votes
Accepted

In Gamemaker Studio 2 how can I find out in code whether the platform is HTML5 or not?

You can check what browser the game is currently being run in with the os_browser constant. If the game is not being run in a browser the constant will be ...
Applekini's user avatar
  • 8,543
4 votes

Jump function moves object horizontal after dash function

I would recommend trying to clean up and reduce the number of variables you are keeping track of, as more bugs are likely to develop. But on to your question: The problem you are seeing is that ...
LAMonday's user avatar
4 votes

Jumping to land x pixels ahead while not really moving (2D)

If your ground scrolls at groundSpeed = 240 // pixels per second And you want your jump to cover ...
DMGregory's user avatar
  • 141k
4 votes
Accepted

Game Make Studio 2 - Grid snap x, snap y

There are some icons at the right bottom area of the room editor. Check the first one of them:
Dmi7ry's user avatar
  • 1,050
4 votes

How to model chess knight movement in GameMaker?

Borrowing the diagram from disc_code22's answer, let's overlay it with some numbers. For each square, we're going to count how many squares it is left or right from the knight, and square it; then do ...
DMGregory's user avatar
  • 141k
3 votes

How to add clickable text link in Game Maker Studio 2?

Create a new object. Create event: ...
Dmi7ry's user avatar
  • 1,050
3 votes
Accepted

How do I access device camera in GameMaker Studio 1.4?

GameMaker doesn't have native support for device cameras, that's the reason you didn't find anything about it in the docs. On the other hand, you can try to access the webcam on desktop devices using ...
liggiorgio's user avatar
  • 5,534
3 votes

Help for sorting cars that are 1 lap behind the others (latecomers)

Add a per car lap counter that increments when they hit the finish line. That way you can sort the cars by that lapcount before you sort those with the same ...
ratchet freak's user avatar
3 votes

Topological sorting optimization

The video you linked already shows the solution I would suggest: split large objects into a standard tile size. This increases the overall number of objects, but allows you to use more standard sort. ...
Pikalek's user avatar
  • 13.4k
2 votes

Fatal error in Game Maker: variable not set before reading it

Layers have to be referenced via their name, provided as a string. Try changing your create function in the step event to ...
felix's user avatar
  • 21
2 votes
Accepted

Delta time causing comparison issues due to floating points

Your feeling is right, don't round your x at every frame because you need that value as an accumulator and it should remain accurate for a consistent simulation. ...
Vaillancourt's user avatar
  • 16.4k
2 votes
Accepted

Issues making a gradient square in glsl es 2.0, Gamemaker Studio 2.0

Here's a WebGL implementation showing the same effect, which means it is the intended behaviour That's just an optical illusion, the line isn't there. Let me magnify the image: Your eye perceives ...
Bálint's user avatar
  • 15.1k
2 votes
Accepted

Collision detected at different times depending on speed?

The reason coloured cubes behave this way is because of how you treat collision check - it's not a bug, it's about setting up collision checking system. Predicting collisions vs computing actual ...
liggiorgio's user avatar
  • 5,534
2 votes
Accepted

Rotate a ds_grid 90 degrees in GMS2

As commented, you must change the arguments of the ds_grid_copy() function, for it isn't saving your calculations. Taking a look at your code, I came up with a ...
liggiorgio's user avatar
  • 5,534
2 votes
Accepted

How can I respawn enemies in Gamemaker Studio 2?

Since your enemies are destroyed and don't respawn instantly, you need a different object to spawn them using a timer. I implemented this minimal working example, in which every time an enemy is ...
liggiorgio's user avatar
  • 5,534
2 votes

What are the benefits or drawbacks of splitting the player animation system from the wall collision system into multiple objects pinned to each other?

I'll develop this answer as soon as I get more time and tell me if I'm off topic, I'm not really sure about what your actually asking. It's also one of my rare attempts to reply to a question, I'm ...
Riptide's user avatar
  • 292
2 votes
Accepted

What are the benefits or drawbacks of splitting the player animation system from the wall collision system into multiple objects pinned to each other?

The approaches you described are both equally valid, but as always your best choice depends on what you want to achieve. Defining "sub-systems" Notice that collision and animation systems ...
liggiorgio's user avatar
  • 5,534
2 votes

Tiledata management

2.000*2.000*32 bits of data, which is equivalent to 125 megabytes First, let's use the correct units. You want to talk about mebibytes, not megabytes, as mebibytes is to a power of 2 value, proper to ...
Ferreira da Selva's user avatar
2 votes

Game Maker Studio 2 problems with too many instances

GM:S is generally able to deal with as many instances as your machine is capable of handling, both in memory and CPU usage; every engine limitation is bonded to the machine the program is running on ...
liggiorgio's user avatar
  • 5,534
2 votes
Accepted

Variable Problem when coding the Player Movement in GameMaker Studio 1.4.9999

Place_meeting is used to reach a different instance, so Solid should be the name of that instance it's colliding with. Your ...
Steven's user avatar
  • 965
2 votes

Do I need multiple exports from Game Maker to support Windows versions above 7?

I believe windows includes all the versions of windows, Windows 8 build is for functions specific to the windows 8 platform
Miroslav's user avatar
2 votes
Accepted

How to scale image at runtime in GameMaker?

inst_inst.image_xscale = 0.1; image_xscale is a property of an instance. image_index also ...
Dmi7ry's user avatar
  • 1,050
2 votes

Procedural terrain generation is very slow

I can see 2 possible reasons of bad performance: You have very big numbers in X and Y. Like 2000*1000. In this way you must lower that. You can make bigger areas to generate (like 10*10 squares ...
A. Denis's user avatar
  • 171
2 votes

How would I create a multiplayer game owning a server?

A server that you own is nothing more than another PC running somewhere in the world 24/7. Make a "headless" version of your game, that acts as a server, and has no graphics, only calculates the game'...
Tom Tsagkatos's user avatar
2 votes

Operating Expenses of Mathmetic Operations

You don't measure operations in time, because it only takes a couple of nanoseconds and it changes based on the CPUs clock speed. You should use cycles instead, these generally tell you how many steps ...
Bálint's user avatar
  • 15.1k
2 votes
Accepted

How to change the version code in application created by the GameMaker?

In Global Game Settings, inside the Android/Fire tab within the General section, there is a 3-components field to set the version of the apk. Google Play detects automatically this setting to ...
Juanpa's user avatar
  • 292
2 votes
Accepted

How to make an object towards the mouse on one Axis - Gamemaker Studio 2

Just check where is the mouse based on the object's position: if (mouse_y - y) > 0 { y+=1; } else if(mouse_y - y) < 0 { y-=1; } This same code ...
Juanpa's user avatar
  • 292
2 votes

How to support more than 4 XInput controllers?

Xinput library only supports 4 controllers at a time - please refer to the wiki page on Directinput -DirectInput Wiki. May take some work, but you could enumerate some of the controllers under Direct ...
ErnieDingo's user avatar
  • 1,190

Only top scored, non community-wiki answers of a minimum length are eligible