code

  1. G

    I am getting a programming error message: Variable <unknown_object>.y(1, -2147483648) not set before reading it.

    So, i follow a tutorial and i made the script as i saw from the tutorial but i got this message ___________________________________________ ############################################################################################ ERROR in action number 1 of Create Event for object...
  2. flykidsblue1

    Idea Is GITHUB a viable way of storing files for my games?

    Hey everyone! So I basically want to add a "news" section in my game where users can be informed of any upcoming updates to my game/games and what not. I was using the http_get_file(); funtion to download the "news.zip" file. I was first thinking of using google drive, but each time I delete the...
  3. C

    Hot bar Spell cooldowns

    I'm currently working on a hot bar for spells in my game, and I got something working but I think its just way to much unnecessary code. I was hopefully one of you Game maker wizards could help me. anyways code: I only provided the code I'm using for the spell cooldown. here are 4...
  4. Daniel Mallett

    Sanity check

    I spend a lot of time coding alone. I always feel as though I am in an echo chamber. Is there anyone (Preferably someone with more experience than me) that would be willing to take a look at a sample of my code just to offer some advice. Just to check I haven't got any bad habits or doing...
  5. S

    SOLVED Hi, beginner here. I have not been able to successfully code my bullet laser i have made to shoot from my ship. Please help?

    I have now been using Game Maker and learning to code in GML for 3 days. Someone else on here helped me with something before so I am hoping someone can help with this. I have tried to code a laser bullet to shoot from my ship, but when I press the space bar that I have assigned to shoot the...
  6. Atbit

    What can I do with sequences?

    1) Is it possible to mirror and rotate sequence animation like in the case of sprites? Like when it's turning 180, the bullet cases flew to the right, not to the left; 2) Is it possible to randomize xy coordinates to prevent the cases from falling to one point? P.S. I don't know why, but...
  7. Gigicom

    GameMaker Use code in json file

    Hey, I‘m trying to figure out how to use pre-defined json files for some item data in my game. Before, I simply assigned all values to variables and assigned those to a ds_map like this: constantData = item.apple; name = „Apple“; graphic = spr_ItemApple; list = ds_list_create(); listVal =...
  8. B

    Weird Sprite Spawns

    Random Sprites Spawn during my game like those gradients and the main character space ships i have no clue how to fix this, Evan when searched the sprites are used in any code, just background use only.
  9. N

    Is there a way to time code? My A* is too slow.

    Hi guys, so I've implemented A* for my hex grid, but it's too slow, as in, it's causing noticeable lag. Note that each run of it isn't terribly slow, but I have to run it across ds_lists that can get up to a hundred entries long (using it as a pathfinding check). If this were python, I'd throw...
  10. ZacKow264

    SOLVED Opening windows in code?

    Simple question, is there a way to open new windows in code? Like a second window for the game? What are the limitations of this, if it's possible? Does anyone know? This would be in the actual game itself. So I want to basically open another window automatically while the game is running. Is...
  11. X

    Windows <SOLVED> My global variable edit resets every room and I'm not sure why

    I've tried heaps of different things to try and fix this but so far nothing has worked This code is in a pickup item that effects your fire rate. This is in the collision with the player event if (global.hasgun == true) { global.firedelay = global.firedelay + 0.1; } instance_destroy()...
  12. V

    I'm having a duplication bug I can not figure out.

    I am making a card game and I have the draw and use function almost complete. Right now, however, my deck never runs out of cards. you can see in the first screenshot that I am creating 6 cards in my deck but they never get deleted when used. Here is the code for it. P.S. Sorry if the format is...
  13. CK Scores

    Mac OSX Gamemaker Studio 2 v.2.3.0 cannot load projects

    Hi guys, I recently got the new update for GMS 2. However, I cannot load my projects and when I click play, the output only runs for less than a second before it stops. There are no compile errors or any other type of error to show. I've restarted the app multiple times. I'm not very...
  14. D

    SOLVED #region code folding

    Hey, I wonder if there is an option for the IDE to toggle remember/forget which #regions are folded and which ones are not, when closing and opening your project? Thanks in advance.
  15. P

    Legacy GM Check collision with all objects but self?

    Hello! I'm making a simple game in GM1.4 and I want to check if an object is colliding with any other object but not with itself. This is the code I'm using: if position_meeting(x,y,all) { global.free = 1 } if !position_meeting(x,y,all) { global.free = 0 } Tha variable global.free is always...
  16. J

    Enemy sprite jitter when following player (SOLVED)

    (this is a video example of my problem) The enemy object seems to jitter up and down on the yaxis when following the player from the direct left or right. here is his movement code: dir1 = sign(obj_player.x - x); dir2 = sign(obj_player.y - y); hspd = rspd * dir1; vspd = rspd * dir2; x =...
  17. G

    GameMaker Jump Animation

    So I'm making 2d platformer and I don't know how to make correct the animation of jump, in my case the player jump and the animation is playing very fast and ends in air, I will post the my animation code in Step Event below //Animation //===Walk if (key_right) { sprite_index =...
  18. M

    how to exit code but not the whole Event?

    For a long time I was puzzled by why an enemy object's Create event wouldn't work (it would only play actions up until a certain point). Then I realized that in a code that is played in the Create Event, when certain conditions are met, it says the 'exit' statement; I originally meant for it to...
  19. M

    GameMaker Array for Collisions HELP! [SOLVED]

    Can someone help me simplify this into an array or something else? Even with years of experience with GMS I still struggle to understand simple arrays, especially after coming back to it since buying GMS2. I feel like this should be easy but everything I try doesn't work. If someone could...
  20. R

    SOLVED collision problem

    Hello, I am having the most frustrating time trying to understand what I am doing wrong in my code, because the collision works sometimes and sometimes it does not. for example, sometimes I get stuck in the ground right at game start. And i have noticed this only happens when I apply a...
Top