MACROS in gamemaker function throwing error

249 views Asked by At

This Code var within_rangex = is_within(x,o_player.x,PLAYER_REACH);

throwing the error

Got ';' (;) expected ','

I Have No Idea Why, when using magic numbers there is no error thrown.

EDIT: The Script In Which PLAYER_REACH Is Defined.

// This Script Contains Code To Create enums And macros

function enums(){
    enum states{
        normal,
        jumping
    }
    
    #macro TILE_REFRESH_RATE    10; // How Often Will A Tile Update Accure
    #macro PLAYER_REACH         64; // How Far Can The Player Reach
}
1

There are 1 answers

0
TheTeaNymph On

I Found It. The Simi-colons Can't Be Used In MACROS. Always Forget This.

Here Is The Fixed Code.

// This Script Contains Code To Create enums And macros

function enums(){
    enum states{
        normal,
        jumping
    }
    
    #macro TILE_REFRESH_RATE    10; // How Often Will A Tile Update Accure
    #macro PLAYER_REACH         64; // How Far Can The Player Reach
}