Game Integration - Game Maker Functions
This is the documentation for the Game Maker extension.
Global Game Settings
rg_game_change(name,id) - Change the game name and game ID. In the future this will automatically be set by a __rg_settings.ini file which will be added by RoketGames on upload, however, for the time being you will need to call this function. Game name appears at the top of the screen on the RoketGames bar. Game ID is used for callbacks to the RoketGames server, so it's important you set this correctly, otherwise you won't be able to do anything with the extension.
rg_game_setmaxheight(height) - In some cases you won't want the login screen to fill the entire room, so you can limit how many pixels down it goes. The minimum is 256 and it defaults to room_height-32.
rg_game_hidebar() - Hides the RoketGames bar (the little 1px blue line at the top of the screen) and prevents it from opening when the mouse is moved over it. This is overridden if a login/logout screen is requested or if a highscore/achievement is submitted. This is useful for cutscenes.
rg_game_showbar() - Shows the RoketGames bar (the little 1px blue line at the top of the screen) and allows it to open when the mouse is moved over it. By default it is visible.
rg_game_override_draw_area(left,top,width,height) - Changes the area in which the RoketGames bar and screen system operates. Because it can't detect the screen area if you are using views (specifically scaled views), you can use this function to tell RoketGames how to draw.
rg_user_authenticated() - Returns whether the user is currently authenticated.
rg_user_get_username() - Returns the user's current username if they are logged in.
rg_user_requesting_authentication() - Returns whether or not the login screen is currently open. You can use this to check when a login operation is finished.
rg_user_requesting_unauthentication() - Returns whether or not the logout screen is currently open. You can use this to check when a logout operation is finished.
rg_user_request_authentication(force) - Opens the login screen prompting the user for login. This method returns immediately (because it is asynchronous). The game continues to run while the screen is open. If force is true, the bottom-right button will display "Cancel" instead of "Offline". It is purely to allow the user to identify what the game will do if they don't login. It's up to you to handle the result.
rg_user_request_unauthentication() - Opens the logout screen prompting the user for logout. The user is not forced to logout. This method returns immediately (because it is asynchronous). The game continues to run while the screen is open.
rg_highscore_add(score,list) - Starts an asynchronous request to submit a highscore. listid is the identifier of the list. Leave this as 0 for the default list. Returns whether it could start the request, not whether the request was successful. Use rg_highscore_status() to track the status of the submission.
rg_highscore_get_all_users(total) - Starts an asynchronous request to fetch the highscores starting at position 1 to position total. Returns whether it could start the request, not whether the request was successful. Use rg_highscore_status() to track the status of the submission.
rg_highscore_fetch_all_users_rank() - Returns a ds_list of the ranks fetched by the rg_highscore_get_all_users call. Returns RG_HIGHSCORE_INVALID if the highscore wasn't successful (which can be detected using rg_highscore_status() function).
rg_highscore_fetch_all_users_username() - Returns a ds_list of the usernames fetched by the rg_highscore_get_all_users call. Returns RG_HIGHSCORE_INVALID if the highscore wasn't successful (which can be detected using rg_highscore_status() function).
rg_highscore_fetch_all_users_score() - Returns a ds_list of the scores fetched by the rg_highscore_get_all_users call. Returns RG_HIGHSCORE_INVALID if the highscore wasn't successful (which can be detected using rg_highscore_status() function).
rg_highscore_get_rank(username) - Starts an asynchronous request to fetch the position of a user. username defaults to the currently logged in user. Returns whether it could start the request, not whether the request was successful. Use rg_highscore_status() to track the status of the submission.
rg_highscore_fetch_rank() - Returns the rank of the user retrieved by the rg_highscore_get_rank() call. Returns RG_HIGHSCORE_INVALID if the highscore wasn't successful (which can be detected using rg_highscore_status() function).
rg_highscore_status() - Returns the current status of the asynchronous request.
- RG_HIGHSCORE_NOTHING - Indicates no highscore requests have been sent.
- RG_HIGHSCORE_WORKING - A request is currently in progress. Any requests made while the status is RG_HIGHSCORE_WORKING will fail.
- RG_HIGHSCORE_SUCCESS - The request was successful. You can use the fetch functions to get the data.
- RG_HIGHSCORE_FAILURE - The request wasn't successful for some reason.
rg_achievement_award(ident) - Adds an achievement to the user's achievement list via asyncronous request. Returns whether it started the request. You can check the progress of the request by using rg_achievement_status. ident is an achievement identifier previously defined on RoketGames (admin panel for achievements coming very soon).
rg_achievement_status() - Returns the current status of the asynchronous request.
- RG_ACHIEVEMENT_NOTHING - Indicates no highscore requests have been sent.
- RG_ACHIEVEMENT_WORKING - A request is currently in progress. Any requests made while the status is RG_ACHIEVEMENT_WORKING will fail.
- RG_ACHIEVEMENT_AWARDED - The request was successful. You can use the fetch functions to get the data.
- RG_ACHIEVEMENT_FAILURE - The request wasn't successful for some reason.
- RG_ACHIEVEMENT_ALREADYAWARDED - The user already has this achievement.