• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

states

  1. F

    Managing States and image_index - need help!

    Hello! I'm trying to code a Punch Out-like game and it's not going too bad so far! Tho, since I'm new to the whole coding stuff, I'm having some troubles cause I'm not sure how to code the collisions. At first I thought to use hit and hurt boxes but I wasn't sure it was the right thing to do...
  2. H

    SOLVED Script being mistaken as a variable (?) and its code not appearing in the debugger, possibly because of states

    I'm new to GameMaker so I likely don't know much of the terminology, sorry! In the game I'm making, furniture flies across a room (up, down, left or right) and if it hits the player, they lose health. There's a brief window of time before a piece of furniture flies across the room, during which...
  3. Overlord90098

    SOLVED How to have swimming in platformer

    I was just wondering how to add a swimming state to a character I was thinking if (global.can_swim) && place_meeting(x,y,Owater) { state = swimming } if (state = swimming) { // allow up, down, left and right movement with jumping to leave } else { state = normal; } my main issue is whether I...
  4. J

    SOLVED How to change beetween states?

    Hello! I need help. I'm a very beginner :) I have a enemy and a player character. I want if the player character hit the enemy head do a animation movement and after finish go to state 2 (walking again). Right now if my character hit the enemy head the enemy is go on a loop so continously...
  5. Pleastic

    Where to initialise a state

    I'm just getting my head around finite state machines. I'm curious how others deal with the following situation. I often find myself needing an initialisation stage when moving to a new state. Do you: 1. do all the initialisation in the previous state? 2. do you create a special initialisation...
  6. T

    My enemy isn't moving after i created more objects

    so, basically my enemy isnt moving and i dont know why, he was moving before but after i created more objects, his moviment just stop working, and this objects that i created don't have nothing to do with enemy, they are just Interface objects. the enemy is entering in the state chase, but dont...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. K

    GameMaker 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...
  12. 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...
  13. 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...
  14. 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?
  15. 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...
  16. 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 =...
  17. G

    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...
  18. G

    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...
  19. 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...
  20. 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...
Top