instance

  1. inertias

    Help me understand this code that works

    So someone asked a question on reddit about instances following the individual object that creates them. If you look at the posted solution, it works perfectly but I don't understand why. Here's what they wrote: Haven't been programming for long so I don't understand the "inst.creator"...
  2. D

    Question - Code Is it possible to remove an Event during run time?

    Hello! I would like to remove the Step Event for some objects during run time (i.e, while playing the game) via code, is it possible? For example, let's say I have an object with Step Event defined in IDE. Then I run the game, start playing, an instance of that object is created, and later I...
  3. S

    GameMaker NOT creating instances

    I have a problem with creating intances of an object. I need to move instance to the wall (after key released) then this instance should destroy. After destroing when i realesed a key (again) it shoul be placed into its first position and then repeat this action again. The problem is in not...
  4. S

    GameMaker If Instance Clicked

    I have created a bunch of instances, I want to know how I would know if I clicked it because position_meeting() would activate all of them. It's a pretty simple problem but I haven't been able to find any answer anywhere.
  5. S

    Legacy GM [SOLVED] ds_grid Position Detection Help

    Hey! This is my first post on the forum so I'll try to be as clear as possible! I'm creating a digital version of the board game "battleship" for a coding class at my high school; however, I've run into some issues trying to get my grid to detect when an object is within a specific square. I...
  6. M

     Set object's draw order on "instance_create_layer"

    Hello guys! I'm working on a prototype and I've reached a moment where I'd like to create some objects on a Instance Layer. I called "instance_create_layer" and got what I wanted. But since I have more than one thing that will be "dynamically instantiated" I ran into a problem. When calling...
  7. I

    Legacy GM [SOLVED] Random enemy movement in turn-based game

    Hey guys, so I have a state machine of sorts. When the player character moves from one 48 pixel cell to another, global var EnemyTurn turns from 0 to 1 and makes the enemy randomly move a cell with this script: ob_enemy.dirr = choose(0, 48, -48) ob_enemy.dirr2 = choose(0, 48, -48) with...
  8. S

    GameMaker Change Variables Of Specific Instances

    I want to edit each instances variables depending on factors. I would also like a way to identify them so I can delete specific instances. Anyone know how to do this?
  9. T

    Game pause with sliders

    Hello everyone! I made pause system, everything works well. I have sliders (for game options) as individual objects and when I create them with instance_create I don't see any sliders. Without pause sliders created well. Is there way to create active object when game is paused (I use...
  10. L

    GML Instance room editor id aka name

    Hey, is there any way how to get that instance name from the room editor? "inst_something" by default. I'm trying to edit some things in game - for visual aid, save them to a file and load back once game is restarted. Now I can't store instance's id as this may vary between game runs so the...
  11. F

    GML Accessing instance stored in array returns invalid object (-4)

    Hello, In my game, I initialise 9 markers using instance_create(), and store them in an array. Later, this array is accessed by another object in order to retrieve a random object from the array, but the game crashes, and returns the following error: Pop :: Execution Error - Variable...
  12. D

    [SOLVED] Changing depth and using instance_deactivate_layer?

    Hi, I encountered an issue with my game after I tried to change the way my pausing works... Previously I created a screenshot sprite and deactivated all Instances but reactivated some controller objects... Now I tried to implement an Inventory and for that I refactored it to...
  13. K

    GameMaker Discrepancy of instance_number and actual count caused by instance_change?

    In my game i have a certain hierarchy built for more objects. "obj_interact" is my main parent and has the children "obj_tower" and "obj_rock". "obj_tower" also has a few children During the game your create instances of "obj_tower" and then choose one to keep. Here it can happen that an...
  14. J

    Create New instance, check all other of same instance, combine into new instance

    I have been fighting this for days now and its time I find some help... there are 10 stores. It falls into a inventory kind of thing. Basically, you pick the store (global.store) the item (global.item) rather its going in or out, (global.in_out) and quantity (global.qty1). After you pick all...
  15. T

    GameMaker Getting Object Variable With No Instance

    I'm wanting to use an object's variables, not an instance's. I have a build system setup to reference an object and then build the referenced object. After selecting the object to build from the inventory I'm getting an obvious error that there is no instance to pull in data from the...
  16. A

    Storing items with lot of properties in an inventory

    Hi, I began GML a week ago, I'm starting a top-down RPG and my items have a lot of stats (bonus hp, defense, magic-fin, durability, quality, rarity, type, price, name, attack speed...), that I need to carry on easily each time I move items (picking them up, storing them in inventory or stash...
  17. A

    GML How to change layer of all instances of a specific object?

    I'm a beginner in Game Maker Studio 2 and I am trying to add a special feature to my game, but I just can't make it work fully, due to that the instances created by "room_instance_add" appear above every other instance in my room and I can't fix it completely with function "layer_add_instance"...
  18. T

    GameMaker Assign several instances of an object to different paths

    Hej everyone. As the title already states, i would like to assign several instances of an object to different paths i set. Lets say i have an "enemy" object which has a specific behaviour: It follows a defined patrol path. If the player comes near the enemy, the enemy starts chasing the player...
  19. X

    GML with() doesn't recognise the other object that executes it?!

    The "with" statement is supposed to take an instance/object and make changes to that instance/object as if it's written within that instance/object, but the object that executes the statement can be called within the statement through "other", right? Well, I have had this work well until now...
  20. X

    GML [Solved] Iterations problem

    100 - 15 = -140 ? Well, that's what game maker thinks anyway. I have a game where a projectile is colliding with the tank that launched it (the player). The projectile bounces off the wall and hits the tank after being shot in a way that lines it up with the player's tank. I have a variable...
Top