states

  1. xDGameStudios

    Asset - Scripts [STATE MACHINES] xState an advanced StateMachine system (FREE)

    [LINKS] xState (marketplace) xState (itch.io) [DEMO IMAGES] Enemies walk using a two states "idle" and "wander" (repeatedly). Mouse clicking will change near-by enemies to "suspicious" state (for a couple of frames). If another click occurs during "suspicious" state the enemy will go into...
  2. I

    State Machines

    Hey guys, First time using GMS2 and posting. I'm running into issues with my state machine. I'm not getting any syntax errors, but the game isn't loading the states. Basically, I can't move after implementing the state machine. Any advice or ideas on what it might be? The project can't be...
  3. D

    Best practice for state-based game design?

    Working on a strategy game. Right now, what I've got is only nominally state-based. There's an "initializing state" that lasts a few frames at most upon startup, and then you're thrown right into a gameplay demo (just able to move units around really). Obviously I'm gonna want menus to select...
  4. K

    Switching the enum state and keep moving

    Hi, I have an action rpg project. In the player object i have an enum with 3 states: move state, dash state and melee state. When I´m dashing or attacking the player just stops until it finish the action. It turns out that I´m trying to make the player move when i´m attacking or dashing (before...
  5. K

    GMS 2 Character Animations Getting Cut-Off For Unknown Reasons [not yet solved]

    So, as Simon pointed out: -which I did not know, so yay for learning. And, while putting image_index = 0; at the beginning of the Elf_Shooting/states.shooting script only resulted in the PC freezing in the first frame of any shooting animation, buy putting the same line inside of the...
  6. Architheutis

    Jumping withing one animated sprite

    Good morning, everybody! That topic was certainly solved, elsewhere inside. Or something similar. I´ve got a special intention. Maybe that could be solved with states. But I asked myself, and now you, what about jumping within an animated sprite. Example: oPlayer collides (place_meeting) with...
  7. J

    Ways to add animation before and after an action?

    Hey eveyrone! I'm new to programming and game designing in general and I'm stuck while trying to add some flare to the main character's actions. My characters works with states. One of those states is for swapping positions with enemies. The problem is that I can't add an animation and audio...
  8. A

    GML landing after fall state

    I'm using "motion" states for my player. ..idle, walking, jumping, falling etc While falling, what should I use to determine when to go into the landing state? Then, how do I HOLD the player in that state until the landing animation is done before he goes into walking again?
  9. M

    Legacy GM NPC AI switching states issue

    I have created a switching states code for an NPC in my game that is supposed to: ** wake up when a player is near and move up until the y is in the middle of the screen ** stay idle ** if player gets close enough then follow ** if player gets too close go to idle state But my issue is is...
  10. W

    GML A wander state for an enemy

    I need help making a wander state for my enemy. I have been having trouble with this. Here is my code /// sc_enemy_wander_state randomize(); var x_wand, y_wand; x_wand = x; y_wand = y; if (distance_to_point(x_wand, y_wand) == 0) { do { x_wand = random(room_width); y_wand =...
  11. gamedev4life

    Design Designing a State Machine for your Game

    Hi all! Learning how to make a state machine was a turning point for me in learning how to programming a game in GML, so I wanted to help others learn how to make a state machine which is the purpose of this post :) I know there's more than one way to make a state machine, but this is my...
  12. gamedev4life

    GML (mod plz move to tutorial) My tutorial video on how to code state machines!

    Hi all! I made a youtube tutorial video on how to code state machines and wanted to share it with you all, and of course feedback is always greatly appreciated and will help me make better and better tutorial videos. If you dont know how to code a state machine then this video is made literally...
  13. A

    GML Problem with State Machine for Platforming

    Hello fellow gamemakers, I've been working through Shaun Spauldings platforming tutorials on youtube and hit a wall on Finite State Machines. I've gone through different forums and message boards and watched different tutorials. Right now I have a script for normal movement and ladder movement...
  14. A

    GML [SOLVED] Need help changing player state/script

    Hello, For some reason which I cannot understand due to noobness, my player can go from the "movement (andar)" state/script to the "cast magic" state, but cannot go from the "idle" state/script to the "cast magic" state even though they use the same code to switch states/scripts. So I can move...
  15. A

    GML need help with scripts and states

    hi community, Noob here trying to learn how to make and use scripts and states. So Im following this video Im making scripts hold the state code This state machine is supposed to make an object move towards the mouse, stop when it gets too close, and move back if clicked on. But mine isnt...
  16. Blaize

    Legacy GM 8-Directional attacking

    EDIT: I changed the title from 'Attacking while moving' to the new one since it didn't make sense to me after reading it back. So, I've just started sorting my move and attacking into two states and for the most part, they work fine. Actually, I can attack up, down, left, right, up-right, and...
  17. A

    Legacy GM [SOLVED!] Problem w/ player sprite change animation

    Howdy folks. My issue is, I can't get the player object to change sprites according to other button presses besides left or right (it's a sidescroller). I understand states are the way to go, but at the moment, a state change will have pretty much any effect I put in it on the player [eg, spd...
  18. tibbycat

    [SOLVED] Walking on top of ladder (changing state)

    Hi, I'm relatively new(ish) is to Gamemaker and I thought I'd post here as I'm making a platform game having modified Shaun Spalding's State Machine tutorial and I'm currently stuck trying to get my player to change into the normal state when in the climbing state and reaching or landing on the...
  19. J

    Legacy GM Switching Game States

    Hello, I am making a game that has a top down overworld and puzzle sections involving platforming. I can get the game to switch from the top down movement to the platforming movement when moving from any of the overworld rooms to 1 specific room, but when I try to add more rooms with...
  20. Luke Pierson

    State Change please help

    Hey everyone. So I will be making a game that has 3 inventory slots. When an item is placed in a slot, it will set a variable as true. In addition, there is an item selector that moves between each slot. When you pick up a certain item (the whip), you enter the whip state. If the selector moves...
Top