• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

instances

  1. Fielmann

    Why not use object instances for inventory?

    Practically all guides these days advocate using structs for the inventory system. This makes the code for interacting with the inventory (clicking, dragging, combining items) much more complicated. So why not just use instances instead? A couple of dozen of them at most is not going to hurt...
  2. thejosving

    SOLVED Instance number from different rooms?

    Hello! How are you? I'd like to know if there's a way to find the number of instances of a certain object in another room, other than the atual room. For example: There's some coin objects in the room 10. I would like to know, at the start of the game, this amount of coins. Any help would be...
  3. Erik Leppen

    GML (solved) How to check whether a variable holds an instance vs. an object

    For years I have used the following code in a debug functions: if instance_exists(v) and not object_exists(v) { /*...*/ } This code is meant to check if the variable v is actually an active instance in the current game state, and not an object of which instances are active. This worked for...
  4. FlatulenzaFiamm

    GML There's really NO way you can read an instance name via code?

    Greetings comrades. I was messing around with my project today, and wanted make a system were a specific variable is created for an instance ONLY if it's name is "culo" through the Room Editor. So I was going for something along the line of: if instance_name = "culo" { scoreggia = 0 }...
  5. T

    Question - IDE Why do my Instances keep disappearing when played for testing?

    Feel free to check my settings or ask to see other parts of the program. I genuinely have no clue why the instance keeps disappearing. I have no Antiviruses installed, the instance is visible and on top of the background, etc. I'm very new to Gamer Maker as a whole so I'd appreciate if you could...
  6. JeanSwamp

    Instance count based on room size/available space

    Hello, I am trying to come up with a way to dynamically modify the amount of enemies, objects, and other instances I create in procgen rooms, which are grid based. Ideally I'd want to have a minimum amount of those objects to be spawned, and be increased if there's more available space. Here's...
  7. I

    Instances

    I have two Objects 1- oStone and 2-oWallStone And under every oStone Object There is An oWallStone under it so that I can Collide with and don't walk through it. So what I want to do but can't is to destroy the oWallStone instance That's under the oStone that I picked up so how do I do something...
  8. I

    (Related To "Objects")

    In my game That i am making i have a room that has more than one instance of the same object "Rock". i want to have one object but duplicate it in the room. the problem is i have a code that makes it when i pick it up it destroys it self and other stuff happen and it works fine but the problem...
  9. L

    Need help setting timed notifications

    Hello guys, I'm working on a multiplayer game. Currently, every player is assigned to the same object (using rollback's define player function). After the instances of said object spawns in when a game is started, I want the players to wander the room freely for 30 seconds, with a notification...
  10. AnnoyingDoggoX

    GML Issue with arrays when creating instances of textboxes

    I will show my code from relevant objects and events and label them and then describe the problem. //Object: obj_textbox | Event: Draw //draw textbox draw_sprite_ext(spr_textbox, 0, x, y,boxscale,boxscale,0,0,255); //draw text draw_set_font(fn_textbox); draw_text_ext(x,y,text[page]...
  11. A

    GameMaker an instance from previous room is created without im scripting it

    Hello, I have a problem with an object. I create a new room in my project and for some reason an object character is created in this room. I reviewing all the codes and at no time I called the "Instance_create" function
  12. Daniel Mallett

    1000's of object instances

    I have not used Gamemaker in a way that requires many many instances yet. Before I start on this project I wanted to get a feel for what types of issues I may come across. I want to make a tower defence game like Bloons tower defence. Am I going to have to be cleaver about how many instances I...
  13. HuntExe

    SOLVED [FIXED] How to only affect the instance of an object my mouse is clicking on

    I'm very aware this is a basic problem but I haven't been able to code in GMS 2 for the past few months and I've forgotten how to fix this. I have multiple objects in the same room. It's a button, and I'm trying to make it so when I click on one of these it only affects that one and not all of...
  14. D

    SOLVED Storing multiple instances and modifying them differently for different situations

    Hello again. This problem is related to a previous topic I opened (https://forum.yoyogames.com/index.php?threads/cropping-an-objects-sprite-with-code.92396/) Most of the suggestions levied there did not solve the issue and I could not wrap my head around it, so I torched most of that code and...
  15. AnnoyingDoggoX

    SOLVED Help with randomly creating instances within a room.

    room_w = room_width room_h = room_height repeat (50) { instance_create_layer(random(room_w), random(room_h), "Fish", obj_fish); } This code should create 50 randomly located instances of the obj_fish on the "Fish" instance layer of the room. It runs fine but nothing happens. It runs on room...
  16. L

    How to handle 100s of Instances?

    So Im developing a game server for an io game and there are many instances of the players on server (each player is a new object ), each object following physics code , raycast codes and updation of various variables. So right now on a fairly good gaming pc everything starts slowing down after...
  17. N

    SOLVED Multiple Objects / Instances Causes Strange Behavior

    This one might be hard to troubleshoot without replicating the problem, but I figured I'd give it a shot and ask the question anyway. I'm basically making an Onitama (Or Chess, Shogi, etc) type game, so I want the player to click individual pieces then click valid spots on the grid to move...
  18. M

    Debugger Instances Tab not working (GMS 2.3.5) (Solved)

    When running the debugger, all of the watcher tabs seem to be broken. My goal is to see a list of all the current instances in a room. The profiler works fine, but the "instances" tab is simply blank. Am I missing something? Thanks in advanced Manual says "Pause" the debugger. I see them now.
  19. flyinian

    SOLVED Interact with a single instance

    I have instances that the player can set on fire. If these instances are close to one another, the player can interact with all of them at the same time. What can I do to prevent this from happening. Code(Step): if(distance_to_object(Obj_Player) < 30 && !_SetonFire){ _Close = true;} else{...
  20. giraffeman210

    Created Instance that can change creator's variables?

    I am trying to make something where an instance is activated and it creates a different instance. and I need it so the created instance knows the creator. This way when you activate the newly created instance it changes a variable on the instance that created it. Any ideas? Thanks!
Top