Game Class

RAGE Plugin Hook Documentation

[This is preliminary documentation and is subject to change.]

Static class for various game settings and functions.
Inheritance Hierarchy

SystemObject
  RageGame

Namespace:  Rage
Assembly:  RagePluginHook (in RagePluginHook.dll) Version: 0.0.0.0 (0.56.1131.11510)
Syntax

public static class Game

The Game type exposes the following members.

Properties

  NameDescription
Public propertyStatic memberAlwaysReceiveKeyEvents
Gets or sets a value indicating whether this plugin will still receive key events even if input focus is set to an active form.
Public propertyStatic memberBuildNumber
Gets the build number of the game.
Public propertyStatic memberConsole
Gets the console.
Public propertyStatic memberDisableAutomaticRespawn
Gets or sets a value indicating whether automatic respawns are disabled, allowing plugins to implement custom respawn systems.
Public propertyStatic memberFadeScreenOutOnDeath
Gets or sets a value indicating whether the game will fade out the screen when the player dies.
Public propertyStatic memberFrameCount
Gets the total number of frames that's been rendered this session.
Public propertyStatic memberFrameRate
Gets the current frame rate.
Public propertyStatic memberFrameTime
Gets the time it currently takes to render a frame, in milliseconds.
Public propertyStatic memberGameTime
Gets the game time in milliseconds. Unlike TickCount this value is scaled based on the game time dilation.
Public propertyStatic memberIsAltKeyDownRightNow
Gets a value indicating whether either alt key is down.
Public propertyStatic memberIsControlKeyDownRightNow
Gets a value indicating whether either control key is down.
Public propertyStatic memberIsControllerConnected
Gets a value indicating whether a gamepad is connected.
Public propertyStatic memberIsFullMapRevealForced
Sets a value indicating whether the entire map is currently forced to be revealed.
Public propertyStatic memberIsLoading
Gets a value indicating whether the game is currently displaying the loading screen.
Public propertyStatic memberIsMissionActive
Gets or sets a value indicating whether a mission is currently active.
Public propertyStatic memberIsPaused

Gets or sets whether the game is paused.

The game cannot be paused in certain cases, eg. when the console is open.

Public propertyStatic memberIsScreenFadedIn
Gets a value indicating whether the screen is currently faded in.
Public propertyStatic memberIsScreenFadedOut
Gets a value indicating whether the screen is currently faded out.
Public propertyStatic memberIsScreenFadingIn
Gets a value indicating whether the screen is currently fading in.
Public propertyStatic memberIsScreenFadingOut
Gets a value indicating whether the screen is currently fading out.
Public propertyStatic memberIsShiftKeyDownRightNow
Gets a value indicating whether either shift key is down.
Public propertyStatic memberLocalPlayer
Gets the local Player instance.
Public propertyStatic memberMaxWantedLevel
Gets or sets the maximum wanted level.
Public propertyStatic memberProductVersion
Gets the product version of the game.
Public propertyStatic memberResolution

Gets the current game resolution.

This is the resolution of the game window, not the actual screen resolution.
When the game is running in full screen mode, this will be the same as the screen resolution.

Public propertyStatic memberShowPoliceBlipsOnRadar
Sets a value indicating whether blips representing police units should be shown on the radar when the local player is wanted.
Public propertyStatic memberTickCount
Public propertyStatic memberTimeScale
Gets or sets the time scale multiplier.
Top
Methods

  NameDescription
Public methodStatic memberAddConsoleCommands
Adds console commands defined in the calling assembly.
Public methodStatic memberAddConsoleCommands(MethodInfo)
Adds console commands from the specified methods.
Public methodStatic memberAddConsoleCommands(Type)
Adds console commands from the specified types.
Public methodStatic memberAllocateMemory
Allocates a block of memory of the specified size using VirtualAlloc.
Public methodStatic memberCreateTextureFromFile
Creates a new texture from the specified file.
Public methodStatic memberDisableControlAction
Public methodStatic memberDisplayHelp(String)
Displays the specified text in the help box.
Public methodStatic memberDisplayHelp(String, Boolean)
Displays the specified text in the help box.
Public methodStatic memberDisplayHelp(String, Int32)
Displays the specified text in the help box.
Public methodStatic memberDisplayNotification(String)
Adds a new notification above the map.
Public methodStatic memberDisplayNotification(String, String, String, String, String)
Adds a new notification above the map.
Public methodStatic memberDisplaySubtitle(String)

Displays the specified text in a subtitle.

The display duration will be automatically calculated based on the reading speed of the average human.

