Skip to content

Library Rangers Player

Gabriel edited this page Sep 26, 2023 · 2 revisions

Player

Provides access to app::player::Player from Sonic Frontiers, with extensive amounts of helper functions.

Functions;

  • (PlayerType Type, long pGameObject) GetPlayer() - returns a tuple pertaining to the current player info.
  • PlayerType GetPlayerType() - returns the current character being played as.
  • Data* GetPlayerData() - returns a pointer to an instance of Player.Data.
  • PlayerHsmContext* GetPlayerContext() - returns a pointer to an instance of PlayerHsmContext.
  • void SetPlayerType(PlayerType in_playerType) - sets the current character being played as.

Types;

  • struct Data - a struct representation of app::player::Player.
    • Members;
      • GameObject.Data GameObject - an instance of hh::game::GameObject, the base class for app::player::Player.
      • PlayerHsmContext* pContext - a pointer to an instance of PlayerHsmContext.
  • struct PlayerHsmContext - a struct representation of app::player::PlayerHsmContext.
    • Members;
      • GOCPlayerHsm* pGOCPlayerHsm - a pointer to an instance of app::player::GOCPlayerHsm.
      • long pOutOfControlTimerList - a pointer to an instance of app::player::PlayerHsmContext::OutOfControlTimerList.
      • long pDamagedObjects - a pointer to an instance of app::player::PlayerHsmContext::DamagedObjects.

Animation

Functions;

  • void SetAnimation(string in_animationName) - sets an internal *.asm animation for the current player.
  • void SetAnimationParameter(string in_parameterName, float in_value) - sets an internal *.asm parameter for the currently playing animation.

Collision

Functions;

  • long GetPlugin() - returns a pointer to an instance of app::player::StatePluginCollision (may be deprecated soon).
  • long SetCollisionSphere(CollisionType in_type, float in_radius) - sets the collision sphere behaviour and radius for the current player.
  • void SetEntityCollision(bool in_isEnabled) - determines whether the player can collide with entities.

Types;

  • enum CollisionType - an enum representing known collision types for the player.

Effect

Functions;

  • void PlayEffect(string in_handleName, string in_effectName) - plays a *.cemt effect for the current player, with a handle name to stop the effect at any point.
  • void StopEffect(string in_handleName) - stops a *.cemt effect using its handle name.
  • void PlayAnimationEffect(string in_name) - plays an internal *.asm animation effect for the current player.
  • void StopAnimationEffects() - stops all internal *.asm animation effects.

Input

Functions;

  • bool IsPressed(InputActionType in_actionType) - returns if the specified input action is receiving a "pressed" signal.
  • bool IsDown(InputActionType in_actionType) - returns if the specified input action is receiving a "down" signal.
  • bool IsReleased(InputActionType in_actionType) - returns if the specified input action is receiving a "released" signal.

Types;

  • enum InputActionType - an enum representing known action types.

Kinematics

Functions;

  • GOCPlayerKinematicParams* Get() - returns a pointer to an instance of GOCPlayerKinematicParams.
  • Vector3 GetForward() - returns the forward vector of the current player rotation.
  • float GetMagnitude() - returns the magnitude of the current player velocity.
  • float GetHorizontalMagnitude() - returns the horizontal magnitude of the current player velocity.

Message

Functions;

  • int GetMessageID() - returns the current message ID being processed by the player.

Sound

Functions;

  • int PlaySound(string in_soundName) - plays a sound for the current player with the specified name and returns a sound handle.
  • void StopSound(int* in_pSoundHandle) - stops a sound using its sound handle.
  • void PlayVoice(int in_index) - plays a voice clip at the specified index.

State

Functions;

  • StateID GetCurrentStateID() - returns the ID of the current state the player is in.
  • StateID GetPreviousStateID(int in_stackIndex = 0) - returns an ID of a previous state in the stack trace at the specified index.
  • (StateID ID, long pData) GetState() - returns a tuple pertaining to the current state info.
  • T* GetState<T>() where T : unmanaged - returns a pointer to a struct from the States library.
  • long GetStatePlugin(string in_pluginName) - returns a pointer to a state plugin by name.
  • T* GetStatePlugin<T>() where T : unmanaged - returns a pointer to a state plugin from the Plugins library.
  • void AddStateNotifyAction(TStateNotifyAction in_action) - registers a function of the TStateNotifyAction type into the event handler for when a state is initialised.
  • void RemoveStateNotifyAction(TStateNotifyAction in_action) - removes a function of the TStateNotifyAction type.
  • void Redirect(StateID in_source, StateID in_destination) - redirects the source state to a different one.
  • void Discard(StateID in_source) - discards a state when it's supposed to be set.
  • void Restore(StateID in_source) - restores a state's behaviour back to default.
  • void SetState(StateID in_destination) - sets the player's current state to the destination state.

Status

Functions;

  • bool IsGrounded() - returns whether the player is grounded.
  • bool IsGroundedSpecial() - returns whether the player is grounded, on a rail, on a spring or climbing on a wall.
  • bool IsDropDashCharge() - returns whether the player is charging a Drop Dash.
  • GOCPlayerParameter.ModePackageType GetModePackageType() - returns the current player's mode package type.
  • bool IsSideView() - returns whether the player is currently in a 2D section.
  • bool IsUnderwater() - returns whether the player is currently underwater.
Clone this wiki locally