state machine

  1. samspade

    GMS 2.3+ Metroidvania Player State Machine

    I'm trying to work out a more manageable way of handling a player's state machine in a metroidvania. The player can have many states but can gain those states in different orders. But the basic way of coding a state machine (whether you use switches, structs, functions, etc) has you putting all...
  2. Null-Z

    GML (SOLVED)State Machine issues.

    In my prototype, I tried to give the player object a normal state and a hurt state using, in the create event, "state = scrNormalShip". I put the code to control the ship in that script, and the variables for the attributes of the ship(like Hp = 3, SpecialShot = objSShot1) into the create...
  3. R

    SOLVED sprite change on a state machine

    hello guys, I have a problem that is quite annoying for me. I'm programming my player, and it has a few different sprites in addition to walking and standing animations, and in that I'm using a state machine to use it in a better way, but that's causing me a lot of trouble when switching to one...
  4. Storm1208

    GMS 2.3+ Horizontal and Vertical Collision No Longer Working After Being Converted to Scripts

    I'm working on a finite state machine implementation for a platforming character. I initially coded the character normally (i.e. not using a state machine approach) but am now beginning to convert what I had previously implemented into a state machine format. To aid in readability, each...
  5. samspade

    GMS 2.3+ Struct Based State Machines

    I'm working on creating a struct based state machine system. My primary goals are for it to be: Simple to use Handle entering and exiting a state separately from running a state Use structs be flexible and expandable My current set up seems to be working well, but I haven't tried to do this...
  6. R

    [SOLVED] drive and attack

    hello guys, I'm having a little sprite problem. I am trying to make my character walk and attack while walking, well it works and I did it but the visual part I am having difficulty I have a sprite for him to stop attacking and another one for him walking and attacking, the problem is: he...
  7. PrismaticRealms

    Asset - Objects PRState: A simple and efficient finite state machine.

    Available on the YoYo Games Marketplace and on Requires GameMaker Studio 2 v2.3 and up. PRState is a GameMaker Studio 2 (GMS) package created by Prismatic Realms, Inc. It enables you to implement a simple and efficient finite state machine for your GMS objects. PRState is designed to...
  8. Palocles

    GMS 2 double tap for dash/run, where to put in state engine

    I'm implementing a State Engine for my game and I'm wondering how double tapping a button for a dash move, at higher speed than a walk, will interact with the state engine. When the 'forwards' button is pressed the machine puts the player into the walk state but if i release the button...
  9. toothmosnter

    GML (Duplicate Thread) State machine state change is storing key_press boolean and influencing movement

    Sorry if this has already been posted, I'm not sure if my thread got deleted or not due to the gifs of my game I included in it (external links). Essentially, I have a state machine that changes from playerStateFree (free movement) to playerStateHide (stationary). Whenever I press any movement...
  10. L

    State machine questione

    I am thinking about making a turn based shmup prototype. The idea is that everything including bullets do not move unless the player inputs a command. So I think how this would work is that there would be a global object that controls everything and each object reacts based on input. Am I...
  11. Null-Z

    SOLVED State Machine issues

    so, I've got a state machine for this shadow biter here but as you can see, it seems to be skipping or going through states too quickly. [/SPOILER] What am I doing wrong?
  12. Slyddar

    Asset - Project Tile Based Moving Platform Engine

    Tile Based Moving Platform Engine This tile based platform engine uses efficient tiles for instance collisions, as well as incorporating those efficiencies into horizontal and vertical tile layer moving platforms. Some of the features of the engine : Tile Based Collisions : Tiles offer the...
  13. MartinK12

    GML [SOLVED] Where should I put hit, knockback, immunity and health - state machine or?

    I have basic working state machine for player in platformer game and it’s working fine. Currently I have player states: on_ground, in_air, idle. I want to add hit – for starter it will be basic collision event but later I want to create my own collision code in end step. Whenever player gets...
  14. A

    Legacy GM [State Machine] Crouch Animation Loop

    How do I stop my crouch animation at the last frame? I tried setting it up like this and it still loops. // Get Input scr_jpgetinput(); // Crouch Animation sprite_index = sp_jplayercrouch; image_speed = 0.4 if sprite_index = sp_jplayercrouch && image_index = 6 { image_speed=0 } // State...
  15. Z

    GMS 2 State machiens small problem

    I'm sure this is a quick fix, but I have been up all night trying to find a solution for this aggravating problem. Okay so basically, I want to have the player stop moving completely while in the attack state"(ATTACK_HAMMER)", if he is not grounded, i have a script i can call to check if he is...
  16. F

    GMS 2 Jumping mechanic issue

    Hello Guys, i'm actually trying to study GML/Programation Logic and in the same time developing a game. (On GMS 2) I'm studying with videos on YouTube. On the past 2 weeks i'm developing and studying the method to create a game using the HeartBeast video's, to be more precise, the "Hack'n'Slash...
  17. Suzaku

    GMS 2 Is there any plugin/extension for state machine?

    I remember when I was using Unity, there was a GUI special for finite state machines, with a flowchart, I wonder if there is some kind of plugin to reproduce the state machine in gamemaker visually like Unity does. Thank you.
  18. M

    Enemy Pathfinding(mp_grid) / State Machine Problems

    Hello everyone, I know this question asked many times before and yes I checked old posts and tried different solutions and approaches as much as I could but I'm still learning :/ (I started to GMS 4 months ago, pretty new). I will try to explain my problem. I'm trying to make a topdown shooter...
  19. Suzaku

    GMS 2 Basics about state machines

    I having a hard time figuring out what are the main elements of a state machine in a general scope. So far I know that there are 3 main elements: 1. the switch in the step event that is supposed to verify on which state the object is at each moment, then it activates the script accordly to the...
  20. KPJ

    Need help with state machine (GMS2)

    Hi everyone. I need help regarding state machines in my top down game. I have four states (idle, moving, attack and stealth) The idle, moving and attack states work, however i need help with the stealth state. I want it to be so that when the player presses the shift button, the player will...