GM:S 1.4 'Variable not set' error, but it's not a variable at all.

Discussion in 'Legacy GameMaker Community Tech Support' started by lonedarkness, Aug 22, 2019.

  1. lonedarkness

    lonedarkness Member

    Joined:
    Aug 22, 2019
    Posts:
    1
    I'm getting this error.


    ___________________________________________
    ############################################################################################
    FATAL ERROR in
    action number 1
    of Step Event0
    for object Ob_TestPlayerSlopes:

    Variable Ob_TestPlayerSlopes.yes(100036, -2147483648) not set before reading it.
    at gml_Object_Ob_TestPlayerSlopes_StepNormalEvent_1 (line 122) - if (collision_rectangle(x+8, y+1, sign(move)*(x+(sprite_width/2)+abs(hsp)), y+5, par_slope, yes, yes))
    ############################################################################################
    --------------------------------------------------------------------------------------------
    stack frame is
    gml_Object_Ob_TestPlayerSlopes_StepNormalEvent_1 (line 122)

    Normally, 'variable not set' is easy enough to take care of, but as you can see, the 'variable' is not a variable - it's an argument of the collision_rectangle function, and one that needs to be present or else my project won't compile.
    Anyone know why this is happening?
     
  2. IndianaBones

    IndianaBones Member

    Joined:
    Jul 5, 2016
    Posts:
    2,217
    You need replace the yes with a value of either true or false. Literally you need to write true to activate the given parameter, or false to disable it. The manual for the collision_rectangle() function has further usage examples. yes is not a keyword in the game maker language, so its just treated as another variable, an undefined one in this case.
     
    Roderick likes this.

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