step event

  1. FoxyOfJungle

    GMS 2.3+ Update variable in step event without initialize it in the create event?

    It seems a little strange, but let's say I don't want to initialize a variable in the create event and just use the Draw event, is there any way to make that variable change without being started? I managed to do something like this: if !variable_instance_exists(object_index, "variable") var...
  2. P

    Switch Getting Ignored

    I've simplified it, but it's basically what I am trying to do. When a user presses a key it changes the state to idle and command to stop. Step Event switch(state) { case "idle": if (command == "go") { // do stuff } else if (command == "stop") {...
  3. A

    SOLVED Array out of bounds error

    got the error while executing my code for my card game code error: ___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Step Event0 for object obj_deck: Push :: Execution...
  4. samspade

    Design Step Events Versus GML Events

    Which would you rather use and why: an object where everything is in the step event, an object where everything is in multiple events? Example, a button object that has left pressed event, the mouse enter and leave event, the left released event or one object that does the exact same thing but...
  5. Lightning Gravity

    GMS 2 Most Important Multiple Step Event Per GML Object Amount

    Okay nevermind. I have just relies your own gml Scripting interface can still add onto your own gml Step Event coding part. As if you by accidentally have done your own Step Event coding part without your own gml Scripting interface coding part, you could of have done the way too much...
  6. D

    place_meeting trouble

    I'm making a basic space shooter arcade game and instead of using the built-in collision event I'm using place_meeting. Since this would have to be in the step event and the step event runs every frame I made a boolean variable named hit that will become true once an enemy hits the player's...
  7. N

    GMS 2 Having Trouble Moving Sprite Animation Frames along X and Y axis

    Hello all, Haven't used game maker long but I love it so far! My current issue is that I have an Action_Selector Obj with an attack option, when the user key_check_pressed(ord("A")) on that selection I want to hide the Idle_Character_Obj and un-hide the jump_to_target animation then wait at...
  8. T

    Legacy GM How to make an alarm that starts & loops in the step event ?

    I'm making an enemy object where the enemy will go on a specific path to patrol.Then he will stop at a certain point to look around for the player. I planned to make him change his sprite direction every 2 seconds(Enemies vision's for another day)but i seems to stuck here.I want the alarm to...
  9. M

    Problem with the "step event"

    Hi everyone, I wanted to make the weapon fixed to the player (as a different object). The problem is that in the step event I wrote x = oPlayer.x and y = oPlayer.y, I don't know why but there is a small offset when the player moves. Does someone know what is happening? Thank you.
  10. Jochum

    GML Problem with step event and point_in_rectangle

    Hi guys, I created this piece of code, for some reason it's not working. I have the variables stored in the create page and as check I created a rectangle with the same positions as I'm checking in the step event (same variables). The rectangle is drawn on the right place but for some reason...
  11. Zack

    GMS 2 Designing Levels in Notepad (video & text versions)

    GM Version: GameMaker Studio 2 Target Platform: All Download: Links: Video Link Summary: GameMaker Studio 2 comes with an advanced room editor. But, sometimes you might want to design puzzle, maze, or roguelike levels in something a bit more simple. I showcase how - and why - to...
  12. I

    Object Spawning Help

    So for this game I'm doing, I followed GravityShift Games' tutorial on making and Endless Runner but I'm expanding on it. Basically, i have an object that spawns enemies until the players gets to a certain score. Then it stops spawning enemies and spawns a jetpack that essentially triggers the...
  13. Chaser

    GML Sprite animations within the step event

    Hi, i have been working with 'States' and enums and i think i have got a pretty good hold of it. 1 object instead of many of the different behaviours, is very good way of working. i have my scripts, and yeah i'm pleased with where i'm going, however, that is until i come to the sprites and...
  14. A

    Simple Code not Working

    Cant for the life of me figure out why this isn't working, and I'm sure the answer is simple. Here is the code below, the card var is supposed to change when pressed, but both of their values are staying null (0) when pressed. The error I believe has to be within the step event for that to be...
  15. L

    GMS 2 collision acting funny

    GM2 Windows 10 within obj_player step event solid off physics off no collision event total newbie I'm playing with collisions for a top down tank game and came up with this bit of code. It draws a box with hit lines and feelers in the corners. I'm wondering why it works on the right side but...
  16. G

    Camera Object Won't Read Variables (SOLVED)

    (TL;DR version - I'm having trouble with the codes shown in the image. The game acts like the "view_w_half" and "view_h_half" variables don't exist on the step event page, and only uses the data they stand for if I put the data itself into that place)...
  17. W

    Legacy GM Can't stop character movement

    I'm going through my project and trying to make sure my character can't be allowed to move whenever certain things are going on like item menu being shown, or speaking to NPC characters, and for some reason it's only working half the time. For example when I speak to ONE NPC I can't move until...
  18. A

    GMS 2 State machine not updating

    I haven't used GMS 2 that much, considering I've just gotten a better laptop to play games and code on (My old computer can't run it), plus I've used GMS 1.4 since 2016. The main issue I'm running into is that, for some odd reason, the Dash state won't return to the Move state after the variable...
  19. F

    GMS 2 image_speed doesn't work

    Hi everyone. I just started using GameMaker a while ago and so far I haven't met any unusual problems, well until now. Everything in my script seems to work well except for the "Slashing" part. The idea is that the attached arm will turn invisible while my sprite begins it's slashing animation...
  20. jobjorgos

    Legacy GM does an alarm that only needs 1 step to trigger work in a step event?

    I have tons of objects with alarm[0] = 1; in a step event. I know alarms should not be placed like that in a step event, but in this case where the alarm only needs 1 step, would this trigger or not in a step event?