• 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!

instance

  1. K

    Help with regional activation/deactivation

    I'm trying to deactivate my objects outside the screen, and activate them just before they appear. I am using instance_activate_region(view_xview, view_yview, view_wview, view_hview, true); which is working except for my trees. My trees are 64 pixels tall, 32 wide and whenever I move down (top...
  2. H

    too many instances of one object

    i realized that one of my object is created more then one time. can i make an if sentence where it checks how many instances of this object are active and destroy every instances above the one.
  3. J

    Trouble with post-draw instance destroy

    I have coded for a hitbox to be created when the player is attacking like so: // Hitbox if (image_index >=0) && (image_index <1) { with(instance_create_depth(x,y,0,obj_hitbox)) { image_xscale = other.image_xscale; with...
  4. Y

    Legacy GM double collision (SOLVED)

    Every enemy in my game has a hitbox (this is an different object as the hitbox is different from the actuall mask_index of the enemy) but when I inflict damage this goes to every enemy in the room. here is the code Player object ///Hitbox if(Is_Attacking = 1){ if(image_index >= 7 &&...
  5. T

    Set up a variable and then increase its value for each instance...

    Hello, is there a way to do that? For example, I have 300 instances of one object, and I want each instance to have a value (starting from 1) that increases for each single one. Is that possible?
  6. S

    Check if id of instances is a certain object

    I want to check if my oPlayer instance can see another instance (oInputable), without beeing blocked by all other instances, grouped under the object oNotInputable. Both of these objects are children of the oSolid object that makes them all solid for the Player. To check this collision I use the...
  7. 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...
  8. M

    Problem when grabbing several items

    Hey everybody. My skills with game maker have been improving considerably, but I still have some doubts and I'll be very grateful if you help me. I've want to create items with which the player can "call" special strikes against the enemy. For example, the first item I made is for calling a...
  9. C

    GameMaker Add Instance to Layer

    Hello, I'm trying to have the player object remain on a layer that has the same name throughout all rooms in the game. When I start the game, I do receive an id number when debugging and the same is true when I change rooms. However, when I go back to the original room, the game freezes when I...
  10. H

    i want an instance create at at specific position.

    i have a game. if you know the Game, Don't touch the white tiles. The objects in the game are moving are like this. At first i had an alarm timer to spawn the objects, but when it gets faster the timer ist to slow, sooo. i need an idea, for example. i want, that if the objects in the middle...
  11. FrostyCat

    What's the Difference: Objects and Instances

    What's the difference: Objects and Instances GM Version: N/A Target Platform: All Download: N/A Links: N/A Introduction At least a dozen times a week, I see questions on the Q&A section that have to do with people not distinguishing objects from instances. This topic aims to explain the...
  12. L

    Instance destroy with mouse button release

    Hi, I've been trying to write a piece of code that would destroy an instance with mouse button release. I tried the below, but it wouldn't work - none visible action is performed: if (mouse_check_button_released(mb_left) && position_meeting(mouse_x, mouse_y, id)) { instance_destroy(); }...
  13. S

    GameMaker (Solved) activate and deactivate instance by id

    does anybody know how to deactivate and activate a instance by id? /// @description Insert description here // You can write your code in this editor event_inherited() var dx1 = screen_y; var dy1 = screen_x; var dx2 = screen_y+screen_height/16; var dy2 = screen_x+screen_width/16; for (var...
  14. S

    GameMaker (Solved)Gamemaker throws a error on line that doesn't make sense.

    does anybody know why gamemaker is throwing this error.. ERROR!!! :: ############################################################################################ FATAL ERROR in action number 1 of Draw Event for object W_View_Screen: Unable to find any instance for object index '2' name...
  15. R

    GML Creating variables for copied instances

    Hi everyone! Let's say I have an object in my room. Then, through some way, I copy this object, creating a new instance of it. I can keep copying it if I want, ending up with multiple instances of that object. What I would like to know is, if it's possible to address a new variable to the...
  16. P

    Pathing Question

    When creating an instance of an object from another object (e.g. new_instance=instance_create(x,y,new_object) how would you also set a path for that other object without setting the path within code of the other object? Also, when using paths for movement how can you change animation based on...
  17. J

    Windows Global test????

    I have set this in a script: global.point =0; and in another script: global.point +=5; but I cant seem to figure out how to test this variable :( I have tried a few things but I just keep getting errors. I want to test this variable so that i can delete an instance of an object but can't...
  18. C

    GML MP checking who "owns"/ controls a instance

    Hey guys, I currently have a ds_list from wich you can choose a Player you want to join in his team. The chosen player gets put into a global variable. What i want to do now is pick a instance and then check wether it belongs to the selected player or not, so i can track its x and y position.(i...
  19. T

    Legacy GM Drawing many instances at a time.

    So this is my code: if instance_exists(obj_enemybullet) { if obj_enemybullet.sprite_index != -1 {...
  20. S

    GameMaker changing room does not happen until after event?

    does anybody know how to get around my object being deleted after I change rooms? //Goto Room room = rm_menu; //Toolbar tools_menu = new_item(0, 2, 0, Item_Toolbar_Menu, new_exit(6,6,5,1)); //Menus menu_tiles = new_item(0, 16, 6, Item_Option_Tileset, new_exit(0,0,6,6)); /// @description...
Top