Public methodStatic memberDisplaySubtitle(String, Int32)
Displays the specified text in a subtitle for the specified duration.
Public methodStatic memberFadeScreenIn(Int32)
Fades the screen in over the specified amount of time.
Public methodStatic memberFadeScreenIn(Int32, Boolean)
Fades the screen in over the specified amount of time.
Public methodStatic memberFadeScreenOut(Int32)
Fades the screen out over the specified amount of time.
Public methodStatic memberFadeScreenOut(Int32, Boolean)
Fades the screen out over the specified amount of time.
Public methodStatic memberFindAllOccurrencesOfPattern(String)
Finds all occurrences of the specified pattern of bytes in the game's memory.
Public methodStatic memberFindAllOccurrencesOfPattern(String, IntPtr)
Finds all occurrences of the specified pattern of bytes in the game's memory.
Public methodStatic memberCode exampleFindPattern(String)
Finds the specified pattern of bytes in the game's memory.
Public methodStatic memberCode exampleFindPattern(String, IntPtr)
Finds the specified pattern of bytes in the game's memory.
Public methodStatic memberFreeMemory
Frees the memory previously allocated by AllocateMemory(Int64), using VirtualFree.
Public methodStatic memberGetAchievementProgress
Gets the progress of the specified achievement.
Public methodStatic memberGetClipboardText
Gets the text in the clipboard.
Public methodStatic memberGetHashKey
Computes the hash of the given text using Jenkin's one-at-a-time algorithm.
Public methodStatic memberGetKeyboardState
Gets the current state of the keyboard.
Public methodStatic memberCode exampleGetLocalizedString
Gets the localized string from the specified localization string id.
Public methodStatic memberGetMouseState
Gets the current state of the mouse.
Public methodStatic memberGetMouseWheelDelta
Gets the amount the mouse wheel has scrolled.
Public methodStatic memberGetNativeAddress
Gets the address of the native function with the specified name.
Public methodStatic memberGetRunningScripts
Gets the names of all currently running game scripts.
Public methodStatic memberGetScriptGlobalVariableAddress
Gets the address of the script global variable with the specified id.
Public methodStatic memberHandleRespawn
Marks the current respawning of the local player as completed, allowing normal game functions, like HUD, opening the menu, etc.
Public methodStatic memberHasAchievementBeenPassed
Determines whether the specified achievement has been passed.
Public methodStatic memberHideHelp
Hides the current help box.
Public methodStatic memberIsControlJustPressed
Public methodStatic memberIsControlJustReleased
Public methodStatic memberIsControllerButtonDown
Public methodStatic memberIsControllerButtonDownRightNow
Public methodStatic memberIsControlPressed
Public methodStatic memberIsKeyDown
Public methodStatic memberIsKeyDownRightNow
Public methodStatic memberLockMinimapAngle
Locks the minimap to the specified angle.
Public methodStatic memberLockMinimapPosition(Vector2)
Locks the minimap to the specified world position.
Public methodStatic memberLockMinimapPosition(Vector3)
Locks the minimap to the specified world position.
Public methodStatic memberLockMinimapPosition(Single, Single)
Locks the minimap to the specified world position.
Public methodStatic memberLogExtremelyVerbose
Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::ExtremelyVerbose].
Public methodStatic memberLogExtremelyVerboseDebug

Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::ExtremelyVerbose].

When the calling Assembly is not compiled in DEBUG mode, calls to this method will not be compiled.

Public methodStatic memberLogTrivial
Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::Trivial].
Public methodStatic memberCode exampleLogTrivialDebug

Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::Trivial].

When the calling Assembly is not compiled in DEBUG mode, calls to this method will not be compiled.

Public methodStatic memberLogVerbose
Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::Verbose].
Public methodStatic memberLogVerboseDebug

Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::Verbose].

When the calling Assembly is not compiled in DEBUG mode, calls to this method will not be compiled.

Public methodStatic memberLogVeryVerbose
Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::VeryVerbose].
Public methodStatic memberLogVeryVerboseDebug

Logs the specified text to the RAGE Plugin Hook log file, if the current logging verbosity setting is equal to, or greater than [!:LoggingVerbosity::VeryVerbose].

When the calling Assembly is not compiled in DEBUG mode, calls to this method will not be compiled.

Public methodStatic memberReloadActivePlugin
Reloads the active plugin.
Public methodStatic memberRemoveNotification
Removes the specified notification.
Public methodStatic memberSetClipboardText
Sets the text in the clipboard.
Public methodStatic memberSetRadarZoomLevelThisFrame
Sets the zoom level of the radar this frame.
Public methodStatic memberCode exampleSetRelationshipBetweenRelationshipGroups
Sets the relationship between the specified relationship groups.
Public methodStatic memberStartNewScript(String)
Starts a new instance of the game script with the specified name with a stack size of 1424.
Public methodStatic memberStartNewScript(String, Int32)
Starts a new instance of the game script with the specified name and stack size.
Public methodStatic memberTerminateActivePlugin
Terminates the active plugin.
Public methodStatic memberTerminateAllScripts
Terminates all scripts.
Public methodStatic memberTerminateAllScriptsWithName
Terminates all scripts with the specified name.
Public methodStatic memberUnloadActivePlugin
Unloads the active plugin.
Public methodStatic memberUnlockMinimapAngle
Unlocks the angle of the minimap.
Public methodStatic memberUnlockMinimapPosition
Unlocks the position of the minimap.
Top
Events

  NameDescription
Public eventStatic memberFrameRender

Called on each tick to gather render calls.

This is not called on each frame, but rather each game tick, and draw calls get queued for the frame renderer.
This allows natives to be called from here; however, you may see flickering in the rendering because of this.
To avoid this, you can use RawFrameRender which gets called on each frame, but won't allow native calls.

Public eventStatic memberCode exampleRawFrameRender

Called on each frame.

Natives cannot be called in here, and any attempt to may crash the game.

Top
See Also

Reference