GetLocalWildPets
Description: Returns the client-side table of currently managed wild pet entities (netId -> data).
Signature:
local wild = exports["hoff-battlebuddies"]:GetLocalWildPets()
Returns:
wild (table): map of netId -> wild pet data
Example:
local wild = exports["hoff-battlebuddies"]:GetLocalWildPets()
for netId, info in pairs(wild) do print(netId, info) end
CleanupAllWildPets
Description: Remove and clean up all wild pet entities tracked by the client. Useful for resource stop or forced cleanup.
Signature:
local removed = exports["hoff-battlebuddies"]:CleanupAllWildPets()
Returns:
removed (number): number of wild pet entries cleaned up
Example:
local removed = exports["hoff-battlebuddies"]:CleanupAllWildPets()
print("Removed wild pets:", removed)
GetActivePetPed
Description: Returns the local entity handle (ped) for the player's currently summoned pet, or 0 when none.
Signature:
Returns:
ped (number): entity handle or 0
Example:
Description: Returns the local player's active PetId (journal id) or nil if none.
Signature:
Returns:
petId (string|nil): PetId or nil
ScatterTeamPets
Description: Visual helper used by the battle system to scatter a team's pets and optionally fade them out (used for dramatic defeat effects).
Signature:
Example:
Description: Return whether the local player is currently in an active pet battle.
Signature:
Returns:
inBattle (boolean): true when in a pet battle
Example:
GetActivePetBattle
Description: Return the ActivePetBattle object on the client (battle state) or nil when not in battle.
Signature:
Returns:
battle (table|nil): active battle state or nil
GetActivePetBattleType
Description: Returns the active battle's BattleType enum (or nil when not in battle).
Signature:
Returns:
EPetBattleType (number): 1 = None, 2 = Wild, 3 = Trainer, 4 = PvP
GetPetSlotAtPosition
Description: Given a team or team index and a position enum, returns the pet slot (1..3) that occupies that position, or nil.
Signature:
EBattlePetPosition (number): 0 = None, 1 = Front, 2 = BackLeft, 3 = BackRight, 4 = Start, 5 = FrontLeft, 6 = FrontRight
Returns:
slot (number|nil): 1..3 or nil when empty/not found
Example:
HasBattleAuthority
Description: Convenience utility to check whether the local client has battle authority (is team 1) or control of a specific entity.
Signature:
Returns:
ok (boolean): true for authoritative client/control
Example:
Description: Smoothly fade an entity out over duration (ms). When used internally the helper also prepares for final removal if requested.
Signature:
Example:
Description: Smoothly fade an entity in from startAlpha (0..255) over duration (ms).
Signature:
Example: