Questions tagged [game-maker-language]

General Game Maker Language (GML) support. The programming language used in Game Maker and Game Maker: Studio.

125 questions
1
vote
1 answer

MACROS in gamemaker function throwing error

This Code var within_rangex = is_within(x,o_player.x,PLAYER_REACH); throwing the error Got ';' (;) expected ',' I Have No Idea Why, when using magic numbers there is no error thrown. EDIT: The Script In Which PLAYER_REACH Is Defined. // This…
1
vote
2 answers

I need help for gamemaker 2.3

Pls help me A few weeks ago it came out of gamemaker 2.3, practically in the gamemaker language they changed the scripts into functions, but now after converting the files to be able to reopen them, I double-checked all the scripts and etc but…
1
vote
1 answer

Collision Check GMS2

I have written a collision check code and ran it, works perfectly but it is working for just one layer. e.g My code is getting layer id and gets tiles in that layer and giving them a number between 1 and 0. If it is 1 there is a collision, else (0)…
1
vote
1 answer

Function for modulus addition of numbers (like degrees)

I want to cycle through 0-3 values to any direction (adding or subtracting 1). Basically I'd like to do modular addition, like with degrees: 320° + 45° = 5° 0° - 2° = 358° I've found a clamp(val, min, max) and Modulo but those are different. I've…
Anton
  • 10,890
  • 8
  • 45
  • 54
1
vote
1 answer

Deleting tags from a string

I'm trying to remake the script below so that it does not draw text without the tags [a=...] and [/a], but just delete them from the string. I made this script but it removes everything inside the tags, removes that between the tag and between the…
younyokel
  • 327
  • 2
  • 15
1
vote
1 answer

How to fix a bug with 'image_xscale' in GameMaker Studio 2?

I'm making a game in GameMaker Studio 2, and I have a problem. When object turns to left or right, he was puching forward. But he has to be in the same position like the first time. I tried to use this code: /// @description vaksciojimas // You…
1
vote
1 answer

Can't edit object variable from a seperate script

I'm just trying to change a simple object's variable from within my script. The code runs but does nothing to change the variable. Editing this variable should lower the enemy's health bar, but it does not. If I edit this variable from within the…
tbunreal
  • 181
  • 1
  • 1
  • 8
1
vote
0 answers

zoom in view game maker

For some reason I can't zoom in. view_xview[0] = view_xview[0] - 100; view_yview[0] = view_yview[0] - 100; view_hborder[0] = view_xview[0] / 2; view_vborder[0] = view_yview[0] / 2; While using these, the zoom event works fine but it zooms to the…
1
vote
1 answer

Game Maker Array Not Initializing

I am trying to make a main menu using an array in Game Maker, and am using the following code to initialize it in the "Create" event. For the life of me I cannot figure out why it isn't working. I am getting the error: Error at line 1 pos 5:…
1
vote
1 answer

GUI text is moving along with the player

The video attached shows the issue, the code controlling the ammo count, and the viewport/camera properties. I would like the ammo count to stay in place, rather than moving with oPlayer. I'm new to Game-maker and game development in general, this…
1
vote
1 answer

How to make a object follow another object around walls game maker language

So, i want an object to follow another one. But if the player object gets to far ahead the other one gets stuck behind a wall. So if you go round a corner and the following object gets trapped because it cant follow you since its trying to move…
Skye
  • 15
  • 1
  • 6
1
vote
1 answer

GameMaker Snes Controller Vertical axis not working

I've been trying to figure this out for some time. Basically I recently purchased some cheap Snes controllers off Amazon.…
1
vote
2 answers

How do I make NPC follow me in Gamemaker Studio 1.4

I've been trying to get an NPC, in my case a zombie, to follow me in my game of course to no avail. I'm using the following script for my character to move if(keyboard_check(vk_left)){ sprite_index = spr_player; x -=…
user8696827
1
vote
1 answer

Object won’t change sprites

I’m working on a 2D Platformer Game in GMS 2 and my player object won’t change sprites when I push the buttons that are supposed to make him change to his shooting and crouching poses. I have tried putting the different poses into different sprites,…
user8116739
1
vote
1 answer

GML, How do I save what room i'm in to .ini?

I was learning basic saving/loading for an adventure game and came across this error: I started out simple with just saving X and Y positions with the player along with the room they're currently in. ini_open("save.ini"); ini_write_string("Player",…
Kerma
  • 69
  • 1
  • 10
1
2
3
8 9