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

objects

  1. flyinian

    (SOLVED)Looking for ideas, suggestions and so forth on how I should manage my persistent code.

    In my current project I have to keep track of numerous changing numbers. i.e cash, statistics, etc. I am currently planning on placing all of this code in a single object and making it persistent. Would this be a good idea? What do you recommend? Thanks.
  2. flyinian

    I need clarification on placeing objects in a room.

    Correct me if I am wrong: If I have an object and I place it into a room, that object in the room becomes an instance of said object. That instance will be at the x and y position that I placed it at in the room. All is fine, however it is recommended to code your x and y positions within that...
  3. M

    Windows A question about arrays

    Hello. Excuse my english grammar I'm not a native speaker. I'm new to programming gml and I hope to learn more about this subject. I'm currently working on a collision system that's easy to use. I made a script in the resources tab containing an array of objects my player should be able to...
  4. SirCaliber

    GML [SOLVED] Objects will start with a random hsp variable, but only when created by a certain object.

    I have an object, oCorpse, that creates a random amount of oLoot objects when it is created. In those oLoot objects' create event, they get a random hsp and vsp variable. But the hsp only works if it was created by oCorpse, not by oChest. (oChest) On Collision with oBolt: with(other){...
  5. S

    Coding help

    I'm SUPER new to game maker and just need a bit of help with some coding. Let's say I have two Objects, Object A and Object B. I want to make it so when I interact with Object A, Object B's sprite changes. How would I go about doing this? Help is much appreciated :)
  6. S

    Creating from, picking random and adding to ds_map

    Let me explain my problem in this example. i have variables for each object objvar1 = 1 obj1disable = false objvar2 = 1 obj2disable = true objvar3 = 3 obj3disable = false objvar4 = 1 obj4disable = false one empty ds_map and i have 4 objects...
  7. O

    GameMaker How to grow and shrink an object gradually

    I am not sure if there is a bug or something but I cannot get shrinking to work. It works for making an object grow, but the same thing doesn't make the object shrink. I am changing the xscale every step by adding to it. Also, the same logic but used on the radius of a circle drawn in the draw...
  8. B

    [Solved] create objects in predefined location in room checking collisions

    I need to create 25 block objects in a predefined space (within the view area), only random and checking collisions with other objects and only appearing in place free, but I can't. delimitations (area where the object needs to appear inside): x 32 --- x 640. y 64 --- y 960. P.s: the object in...
  9. S

    Sprite Swapping For Enemies VS Individual Objects

    I’m designing a platform game that will have different enemies depending on level/room and I was interested in whether just changing an object’s sprites based on the level/room was a potential way to go? For example: Each level/room would have an enemy that crawls back and forth along a platform...
  10. tagwolf

    How to plan and manage code for larger projects

    Game Development Code Planning GM Version: ANY (and not just for GameMaker, however this will be GMS2 "centric") Target Platform: ALL Download: N/A Links: N/A Summary: This tutorial will go over code and object planning for game (and application) project development to minimize re-coding and...
  11. C

    GameMaker Script to detect distance to object only working with one object.

    hi guys and girls, I am having some issues with a script I have made, Basically I want a space ship to drive up to a planet object and when its inside the diameter of the planet object get smaller (as if to land on the planet) I have got this working correctly if...
  12. P

    Help with "other" (Drag & Drop)

    I'm trying to move all of the other objects in the room except for the object containing the code itself, and used this: but none of the objects moved except the sprite with the code. (basically the opposite of what I'm trying to achieve) Can somebody help me?
  13. V

    3D help(Crosshair checking with an object)

    Soooooo I'm making a 3D game inspired in I'M SCARED, and I'm with a problem. I made a obj called key, and the sprite and the creation of it in the world it's already done, but, I've made a crosshair using draw GUI and I want to take that key when the crosshair is above it maybe pressing the...
  14. P

    Assigning data from one object's variable onto another using "with"

    Hi guys, I'm making a space trading and top down simulation game similar along the lines of the Patrician series and somewhere along the code I've run into an issue I'm quite unable to solve by myself. Most of code structure is established by now and all it's left is to assign resource transfer...
  15. K

    Windows Non - intentional transparency issue with objects

    While the game is running, some objects appear as transparent while others are completely fine. I have a feeling that it might be an error with GameMaker Studio 2 itself but I'm not so sure. I made a new project and imported/copied over the same sprites, objects, and code and the transparency...
  16. M

    GameMaker 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...
  17. giraffeman210

    GML Visual click on an object

    I see that you can set the mouse to do something when clicked but how do I make it so I can click on specific objects? GMS2 and dnd. Thanks!
  18. C

    Question - Code Problem with enemy bullet directions

    I'm creating a platformer game. I want the enemies to constantly shoot in the direction they're facing, but I'm having a problem: the direction of the enemy bullets are all in sync. (In other words, one of the enemies correctly shoots in whichever direction it is facing, but all the other...
  19. B

    Legacy GM Calling Script Twice to Generate Multiple Families of Objects?

    Hello, Long story short, I have a tile-matching game that gets its data from a JSON file, as an array. When one enters the playing area, a script generates the play area as an object from the JSON, creating the area where the player can drag the right tiles to the correct spot. The datasets...
  20. C

    Can't get code to work for rewards

    Hi, so i have a game where you can find treasure chests. each chest has its own set of rewards for example chest1: 1-2xp, 3-5gold chest2: 2-4xp, 5-7gold, 1-2emeralds etc I have a chest object that creates each of the objects (xp etc) , which then shoot off to the hud element and add to the...
Top