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!
Hi,
I have the variable speed = 8
In my step its: speed *= 0.9;
and I want it to jump to 0 after its below 1.
Do I always have to write
if (speed < 1) speed = 0; ?
or is there an easy function like clamp, min, max etc.
Hello!
So, basically I want to make a code that is like: "draw a line for the instance whose variable is x".
I thought about using instance_find to do this, but it only works like "I will only draw a line if the instance id is x".
I wanted to use such a function to make "line graphics", which...
GM Version: Studio 2.3+
Target Platform: Windows / All
Download: n/a
Links: n/a
[THEME]
Today we will be talking about functions, so this tutorial will be about the function keyword and the method() function.
In the in-betweens, I will also talk about binding. What is it and why is it important...
Hello,
I have been working on my second game for a month now and wanted to add a series of upgrade Buttons to give the Player the ability to improve their stats (walking speed, mining speed etc.). I wrote a function that is supposed to be triggered if my button gets pressed. That works perfectly...
I have seen an strange behavior when declaring variables inside structs. The following code returns the x value of the instance that creates the struct even though it should return an error. I discovered this tracing a bug for a much bigger struct that I'm using and I really don't understand it...
Is it possible for example to call a function in a step event, that is inside the draw event of that object?
Like :
Step event :
DrawShadow()
Draw event :
function DrawShadow() {
......
}
I didn't find the way to approach it. All functions are global whether they are in script or in obj.
when project gets bigger, it will be very terrible...
(the "private" means non-global)
So, suppose I have a string of numbers whose value is "1234". I want only the first two digits, "12". Or another string whose value is 6. I want it to be 06. I thought about using the "string_format" function, but it's not exactly what I want. I want to use to make timers in the hh:mm:ss format...
Hello everybody,
I've quite a little diffculty on something. Here is the recap :
I have an object obj_aaa_par with a function in his create event :
function generic_func(_var) constructor {
obj_idx = _var.object_index;
x = _var.x;
y = _var.y;
name = _var.name;
}
This...
Hola comunidad, estoy necesitando un poco de ayuda, agradecería que las respuestas a este post estén preferiblemente en español, aunque si es de ayuda no me molestaría en recibirla de todas maneras.
Contexto: estoy intentando hacer un cuadro de texto que solo acepte números como entrada...
[LINKS]
https://marketplace.yoyogames.com/assets/9587/xbufferfunctions
https://xdstudios.itch.io/xbufferfunctions
[INFORMATION]
This asset is composed by a set of buffer functions that allow for complex buffer parsing. Functions allow to seek and match patterns, copy regions (using read...
Hello,
I'm pretty new to game maker but I've messed around with Unity a lot in the past.
I've hit a roadblock and haven't been able to figure out why I'm getting errors despite researching and reading the documentation, but it's probably because I don't quite understand how GML and scripts...
I made (borrowed) a script for drawing buttons to gui and it works perfectly, except I cannot seem to assign a variable to the returned value.
Here is the script:
/// @function draw_gui_button_sprite(sprite, index, x, y, width, height, main_view);
/// @param {index} sprite The sprite to...
I'm trying to make a textbox that appears when the mouse hovers over the object, and I'm drawing a rectangle as a backdrop for it. However, if the object is far enough to the right, I want to make it draw in the opposite direction, but when I do, it turns semi-transparent and draws behind other...
Symptoms to Look For
Expand for screenshot:
The error is in the Create Event for object <undefined>.
The subject is <unknown object> with a variable name that's either built-in or known to be already declared.
The stack trace shows the source as something starting with gml_GlobalScript.
For...
Simple question, is there a way to open new windows in code? Like a second window for the game?
What are the limitations of this, if it's possible? Does anyone know?
This would be in the actual game itself. So I want to basically open another window automatically while the game is running. Is...
Hello,
I wonder if this is a bug or not...
func_1 = function(){
code
}
func_2 = function(){
func_1();
code
}
When I place this in a create event, it calls the func_1 code without me executing func_2....
Is this a bug or is it not allowed to nest functions like this?
Im...
I'm making 2d platformer in GMS Language. I've a varibale "hpHero" and i did like " if hpHero=0 { game_restart(); } but I need to play the animation of die before game will restart,pls help me
The new version of Game Maker Studio 2.2.3.436 lets you disable the engine sandbox, this works with the "file_" functions, but doesn't work with zip_unzip().
Is there any way to extract a zip to any location outside of "appdata"?
I'm basically doing an update system, and I need to extract the...
Hello,
This would be my second post (as well as thread) :)
The title pretty much says it all about here.
In my previous thread, I have talked a bit about my first extension (in my first game built using GameMaker).
So far I have been able to call external functions from GML scripts. Our...