• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

instances

  1. C

    Check small collision_lines for multiple instances

    Hello everyone, Only been using GMS for a little while and having an issue with multiple instances of an object using collision_line(); I have an object that detects if the player object is right below it or right on above it. Either way, when one of these collisions happens, another...
  2. Fluury

    Memory Usage and the amount of Instances.

    Heya! I have lately ran into an interesting "problem" which is making me pretty confused. The project I am working on has level generation, which is creating a lot of instances. Some levels are bigger than others, and thus are more prone to having more instances. One day I realized that the...
  3. F

    SOLVED Pause all but one room?

    I am trying to implement a pause system into my game. The only time I want the game to pause is when the player is on the main menu room. I have numerous persistent objects that are initialized on game start. Could I use instance_deactivate_all(true) and pick and choose which instances don't...
  4. F

    Suggestions on keeping instances in their current states.

    I am making a system that places the instances in a room once clicked either true or false. However, I ran into an issue where once I leave the room it resets the room back to its initial state. which means that the instances have been reset. I discovered that I can use the persistent room check...
  5. FrostyCat

    Asset - Scripts Extended Collision Functions

    Extended Collision Functions Companion scripts for built-in collision functions Overview Extended Collision Functions are enhanced versions of built-in collision functions. You can now easily check for collisions with multiple unrelated objects/instances at a time, and optionally pass in a...
  6. Krenzathal77

    Using "with" to store ID of an object's creator in variable (not working)

    Hi folks, I'm having a problem with storing instance IDs. I have multiple instances of an enemy object that can attack the player with punches/kicks etc. These enemies create hit objects which collide with the player, so obviously I want the hit objects to know which instance is creating them...
  7. otterZ

    GMS 2 Question about Instances and Texture Memory [SOLVED}

    I am interested in how texture memory on a device is influenced by instances using sprites in different ways. I can't quite put into words exactly what I mean here, so here are some example scenarios below . . . Example A) If I were to create an instance that drew a large sprite, let's say for...
  8. Papa Doge

    GMS 2 Planning: Maintaining surface world when entering a dungeon

    Hello, I'm at a critical point in my game's development where I'm starting to get into scaling and performance issues. I've coded myself into a hole so to speak with some previous features that resulted in costly refactors. To learn from my mistakes, I'd like to do better planning before I work...
  9. Fredrik

    [SOLVED] Saving and regenerating instances that the player has spawned

    Hey! A few days ago I asked for help on how to make a system to save 'states' for various instances that have been changed by the player, like in a dungeon crawler if the player break a crate or open a chest, to then go down to a new floor, and then back up to the previous one again, and how to...
  10. Shadowblitz16

    GMS 2 is there a way to send instance id's over network?

    hello I am getting into udp networking in gamemaker and I was wondering how to sync a object by a instance id? I keep getting back different ids then what is on the other end. I would think instance id's start from some base number and amount sequentially during the programs life but it seem...
  11. Z

    (SOLVED) Changing a group of instances with the same pre-condition

    Hi everyone! I have an object that is spread across a room, meaning there are many instances of that object. In the instances creation code (not in the object create event, but in the instances creation code in the room editor) I gave "groups" of these instances a specific value. Some of these...
  12. Rowan

    GMS 2 Failing to read an instance's variable

    Currently trying to make it so, when my cursor is over a specific object instance (in this case, an instance of obj_cat), it should print the 'lastname' variable stored in the instance. I think I am having trouble with setting the variable properly, or else the scope is wrong somehow. The...
  13. qbot21

    GMS 2 [SOLVED] Spawning four instances at once

    Hello!!! I came across a problem that when I fire a gun, four instances of a bullet are created at once (each on top of other). I really don't have idea what causing this problem :/ I have a parent o_player obj, which have three childs. Each child inherits whole step event from the parent. At...
  14. Justin Sousa

    How to make single Instance of an Object change Direction when Player passes it

    So I'm developing a side scrolling game titled 'Gulpy' (my first game) and I'm having trouble making a single instance of an object change direction when the player passes it (in this case the object are tiny fish that the player must eat). I'm trying to make it so that each fish that the player...
  15. Z

    (SOLVED) Order of priority in instance code (Basic question)

    This might seems like a stupidly basic question, but I need to make sure. If you have multiple instances of the same object in a room, and that object "spawns" more of these instances on a grid, it's obvious you don't want to allow a situation where spawned instances are spawned on top of each...
  16. L

    Controlling stacking order of code-created instances

    Hi. I'm using Gamemaker Studio Pro 1, and have run into something which I can't seem to find an answer to. I am creating random playfields (platformer), so pretty much everything is being placed on the screen via coding, rather than manually placed by me. As a result, I noticed that the...
  17. L

    GML [SOLVED] Pseudo Room Problem - Space Game

    Hello all, this is my first post so apologies if this is in the wrong place or badly formatted. In my game, you fly a spaceship. This spaceship has multiple levels, but the ship as a whole stays in the same room (so your position in space and other objects in space don't change). I have sprites...
  18. 2

    GMS 2 Studio 2: Finding Top Most Drawn of All Instances at Mouse Cursor on Click

    I need to make something that will return the top most instance where the mouse cursor is currently clicking. This is probably different in Studio 2, so how would I adapt the code below? It doesn't matter if the draw order is always the same, just that I can find from multiple instances at the...
  19. Z

    GML instance_nearest not working

    I need the guide point for the pedestrians in my GTA 2 styled game to find the nearest direction object so they can start the loop of walking along sidewalks. Long story short, I want them to get the nearest ped direction object, using a variable called resetPoint. This is the code I used...
  20. MadTinkerer

    GMS 2 Getting Object Variables?

    Getting the value of instance variables is easy. You can just say myNumber = obj_OtherObject.myNumber or something like that and it will work. You can also get the value of certain variables. object_get_sprite will get the sprite index of an object. object_get_parent will get the index of the...
Top