Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!
Hey guys, Im trying to have my game pick a random instance of an object (enemypar) and then store that random instance to a variable.
Then, I'd want to refer to that variable in this a statement, for example:
<variable here>.distance_to_object(playerpar) < 100
So that the randomly picked...
Hey, i was wondering if the is a way to check if one variable is equals to 1,for example, in all objects of one type:
if(all of object one type.variablenamehere==1){
then do something
}
I am trying to assign a variable to a variable in the variable definition on the object's page.
EX:
//Here is the variables in question.
//I am assigning _object an object. I am then assigning _SpriteX & _SpriteY the variable of the _object's X & Y value which is determined through another...
1. Is Delta timing good for a incremental/click based game?
2. If I have variables doing calculations per step, and the game lags, will it cause issues for me? Ex: if I had two variables relying to be in sync, and become out of sink due to lag. Or is that lag just voided steps and the...
Hello, I am trying to put some code into an argument of a script how can I do it?
This is how I want to call the script:
change_script(1, 2, global.military_point = global.military_point + 3, global.economic_point = global.economic_point + 3);
This is inside of the script:
var unique_id =...
Hello guys!
I got a problem.
I make game similar to FTL and i need this for my crew members code.
So... i got script for rooms and crew members which are cloned obj_crew.
This is inside the room_script which are in draw event of gui_object.
This code it's for slots on my room scripts for the...
Okay so is it possible (and if so how to go about it properly) to draw sprite items and then reference or move them individually in game when something happens? For example, lets say I have this...
draw_sprite(info here); // top layer
draw_sprite(info here); // mid layer
draw_sprite(info here)...
Hello guys, I've got a question.
In Game maker, there is a way to adress an object from a string with the function asset_get_index.
Exemple :
weapon = "pistol";
sprite_index = asset_get_index("spr_"+ weapon);
Is there a way to do the same thing with a variable ?
Exemple :
sell_pistol =...
Hey guys, I am working on one of my games and I want characters to change clothing (head / body / legs) separately.
I want to use three string variables. For example:
headSlot = "some var"
bodySlot = "some var"
legsSlot = "some var"
These variables can be equal to clothing type:
bodySlot =...
Dear people,
I wonder if any of you can help me with the following. I have a game initiator object that will assign a value into a global variable. Then that same object will create a new instance of another object, which based on the previous value will be created in one or other way.
The...
Hello everybody !
I have a question about good practices in programing : when you want to change an object's variable, do you use "with" or "my_object.my_variable" ?
the two ways seem to work :
with(Obj_Player)
{
my_variable_health = 10 ;
} ;
or
Obj_Player.my_variable_health = 10;
Which...
Is it possible to not only watch a variable for changes but when it does change, show you the line of code that caused it to change? This would be invaluable knowledge if it's possible.
Thanks in advance.
(I'm only a few days into using GML, but I have other programming experience)
Alright, basically I have a very simple button/door system. What I do is, I make a door's ID "door1", and corresponding button with "button1", which is fine. But apparently I can't use the same ID's between different...
Hello everyone!
I have a small problem in my mobile project. I created a button that should lead to the next level. All the level atributes are saved in scripts: scr_level1 , scr_level2 , scr_level 3 and so on. So in the button I added these lines:
// this button is in rm_game
//when button is...
So I have a variable (shots_fired) that counts how many time a gun is fired, but for some reason it will continuously add to the variable, even with a condition check:
if parent.image_index >= 1
{
image_angle = 10;
x =...
Hello all :),
I have been making some headway on my game and have been somewhat trying to polish/ fix up my code to be easily expanded on so that I can start adding "Content".
My question, does something like this exist?
variable_get_name() or maybe, reference_variable()
I am simply trying...
I'm creating an array of variables to track progress for each area in my game like so:
area_001_state=[0,0,0]
area_002_state=[0,1,0]
area_003_state=[1,0,1]
...
The first array position for each area could indicate whether the lights are on to start with, for example. Then when I want to...
So these variables aren't being recognized by the IDE for some reason, even though I am using them two lines afterward.
I tried restarting the IDE and reloading the project but that didn't fix it unfortunately.
My guess is that this is a bug related to the new warning system but i'm not sure.