instance id

  1. Q

    Object IDs stored in ds_list result in <invalid instance>

    EDIT: With a little more digging, it looks like this only happens when I change rooms after creating the ds_list. Is there a way to mark a ds_list as persistent? EDIT2: Duh! The objects IN the ds_list weren't persistent, so they were getting destroyed when the room changed. The ds_list still...
  2. S

    GameMaker Editting the properties of an object created with instance_create

    I have a hitbox I create in an attack state for the player. Here is my code: bodyHitbox = instance_create_layer(x + 450, y, layer, obj_body_hitbox); object_set_solid(bodyHitbox, true); bodyHitbox.mask_index = spr_player_attack_1_body_hitbox...
  3. E

    Access to instance Id name

    hi everybody I'm trying to make a dynamic object by object id name that you can change in room editor ... my instances have different behavior by name that I set in room editor by myself. ... so how can I access to string name like "inst_2D986839"...? I have to read it as a string
  4. X

    Legacy GM Instance ID doors

    I'm getting a weird error and I can't figure out why. My game uses a system of electric doors that have a locked and an unlocked state which can be toggled using a computer terminal. This is by use of an in-game menu that calls a script which holds a switch statement. The terminal communicates...
  5. B

    GameMaker Bit-masks and objects in a 2D Array

    I was wondering if it was possible to set a mask and store an object id in the same 2D array entry. I'm still relatively new to bitmasking in general, so any corrections are appreciated. In a nutshell, I have a GameGrid[x,y] which starts empty. Then, I set specific tiles to hold certain...
  6. S

    GML [SOLVED] Multiple collision_line IDs

    I'm using collision_line to see whether or not a line-of-sight is obstructed in a turn-based strategy game. When there's a character object and its id != the character that's looking, the obstructed variable is set to true, else set to false. So all of that works fine and dandy but the issue...
  7. Z

    GameMaker How can I delete instances that were taken in a previous playthrough?

    I have already have a system that saves strings in a text file and loads from that file at game startup, but as far as I understand, instance IDs are set once the game compiles. So their IDs will be different each time the game starts up? How can I refer to instances based on an ID that was...
  8. 6

    Line connected dots

    Hello! I'm trying to reproduce something i saw on a cool website (check it out anotalk.hu to understand(it's the background)) So I made a few dots (like 200) and gave them random direction and speed. Now to connect them i used a collision circle but collision circle is dumb and picks 1 instance...
  9. Pfap

    looping til match found?

    [SOLVED] I have a 20 position array storing the id of 20 instances. //this is the code I want to run if center_id = global.position_order[o]{ do this } so, object1 is stored in global.position_order[0] object2 in global.position_order[1] etc... center_id = the id of the instance clicked on...
  10. W

    Tagging instances issues[solved]

    I'm trying to set up a thing where if the player passes by this object it locks him in a small area where he has to defeat all enemies in order to undo the lock and leave. But I can't work out how to tag all the enemies that are closest to the lock in question. What I tried only tagged 2...
  11. B

    Legacy GM Refer the Instance ID of the object calling code?[Solved]

    Good morning, afternoon, evening wherever you are, today, I want to ask you something pretty simple to all of you, about Instance ID. I have known that there are 2 built-in variables for referring the Instance ID, which are object_index and id. However, after creating a variable and store the...
  12. A

    Legacy GM Lever that opens specific door

    I'm trying to make that if a lever is activated, it will open the door that is linked to it, but I have no idea how to open a specific door without opening the other ones. lever: if pressed == false { if place_meeting(x,y-1,obj_player) { if keyboard_check_pressed(ord("Z")) { pressed = true...
  13. E

    GML Links between variable and instance

    Hello. In prototype of my game i am trying to create a link between variable of one object and instance of another object. For example, i am developing RTS-game, and for every unit in my army i want to create a variable target, which stores a data of unique target instance (enemy unit)...
  14. A

    Legacy GM [SOLVED]activating one button will activate the other ones

    If the player or an enemy land on a giant button it will add 1 to the variable "on" and if on is greater than 3 the button will be pushed. This works fine with one button, but if there are multiple instances of obj_giantbutton when something land on one button, it is being landed on the other...
  15. A

    Legacy GM [SOLVED] Instance Id Problem

    I have a button that creates an instance of a menu bar every time i click on it. Each menu bar, creates a drop-down list every time i click on it. Each item of said menu is an instance itself. When i click a item on the drop-down list, the menu bar should draw the value of the option clicked...
  16. 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...
  17. P

    GameMaker How to get the coordinates of an enemy instance

    Hi there. I'm butting my head against a wall regarding aiming at a selected enemy My player is a mech divided in two objects (it's a tank right now for testing purposes), the legs that move like in a RTS, and a turret-like body that turns towards a selected enemy, or the mouse if none is...
  18. U

    Legacy GM Get instance's id at position [SOLVED]

    Hello everyone. How can I get the exact instance id of an object at a given position? I am not referring to collisions, only the instance's id, so I'm assuming functions as instance_position() won't help much. I know I could use instance_find() and loop through all instances to see if their...
  19. T

    Windows Finding an Instance with the Lowest Value of a Variable

    I want a character to do things in a certain order, I can't hardwire said order into the code because the player is the one creates it by clicking on instances. So far I've made it so the first instance the player clicks on has the instance variable "selected" set to 1 and the 2nd one gets it...
  20. Heavybrush

    take object instances

    how to take the instance of the current object created? how to take the previous? how to take all the instance of a specific object? and how to take width and height of the sum of all the instances of an object?
Top