instance

  1. P

    Ordering of Instance_Create

    I am currently trying to make a drawing game and i am still fairly new to game maker. I have made it so that when the left mouse button is held, an new instance is created drawing a line.However, when working with other colours, the layering is in the order of the the code. E.g if...
  2. R

    Legacy GM Path finding odd isue

    Hello I made a global var, and assign to it an mp_grid. It's working fine, but for an unknow reason the first created instance what using the path not start moving. I checked the path length and it says -1 at the first unmoving instance. I'll show what i'v done: object 1: Create Event: Alarm...
  3. L

    Legacy GM Creating Walls that Destroy Push Crates and Themselves on Collision

    Hey everyone! I'm creating a simple puzzle adventure game where you have to use various crates to obtain keys and flip switches to open doors within a maze. You also must avoid search lights and guards while solving the puzzles. So far, I've got most features in no problem. I have some walls...
  4. R

    [SOLVED] Create/copy instance from object

    Hey there everyone I'm trying to make something, but it's getting really difficult. I'd like to share it with you. I have one button object on screen, called 'obj_button'. I made a piece of code so I can drag and drop it anywhere I want, and it's working fine. But what I'm trying to achieve...
  5. 2

    Check if Variable equals existing instance id without error if it doesn't

    If I set a variable to an instance id, what do I do to check later if the instance id contained in the variable exists, to avoid it throwing an error when I try to do something to the instance later, if the instance id value in the variable doesn't exist because it was destroyed. Keep in mind...
  6. B

    Checking Instance Position Problem

    Instead of changing each individual wall, I made a code in the create event: depth = -y; image_speed = 0; if instance_place(16,0,obj_wall_template) && instance_place(-16,0,obj_wall_template) { image_index = 0; } if instance_place(16,0,obj_wall_template) &&...
  7. B

    GML Visual Getting Position of Instance Using Drag and Drop

    I am trying to make a program where I click on Object 1 and drag it to object 2 and when I release Object 1 it will snap to Object 2. My issue is that I want to have multiple Object 2's but if I just put another instance in the room Object 1 will always snap to the first Object 2 in the scene...
  8. S

    Bullet collision with walls in a procedural level

    Hello everyone! Hoping you guys can help me. Basically, I'm trying to create a procedural level for a top down shooter. So far, I've got the level, I've got player collisions, and the player can move and shoot 360 degree, amongst a few other things. What I'm having trouble with is getting my...
  9. K

    GameMaker [Solved] layer_get_all_elements not returning array with every instance?

    Following issue: I have a global variable that i use to add up the value-variable of every object placed on the value-layer. However when i look at the debugging process of everything layer_get_all_elements only gives back an array with one entry and that entries value goes up with every new...
  10. codemouse

    GameMaker How to detect active/deactivated instances?

    I know we have instance_activate_object() and instance_deactivate_object() and so on, but is there a way to detect which objects are deactivated (or vice-versa)? Like a variable (.active) or a function (is_active())? I want to use instance_activate_region() but since it doesn't return a list...
  11. E

    Legacy GM Script is destroying additional objects

    I have this sort of "piano tiles" mechanic where objects are randomly generated in 4 possible positions and drop as you tap and detroy the lowest object. However, when a series of objects are generated in the same line, one after the other, whe destroying the bottom-most object, it also destroys...
  12. H

    GameMaker [Solved] How to make a level selection screen?

    I'm using the free version - so limited stuff... Any way, i created the rooms i needed. I got some basic platforming action going on since there are ample tutorials on those things. However navigation between rooms is killing me. I have made a "choose room" object button that I have multiple...
  13. 2

    GML Find if ID in Variable = an object_index Name, or Child Of

    Putting an instance id in a variable, I need to see later if the variable's instance id is equal to an object, or a child of that object without writing each of their object index name only the parent. eg. given var = an instance id, test if object_index name of id is something...
  14. M

    INSTANCE ID'S

    Hi All. I work in a project based on create a game about footprint. But i recently start to have some problems with instance creation. When i create a new instance, and asign a variable to this instance, this variable have the correct id of the instance but when in the object of the instance...
  15. A

    Legacy GM [Solved] How to check if variable contains an object?

    So I'm trying to make a code based on path finding where the enemy follows a path it created. The reason I have to make the enemy follow, is because I'm using physics based. So here's the code right now: if (collision_line(x,y,obj_player.x, obj_player.y, obj_wall, false, true)) { if...
  16. V

    Getting weird error in gamemaker for no apparent reason

    Unable to find any instance for object index '0' name 'obj_Block' at gml_Object_obj_scoreController_DrawEvent_1 (line 7) - draw_sprite(spr_ZFighter, 0,x + 128 +(i*spr_ZFighter.sprite_width), y)...
  17. W

    Discussion Persistent layers

    What's is the best way to deal with layers and persistent objects in GMS2? I've found when moving a persistent object to a new room it's layer don't follow. My solution in testing has been to find a suitable new layer, moving the object in the room start event. The objects in question for me...
  18. S

    GML Check for object like "with obj.var"

    Hi all So I've been starting to create an AI, that should be able to have "teams". Every object, that uses the AI, contains a "team" variable. What I want to do now is to check for instances that contain the variable "team", and if this variable isn't the same as the checking instances "team"...
  19. M

    Multiple instance for multiple instance

    Hello Hello! So the thing i got a hard time to deal with is; I made an enemy tank who have a turret. I made a spawn point but there is only one who have a turret. I know my problem witch is that the turret spawn on "obj_enn_tank1" but then when an other "tank" spawn, the turret is already...
  20. A

    GameMaker [SOLVED] Deactivating instances when hidden...

    So in my game, I have an object as part of my lighting engine that is rather CPU intensive. Whenever I have more than 3 in active at any point, my game drops from about 500fps to 40 (my game runs at 60). I've already made it so that when instances of this object are outside of the view, they are...
Top