Windows Beat em up stack frame error

Discussion in 'GameMaker Studio 2 Community Tech Support' started by SkullFantasyFortress!, Feb 24, 2019.

  1. SkullFantasyFortress!

    SkullFantasyFortress! Member

    Joined:
    Feb 23, 2019
    Posts:
    3
    So, I've been following a tutorial on how to build a basic beat em up game. I am currently stuck at the steps regarding attacking and movement, where I always receive this message upon testing.
    ___________________________________________
    ############################################################################################
    FATAL ERROR in
    action number 1
    of Step Event0
    for object Riege_Player:
    Variable Riege_Player.A(100013, -2147483648) not set before reading it.
    at gml_Object_Riege_Player_Step_0 (line 3) - }if(keyboard_check(ord(A)))
    ############################################################################################
    --------------------------------------------------------------------------------------------
    stack frame is
    gml_Object_Riege_Player_Step_0 (line 3)

    Here is my entire code.

    if(CurrentHP > 0){
    XSpeed = 0;
    }if(keyboard_check(ord(A)))
    {
    XSpeed = -1*Speed;
    }else if(keyboard_check(ord(D))){//Checks if either the W or S buttons are pressed to make the player move Up or Down.
    YSpeed = 0;
    if(OnGround == true){
    if(keyboard_check(ord(W))){if(IsAttacking == false && I**** = false){

    //If the player is on the ground move them with XSpeed and YSpeed, otherwise ignore YSpeedif(OnGround==true){
    if(XSpeed != 0 && YSpeed != 0){
    x+=XSpeed*SpeedMod*.7;
    y+=YSpeed*SpeedMod*.7;
    }else if(XSpeed != 0 || YSpeed != 0){
    x+=XSpeed*SpeedMod;
    y+=YSpeed*SpeedMod;
    }

    }else if(OnGround == false ){
    x+=XSpeed*SpeedMod;
    }

    if(XSpeed != 0){
    image_xscale = sign(XSpeed*SpeedMod);
    }

    //Animates the Player based on their speed
    if(XSpeed == 0 && YSpeed == 0 && OnGround == true){
    SpeedMod = 1;
    sprite_index = SPR_PlayerIdle;
    }else if((XSpeed!=0 || YSpeed != 0) && sprite_index!=SPR_PlayerWalking && OnGround == true){
    sprite_index = SPR_PlayerWalking;
    }
    }
    YSpeed = -1*Speed;
    }else if(keyboard_check(ord(S))){//If the player is on the ground, this sets their GroundY variable to their current y position
    if(OnGround == true){
    GroundY = y;
    }

    //Sets the Players' depth based on their GroundY. We're using GroundY instead of y so that even when they're in the air, they will display in fornt of and behind the right objects.
    depth = -1*GroundY;
    YSpeed = Speed;
    }
    }
    XSpeed = Speed;


    instance_destroy();
    {}

    Please, can someone tell me where i'm going wrong?
     
  2. chamaeleon

    chamaeleon Member

    Joined:
    Jun 21, 2016
    Posts:
    975
    Did you look at the documentation for the function you used with A?
     
  3. SkullFantasyFortress!

    SkullFantasyFortress! Member

    Joined:
    Feb 23, 2019
    Posts:
    3
    No, how do I do such. (i'm new to this)
     
  4. chamaeleon

    chamaeleon Member

    Joined:
    Jun 21, 2016
    Posts:
    975
    Help -> Open Manual -> Search Tab -> Search for ord -> Click ord in search result -> Read ord documentation
     
  5. SkullFantasyFortress!

    SkullFantasyFortress! Member

    Joined:
    Feb 23, 2019
    Posts:
    3
    Thank you! I found a way to fix the issue.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice