instance

  1. D

    Help with Code - Collision

    As an assignment for class, we are creating a game using GM Studio and for a certain part I am required to figure out something with code but I'm really confused and the teacher won't help. Please if anyone can help The object of the game is to have a ball hit a goal to score and win, but it's...
  2. Wuzzems

    Legacy GM [SOLVED] Specific Instance Burst Emitter Checking

    I currently have my particle system,type,emitter etc setup within a script (Particle_1) which I call upon when obj_small is in the vicinity of obj_ship and the player has pressed space. All of the obj_small instances are moving to the left if !place_empty(x,y) &&...
  3. E

    Question - Code Instance_place() not working as before?

    Hi there! I'm really confused with this. I imported my GMS1.4 project into GMS2 and it works perfectly. But since I didn't have much progress and I wanted to get used to the new program, I started it again on GMS2. Until know, everything perfect, but the problem came when trying to work with...
  4. U

    object_index could not find instance

    I am trying to simplify dealing damage by having a generic hitbox determine what to damage based on the instance's parent. // outside information target_group = object_parent.object_index; // inside collision with parent if(other.object_index == target_group) { /* Do stuff */ } However...
  5. S

    [SOLVED] Having Trouble Triggering an Event

    Hello Everyone! I am having trouble triggering an event after the final boss of my game is defeated. Basically, what I want to do is display a "BOSS DEFEATED" message after the final boss is defeated. I created a controller called "boss_timing_controller" that looks like this: This...
  6. mar_cuz

    Legacy GM Instance nearest in direction

    Hi Guys, I'm making a top down game and I'm trying fire a projectile at the nearest instance in my current direction only. The instances I'm trying to fire at are different but share the same parent. I'm trying to use the parent as the target so I can just hit the nearest instance in my...
  7. P

    Lvl Created obj spacing issue

    I am writing this from my phone. I need some help on how to create instances upon a random generated level that have a space(about 256 pixels away) between each instance. . like this(focus on the blue/purple x) but that was by luck. this is how most of my rooms look like i want the Xs to be...
  8. R

    Specific Instance ID

    Hi, I have a room where if a specific enemy does not exist(it dies), then a key will spawn. But because there are multiple of these same enemies, I am using the instances ID. if !instance_exists(C3ED5ACA) //Enemies ID { instance_create(64,440,obj_key) } I realize this does not work, how would I...
  9. A

    HELP! How do I find an instance with id

    So I used a system to select a unit on a grid that utilizes that tile's id to select it. Now I want to check a variable, 'covered', that is in that object. How then would I do this? I tried instance_find, but I do not believe that is what I need to achieve my goal. Any help would be greatly...
  10. F

    Array Object

    Hi! Can someone tell me if this code is right? I mean if i can get "y" from an object through array. if(nostick==1) { array=instance_create(obj_player.x+75,obj_player.y-75,obj_stick); nostick=0; } if(array.y<150) <-- { array.vspeed=0...
  11. Samuel Venable

    Discussion How many people want instance_create() back?

    In other words, for 1.x project compatibility purposes, there should be a way to make a script named instance_create in the resource tree without it saying "Oops! You are using a deprecated function" error. How many of you want this for convenience? It wouldn't take much work for YYG to remove...
  12. G

    Windows Error related to creating a new instance of an object

    I am trying to simply create an instance of an object but it won't let me. I am not a noob, and this never used to happen. Did it update? ___________________________________________ ############################################################################################ ERROR in action...
  13. O

    Legacy GM How to select specific instance of object

    I have a mechanic of switches opening doors it looks like this: the problem is that on my code i am referencing the door_obj (my door object) so one switch opens all doors, i need one switch to open a specific door, so i have been looking how to select a specific instance on the room i came...
  14. L

    Legacy GM [SOLVED]Access instance's "Creation Code" without room GUI Editor

    Hey, I seem to be missing something glaringly obvious about instances :-/ I have two instances of the same object in my room but they only appear after text input by the user (so I cannot put the instances in via the room GUI Editor or else they'd appear right away). The instances are...
  15. 2

    Nearest Instance by x only

    How do I find the nearest instance of an object, but only by the x coordinates, not by angular distance?
  16. V

    Lifetime of an instance

    I try to give an instance a lifetime from 60 steps (1sec) but i'm in the learning process and new to Game Maker. So i guess it has something to do with alarms ...right ? what i'm looking for is something like instance_destroy(after 60 steps) can someone guide me to the right direction please...
  17. M

    Legacy GM Making preset instance creations

    Hello, all. I'm trying to make an infinite runner game. This is a little hard to explain, but the way I am attempting to do this is to have preset obstacles then create a random one in front of the player every few seconds. What would be the best way to do this? The only way I could think of...
  18. B

    Legacy GM Get list of instances in region

    Hi there, just curious if anyone knows if there is a way to return an array of the ID's of objects within a region? For example if I had 4 objects that are all in a region that is 128 x 128 pixels in size, would there be a way to get the ID's of JUST those instances returned in an array...
  19. D

    [SOLVED] GML Parenting question

    Hello everyone. So I found some time to start playing around with this sweet engine. I can say that Shaun has got excellent tutorials on youtube. So I was watching the one for the beginners, that we create an asteroids clone. On the fourth video, he demonstrated parenting. Comparing GML to...
  20. C

    Variable score issue ( with )

    Hi again. Coming from Ruby, Java, C#, C++, etc. I'm having a really hard time adapting to GMZ. I like the language for It's simplicity, but I can't get around some scoping problems. Here's the problem I've been having: local variable tower_hp(100003, -2147483648) not set before reading it...
Top