code

  1. K

    Question - Code Tab characters showing up in draw_text?

    I'm not sure if this is a bug or not and I can't find it anywhere on the internet. I'm simply drawing text to the screen as seen below: but when it renders, it seems the indentation (tab characters) are also being rendered as seen here: The tutorial I'm following along with does not have...
  2. XirmiX

    GML [SOLVED] Assign code to just-created instance BEFORE it runs its create event?

    I've found trouble doing this. It essentially boils down to having the create event code from the object be placed inside the object/script that creates it. The "with" variable does not help at all, wish it did, seems redundant otherwise. What happens is: Object creates an instance of another...
  3. C

    Need Help with programming a Menu system

    Hello, I am trying to program a simple menu system in Game-maker Studio 2, I am very new to coding so I followed a YouTube tutorial for help () However you can only press the down arrow and the S key and they send you to the very last option on the menu with no way of going up. Here is my code...
  4. EZTALES

    Legacy GM easier way to do textboxes?

    hey yall, i got a question for the forum, at the moment i have a basic way to make a cut scene with a textbox, but it feels tedious and i was wondering if i could make it simpler. heres how it works: when the player presses Z on a specific object, it will take him to a room and then the cut...
  5. Tuna

    Legacy GM Sprite drawing flashing issue [SOLVED]

    I have been trying for a while now to draw a melee weapon on my character, but whenever I have its position change throughout an animation, the weapon sprite flashes, sometimes for multiple frames. As you can see in this recording, the sprite is normal when being drawn as a single frame...
  6. M

    <SOLVED> Character Getting stuck running into walls

    It is not the collision sprite changing, since I have it at the same parameters for all sprites, It must have something to do with my collision code. Here it is, it is located in an object collision event if that might be causing it. //Horizontal Collision if...
  7. Edwin

    Legacy GM How to restart the script again?

    Hey, pals. I made a simple randomizing script with exception value, like if you want to get random value BUT, for example, without 100 or any value else. /// irandom_exc(x, exc) // Arguments var max_value = argument[0]; var exception = argument[1]; // Choose random value var value =...
  8. C

    Problem with collisions

    I am currently making an action platformer and i have problems with collisions. The code goes like this: Create Speed = 0 Step var move = (keyboard_check (vk_right)) - (keyboard_check (vk_left)) speed = move * walkspeed If (place_meeting(x + speed, y, wall)) { While (!place_meeting (x +...
  9. O

    Help With Charged Move

    I'm still learning with GMS 2, and recently i tried to create a charged mechanic. Basically, what i want to do is when i press "space" key, the player object will stop moving and begin charging. And then, when i release the "space" key, it will gain a boost movement for several time before going...
  10. H

    GMS 2 Line -1 of step event in event handler?

    Hi there, noob here. I'm working on a school project (final fantasy styled game) and this error happens on irregular intervals: ___________________________________________ ############################################################################################ FATAL ERROR in action...
  11. Liam Earles

    Variable not set before reading it

    So I was working on a project and while testing, I got a crash bug with an error message saying this: ___________________________________________ ############################################################################################ FATAL ERROR in action number 14 of Step Event0 for...
  12. Alloi

    Question - IDE [SOLVED] GMS 2 Can't Launch Game

    While working on my game everything was working fine; I edited one of my sprites dropping it from approx 10 frames to 3, after doing so my game would not launch. I do not think it is associated to the sprite change but maybe there is something you all know that I don't Thank you for any help...
  13. id07

    Legacy GM destroy instance in other room

    How can I do this correctly? instance_destroy(room5, x, y, obj_overworld_monster_test); I'm making a small rpg type game, and when I have the player run into a monster sprite in the overworld, I had it create a representing monster instance in a different room. I set up an HP variable for the...
  14. M

    GML vanishing point concept with sprite?

    Hey everyone, my name's Jordan and i am excited to be using GM but am having trouble fully understanding all code, or at least writing my own that's more than 2 lines long.I was searching around on this forum/google for some help but had no luck, been creating a game mostly through information...
  15. B

    GML Hitbox Doesn't Work

    So ive made a character and a hitbox and then put in collission code between my hitbox and my enemy but it appears i made a mistake. Can anyone help me? My attack code is hsp = 0; x = x + hsp; image_speed = 2; sprite_index =...
  16. K

    Legacy GM console code running multiple times

    For some time now, I've been trying to make a tiny game with an easy concept. However, for some reason, I have been unable to make the program work. The main idea for this game is that you have a raster of objects and when you press one of these objects, it gets infected. This infected object...
  17. JohnSebek

    GML Enemy animation and behavior bug

    Hello, so I made an enemy from a tutorial by Shaun Spalding. And added a little animation code. But I have several problems and I tried to fix them for two hours but still no luck.1. The enemy does not change sprite when walking left.2.When the enemy is attacking player he showed the right...
  18. C

    is it possible to draw variables on objects with codes?

    hi, im working on a game that involves drawing hundreds of variables on objects. each object has its own unique variable ( a counter) attached to it. currently im using drag n drop and have done 50 this way. the position for the count is -5, -5. obviously this is a very long procss and will...
  19. B

    GML Stationary attack and attack animation problems

    Hello everyone my name is Ben, I just started using gamemaker and i am usingit for a school project. This is my code so far except i have 2 problems 1) My attack animations doesnt seem to play al the wat 2) I dont know the code to make my character attack when he is stationary Note: changing...
  20. X

    How do i make an event trigger only once ?

    Hello ! I am new to Game Maker , and i've been trying to create a mega man style game . I created an enemy , which goes from one side to another . This is the code i used for the enemy to change it's direction when it collides with an object . ( Image_index ==0 means sprite facing the right...
Top