GameMaker (Solved)Game Maker Breaks when Defining Params

Evanski

Raccoon Lord
Forum Staff
Moderator
So im coding a jsdoc script and it just suddenly stops working.
it doesnt recognize the @param
syntax highlighting stopped working (stopped highlighting certain variables as local and non local)
and its spiting out errors that arent true and at the wrong lines.

is broke.png

as for the player step event
step_lines.png
Code:
//animate player
if (state = states.walking)
{
    walk_anim_time += 1/game_get_speed(gamespeed_fps);
 
    var t = walk_anim_time / walk_anim_length;
 
    if (t >= 1)
    {
        walk_anim_time = 0;
        t = 1;
        state = states.idle;
    }
 
    var _x = lerp(x_from, x_to, t);
    var _y = lerp(y_from, y_to, t);
 
    x = _x * tile_width;
    y = _y * tile_height;
 
    image_index = frames[floor((walk_anim_frames -1) *t)];
 
}


if (keyboard_check(input_right))
{
    scr_player_move(directions.right);
}

if (keyboard_check(input_left))
{
    scr_player_move(directions.left);
}

if (keyboard_check(input_up))
{
    scr_player_move(directions.up);
}

if (keyboard_check(input_down))
{
    scr_player_move(directions.down);
}
Macros script
Code:
gml_pragma("global","MACROS()");

#macro tile_width 32
#macro tile_height 32

#macro input_up (ord("W"))
#macro input_left (ord("A")
#macro input_down (ord("S"))
#macro input_right (ord("D"))

enum directions
{
    right,
    up,
    left,
    down
}

global.components = [];
global.components[directions.right] = [1,0];
global.components[directions.up] = [0,-1];
global.components[directions.left] = [-1,0];
global.components[directions.down] = [0,1];
 

TsukaYuriko

☄️
Forum Staff
Moderator
Try restarting the IDE and clearing the asset cache.

Failing that, have you recently performed any major changes to your game's code base or updated GMS2?
 

Evanski

Raccoon Lord
Forum Staff
Moderator
Try restarting the IDE and clearing the asset cache.

Failing that, have you recently performed any major changes to your game's code base or updated GMS2?
I tried that and the error still persists
I updated to the latest version but this problem was in the other versions as well just not as frequent as now
 

TsukaYuriko

☄️
Forum Staff
Moderator
Well, it did say "got {, expected )", which is what the code looked like after the macro was substituted with its value and pretty much equates to "hey you missed a )". The rest is collateral damage of the initial mess - once one line is messed up, every following line will be messed up, as the compiler has no sense of "lines" in a syntax sense.
 
Top