instance

  1. J

    Windows Global test????

    I have set this in a script: global.point =0; and in another script: global.point +=5; but I cant seem to figure out how to test this variable :( I have tried a few things but I just keep getting errors. I want to test this variable so that i can delete an instance of an object but can't...
  2. C

    GML MP checking who "owns"/ controls a instance

    Hey guys, I currently have a ds_list from wich you can choose a Player you want to join in his team. The chosen player gets put into a global variable. What i want to do now is pick a instance and then check wether it belongs to the selected player or not, so i can track its x and y position.(i...
  3. Thexel PIN

    Legacy GM Drawing many instances at a time.

    So this is my code: if instance_exists(obj_enemybullet) { if obj_enemybullet.sprite_index != -1 {...
  4. Shadowblitz16

    GMS 2 changing room does not happen until after event?

    does anybody know how to get around my object being deleted after I change rooms? //Goto Room room = rm_menu; //Toolbar tools_menu = new_item(0, 2, 0, Item_Toolbar_Menu, new_exit(6,6,5,1)); //Menus menu_tiles = new_item(0, 16, 6, Item_Option_Tileset, new_exit(0,0,6,6)); /// @description...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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) &&...
  11. B

    Drag And Drop 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...
  12. 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...
  13. K

    GMS 2 [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...
  14. codemouse

    GMS 2 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...
  15. 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...
  16. H

    GMS 2 [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...
  17. 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...
  18. 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...
  19. 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...
  20. 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)...
Top