🇭🇰
Sleeping Dogs: DE (Script API)
  • Overview
  • ⛔Const
  • đŸ”ĸEnums
  • đŸ“ĻClasses
    • 🌈Color
    • 💾Config
    • 🚀Console
    • â˜¯ī¸Font
    • đŸ‘ŊHash
    • đŸ–ŧī¸Image
    • âŒ¨ī¸Input
    • đŸ‘ī¸Renderer
    • âŗTimer
    • 2ī¸âƒŖVector2
    • 3ī¸âƒŖVector3
  • đŸ—ƒī¸Game Classes
    • â„šī¸Overview
    • 🔊Audio
    • 📹Camera
    • đŸĢ‚CollisionData
    • 🎮GameInput
    • 🧩GameSlice
    • đŸ“ēHud
    • 📊Metrics
    • 📱PDA
    • 📈ProgressionTracker
    • 💡SimObject
    • 📮SimObjectProp
    • 🧍SimCharacter
    • 🚘SimVehicle
    • đŸ”ĢSimWeapon
    • â˜€ī¸TimeOfDayManager
  • 📩Callbacks
    • OnCollision
    • OnCharacterDeath
    • OnCharacterSpawn
    • OnGameUpdate
    • OnRender
    • OnUnload
    • OnVehicleDeath
Powered by GitBook
On this page
  • Properties:
  • Static Functions:
  • Functions:
  • ActionNodes Functions:
  • AI Functions:
  • Bones Functions:
  • Prop Functions:
  • Vehicle Functions:

Was this helpful?

  1. Game Classes

SimCharacter

General game-character, properties & functions are derived from SimObject.

Properties:

Name
Type
Description

FactionClass

integer

FightingClass

integer

Gender

integer

Heading

float

Direction of facing

Health

integer

(0 to 400)

HealthMax

integer

-

Invulnerable

boolean

-

TakingDamage

boolean

-

Tired

boolean

-

Static Functions:

.Create

SimCharacter.Create(model: Hash, coords: Vector3, heading: float): SimCharacter

Argument
Type
Description

model

Hash

coords

Vector3

Position of new character

heading

float

Heading of new character

Returns SimCharacter object when successfully created. Note: certain models can crash game!

.Get

SimCharacter.Get(object: SimObject): SimCharacter

Argument
Type
Description

object

SimObject

Valid SimObject

This will cast SimObject to SimCharacter use this only if you know what you're doing!

.GetLocalPlayer

SimCharacter.GetLocalPlayer(): SimCharacter

Returns a SimCharacter object of localplayer (Wei Shen).

Functions:

.SetAttackRights

SimCharacter.SetAttackRights(toggle: boolean)

Argument
Type
Description

toggle

boolean

-

Toggles attack rights. Note: by default most peds have no Attack Rights which means they cant be attacked by other peds neither they can attack them.

.GetTarget

SimCharacter.GetTarget(type: TargetType): SimObject

Argument
Type
Description

type

-

.SetTarget

SimCharacter.SetTarget(type: TargetType, object: SimObject)

Argument
Type
Description

type

-

object

SimObject

-

.SetTargetLock

SimCharacter.SetTargetLock(type: TargetType, lock: boolean, modifycollision: boolean)

Argument
Type
Description

type

-

lock

boolean

-

modifycollision

boolean

Set true if interacting with physics object

.ClearTarget

SimCharacter.ClearTarget(type: TargetType)

Argument
Type
Description

type

-

ActionNodes Functions:

.PlayActionNode

SimCharacter.PlayActionNode(id: integer): boolean

Argument
Type
Description

id

integer

Returns true if action was found and successfully queued for play.

.PlayActionNodeByName

SimCharacter.PlayActionNodeByName(name: string): boolean

Argument
Type
Description

name

string

Returns true if action was found and successfully queued for play. Note: this requires full path for action name and most of them might not be resolved so I recommend rather playing them by ID.

.StopActionNode

SimCharacter.StopActionNode()

Stop any currently playing action and restore to first action behavior the character started with.

AI Functions:

.SetAIObjective

SimCharacter.SetAIObjective(type: AIObjective)

Argument
Type
Description

type

-

Sets a current AI Objective for SimCharacter.

Bones Functions:

.GetBonesCount

SimCharacter.GetBonesCount(): integer

Returns number of bone count for SimCharacter. If character for some reason has no bone data it returns -1.

.GetBoneName

SimCharacter.GetBoneName(index: integer): string

Argument
Type
Description

index

integer

-

Returns name of the bone of desired index, if this fails for some reason the return value will be null.

.GetBonePosition

SimCharacter.GetBonePosition(bone: Hash): Vector3

Argument
Type
Description

bone

Hash

-

Returns world position of the desired bone, if this fails return value is [0, 0, 0].

.GetBoneRotation

SimCharacter.GetBoneRotation(bone: Hash): Vector3

Argument
Type
Description

bone

Hash

-

Returns rotation of the desired bone, if this fails return value is [0, 0, 0].

Prop Functions:

.AttachProp

SimCharacter.AttachProp(prop: SimObjectProp, bone: CharacterBone, propbone: PropBone): boolean

Argument
Type
Description

prop

-

bone

(Optional)

propbone

(Optional)

Returns true when prop has been successfully attached to the character, this can fail if character or propr doesn't have default bone or when you specify own bone and it doesn't exist.

.DetachProp

SimCharacter.DetachProp(prop: SimObjectProp): boolean

Argument
Type
Description

prop

-

Returns true if prop has been successfully detached from the character.

Vehicle Functions:

.GetOccupantState

Returns occupant state if SimCharacter is entering/exiting/sitting in some vehicle.

.GetCurrentVehicle

Returns SimVehicle object if SimCharacter is occupant of any vehicle otherwise null.

.GetCurrentVehicleSeatIndex

SimCharacter.GetCurrentVehicleSeatIndex(): integer

Returns seat index if SimCharacter is occupant of any vehicle otherwise -1.

.PlaceInVehicle

SimCharacter.PlaceInVehicle(vehicle: SimVehicle, seatIndex: integer): boolean

Argument
Type
Description

vehicle

-

seatindex

integer

0 - Driver, 1...4 - Passenger

Returns true if SimCharacter was successfully placed in vehicle, this can fail when seat is already occupied. Note: This will teleport character straight to the seat, there is no animation!

.ExitVehicle

SimCharacter.ExitVehicle()

Removes SimCharacter from current vehicle. Note: This will teleport character straight out of the vehicle, there is no animation!

PreviousSimObjectPropNextSimVehicle

Last updated 1 year ago

Was this helpful?

Enum:

Enum:

Enum:

(Hash)

(Hash)

SimCharacter.GetOccupantState():

SimCharacter.GetCurrentVehicle():

đŸ—ƒī¸
🧍
SimVehicle
More info
More Info
More Info
SimObjectProp
SimObjectProp
SimVehicle
CharacterBone
PropBone
CharacterOccupantState
FactionClass
FightingClass
Gender
TargetType
TargetType
TargetType
TargetType
AIObjective