Character

https://i.imgur.com/yPtYbR6.jpg

Characters represents Actors which can be possessed, can move and interact with world. They are the default Skeletal Mesh Character built for nanos world.

Attention

This page is under construction.

Note

Characters are Skeletal Meshes using Unreal’s Mannequin Skeletal, with animations and interactivity already natively integrated into nanos world. It is possible to import any Skeletal Mesh (which uses Unreal’s Mannequin Skeletal) to this Character.

Usage

local char = Character(Vector(123, 456, 789), Rotator(0, 0, 90))

Constructor Parameters

Type

Name

Default

Vector

Location

Vector(0, 0, 0)

Rotator

Rotation

Rotation(0, 0, 0)

string

Model

NanosWorld::SK_Male

number

CollisionType

0 (Normal)

boolean

GravityEnabled

true

number

Health/MaxHealth

100

Usage

-- The following examples are using all Skeletal Meshes which we currently have for examples, including the officials Woman, Man and Mannequin:
local Woman = Character(Vector(100, 0, 100), Rotator(0, 0, 0), "NanosWorld::SK_Female")
local Man = Character(Vector(200, 0, 100), Rotator(0, 0, 0), "NanosWorld::SK_Male")
local Mannequin = Character(Vector(300, 0, 100), Rotator(0, 0, 0), "NanosWorld::SK_Mannequin")

local PostApocalyptic = Character(Vector(400, 0, 100), Rotator(0, 0, 0), "NanosWorld::SK_PostApocalyptic")
local ClassicMale = Character(Vector(500, 0, 100), Rotator(0, 0, 0), "NanosWorld::SK_ClassicMale")

-- Adds Clothes to Man. Note: some Meshes only supports a specific Mesh (Men/Woman)
Man:AddSkeletalMeshAttached("shirt", "NanosWorld::SK_Shirt") -- Men only
Man:AddSkeletalMeshAttached("shirt", "NanosWorld::SK_Underwear") -- Men only
Man:AddSkeletalMeshAttached("pants", "NanosWorld::SK_Pants") -- Men only
Man:AddSkeletalMeshAttached("shoes", "NanosWorld::SK_Shoes_01")
Man:AddSkeletalMeshAttached("shoes", "NanosWorld::SK_Tie")

-- Adds Clothes to Woman
Woman:AddSkeletalMeshAttached("full", "NanosWorld::SK_CasualSet") -- Woman only
Woman:AddSkeletalMeshAttached("shoes", "NanosWorld::SK_Sneakers")

-- Adds Beard to Man
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Extra", "beard")
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Middle", "beard")
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Mustache_01", "beard")
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Mustache_02", "beard")
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Side", "beard")

-- Adds Hair to Man
Man:AddStaticMeshAttached("hair", "NanosWorld::SM_Hair_Long", "hair_male")
Man:AddStaticMeshAttached("hair", "NanosWorld::SM_Hair_Short", "hair_male")

-- Adds Hair to Woman
Woman:AddStaticMeshAttached("hair", "NanosWorld::SM_Hair_Kwang", "hair_female")

Functions

Returns

Name

Description

server-only-label

AddSkeletalMeshAttached(string ID, string StaticMeshPath)

Spawns and Attaches a SkeletalMesh into this Character, the SkeletalMesh must have the same Skeletal used by the Character Mesh, and will follow all animations from it. Uses a custom ID to be used for removing it further

server-only-label

AddStaticMeshAttached(string ID, string StaticMeshPath, string Socket = “”, Vector RelativeLocation = Vector(), Rotator RelativeRotation = Rotator())

Spawns and Attaches a StaticMesh into this Character in a Socket with relative Location and Rotation. Uses a custom ID to be used for removing it further

server-only-label

Drop()

Drops any Pickable the Character is holding

server-only-label

EnterVehicle(Vehicle, number Seat)

Enters the Vehicle at Seat (0 - Driver)

server-only-label

GrabProp(Prop)

Gives a Prop to the Character

server-only-label

LeaveVehicle()

Leaves the current Vehicle

server-only-label

LookAt(Vector Location)

AI: Tries to make this Character to look at Location

server-only-label

MoveTo(Vector Location, number AcceptanceRadius = 50)

AI: Makes this Character to walk to the Location

server-only-label

PickUp(Item/Grenade/Weapon)

Gives a Item/Grenade/Weapon (Pickable) to the Character

server-only-label

PlayAnimation(string AnimationPath, number SlotType = 0, number LoopIndefinitely = false)

Plays an Animation Montage on this character

server-only-label

RandomizeCustomization()

Randomize all character customizations

server-only-label

RemoveSkeletalMeshAttached(string ID)

Removes, if existing, a SkeletalMesh from this Character given it’s custom ID

server-only-label

RemoveStaticMeshAttached(string ID)

Removes, if existing, a StaticMesh from this Character given it’s custom ID

server-only-label

Respawn()

Respawns the Character, fullying it’s Health and moving it to it’s Initial Location.

server-only-label

SetCameraMode(number CameraMode)

Sets the Camera Mode (0 - FPS and TPS, 1 = FPS only, 2 = TPS only)

server-only-label

SetCanCrouch(boolean)

Sets if this Character is allowed to Crouch and to Prone

server-only-label

SetCanSprint(boolean)

Sets if this Character is allowed to Sprint

server-only-label

SetCanGrabProps(boolean)

Sets if this Character is allowed to Grab any Prop

server-only-label

SetCanPickupPickables(boolean)

Sets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Item…)

server-only-label

SetCapsuleSize(number Radius, number HalfHeight)

Sets this Character’s Capsule size (will affect Camera location and Character’s collision) - default is (42, 96)

server-only-label

SetHealth(number NewHealth)

Sets the Health of this Character. If the character is dead, respawns it with full health.

server-only-label

SetMaxHealth(number NewMaxHealth)

Sets the MaxHealth of this Character.

server-only-label

SetMorphTarget(number ID, number Value)

server-only-label

SetMovementEnabled(boolean)

Enables/Disables Character’s Movement

server-only-label

SetRagdollMode(boolean)

Sets Character Ragdoll Mode

server-only-label

SetScalarParameter(number ID, number Value)

Sets a Scalar Material parameter to this Character

server-only-label

SetSpeedMultiplier(number Multiplier)

1 = normal

server-only-label

SetTeam(number Team)

Sets a Team which will disable damaging same Team Members. 0 for Neutral

server-only-label

SetVectorParameter(number ID, Vector Value)

Sets a Vector Material parameter to this Character’s Material

server-only-label

SetViewMode(number)

Sets Character View Mode (0 - FPS, 1 TPS1, 2 - TPS2, 3 - TPS3)

server-only-label

SetWeaponAimMode(number State)

0 - None, 1 - ADS (FPS), 2 - ZoomedZoom (TPS), 3 - Zoomed, 4 - ZoomedFar

server-only-label

StopAnimation(string AnimationPath = “”)

Stops an Animation Montage on this character

server-only-label

UnGrabProp()

UnGrabs/Drops the Prop the Character is holding

boolean

IsInRagdollMode()

Gets Character Ragdoll Mode

boolean

IsMovementEnabled()

Gets Character Movement Enabled

string

GetAssetName()

Gets the Asset name

Rotator

GetControlRotation()

Gets the rotation this character is looking at

Prop

GetGrabbedProp()

Gets the Grabbing Prop

number

GetHealth()

Gets the Character’s Health.

number

GetMaxHealth()

Gets the Character’s MaxHealth.

number

GetMorphTarget(number ID)

Actor

GetPicked()

Gets the holding Picked Item/Grenade/Weapon

Player

GetPlayer()

Gets the Player controlling this Character

number

GetScalarParameter(number ID)

number

GetSpeedMultiplier()

number

GetTeam()

Vector

GetVectorParameter(number ID)

Vehicle

GetVehicle()

Gets the Vehicle the Character is on

number

GetViewMode()

Gets Character View Mode

Functions (Inherited from Actor)

Returns

Name

Description

server-only-label

AddImpulse(Vector Force)

Applies a Force in world coordinate on this Actor (the force is applied on Client side, by the (in most of cases) the closest player of this object)

server-only-label

AttachTo(Actor Other, string BoneName, Vector RelativeLocation, Rotator RelativeRotation)

Attaches this Actor to any other Actor with a Relative Offset/Rotation

server-only-label

Destroy()

Destroys this Actor

server-only-label

SetCollision(number CollisionType)

Sets the actor’s collision (0 - Normal, 1 - Static Only, 2 - No Collision)

server-only-label

SetGravityEnabled(boolean NewGravity)

Sets the actor’s gravity enabled

client-only-label

SetHighlightEnabled(boolean Enabled)

Sets if this Actors is Highlighting

server-only-label

SetInitialLocation(Vector NewInitialLocation)

Sets the initial location

server-only-label

SetLocation(Vector NewLocation)

Sets the actor’s location in the game world

server-only-label

SetRotation(Rotator NewRotation)

Sets the actor’s rotation in the game world

server-only-label

SetScale(Vector Scale)

Sets the actor’s scale

server-only-label

SetTintColor(Color NewTintColor)

Sets the tint color, for completely paint an object, multiply the color by 10 or 100

SetValue(string Key, any Value)

Sets a value in this entity, which can be accessed by any package (local only)

boolean

IsGravityEnabled()

Gets the actor’s gravity enabled

boolean

IsValid()

Returns if this is Valid

number

GetCollision()

Gets the current actor’s collision

number

GetID()

Gets the network ID of this entity (same in both client and server)

Vector

GetLocation()

Get the actor’s position in the game world

server-only-label

Vector

GetInitialLocation()

Gets the initial location

Rotator

GetRotation()

Gets the actor’s rotation in the game world

Vector

GetScale()

Gets the actor’s scale

Color

GetTintColor()

Gets the Tint Color

string

GetType()

Returns the type of this Actor

any

GetValue(string Key)

Gets a value given a key

Events

Name

Arguments

Description

Death

Character self

When Character Dies

Drop

Character self, Item/Grenade/Weapon object, boolean WasTriggeredByPlayer

When Character drops anything

EnterVehicle

Character self, Vehicle vehicle

When Character enters a vehicle

FallingModeChanged

Character self, number OldState, number NewState

0 - None, 1 - Jumping, 2 - Climbing, 3 - Vaulting, 4 - Falling, 5 - HighFalling, 6 - Parachuting, 7 - SkyDiving

Fire

Character self, Weapon weapon

When Character fires a Weapon

GaitModeChanged

Character self, number OldState, number NewState

0 - None, 1 - Walking, 2 - Sprinting

GrabProp

Character self, Prop prop

When Character grabs up a Prop

server-only-label

Interact

Character self, Item/Grenade/Weapon object

When a Character interacts with an object (i.e. try to pick it up) - return false to prevent it

LeaveVehicle

Character self, Vehicle vehicle

When Character leaves a vehicle

MoveCompleted

Character self, boolean Success

Called when AI reaches it’s destination, or when it fails

PickUp

Character self, Item/Grenade/Weapon object

When Character picks up anything

Possessed

Character self, Player possesser

When Character is possessed

Punch

Character self

When Character punches

RagdollModeChanged

Character self, number OldState, number NewState

Reload

Character self, Weapon weapon, number AmmoToReload

When Character reloads a weapon

Respawn

Character self

When Character Respawns

StanceModeChanged

Character self, number OldState, number NewState

0 - None, 1 - Standing, 2 - Crouching, 3 - Proning

SwimmingModeChanged

Character self, number OldState, number NewState

0 - None, 1 - Superficie, 2 - Underwater

TakeDamage

Character self, number damage, string bone, number type (0 - Shot, 1 - Explosion), Vector FromDirection, Player Instigator

When Character takes Damage

UnGrabProp

Character self, Prop prop

When Character drops a Prop

UnPossessed

Character self, Player old_possesser

When Character is unpossessed

ViewModeChanged

Character self, number OldState, number NewState

0 - FPS, 1 - TPS1, 2 - TPS2, 3 - TPS3

WeaponAimModeChanged

Character self, number OldState, number NewState

0 - None, 1 - ADS (FPS), 2 - ZoomedZoom (TPS), 3 - Zoomed, 4 - ZoomedFar

Events (Inherited from Actor)

Name

Arguments

Description

Destroy

Entity actor

Triggered when an Entity is Destroyed

Spawn

Entity actor

Triggered when an Entity is Spawned/Created

Customization

Morph Targets

Scalar Parameters

Vector Parameters

ID

NAME

ID

NAME

ID

NAME

00

nose1

00

BaseColorPower

00

LipstickTint

01

nose2

01

Muscular

01

BrowsTint

02

brows

02

BlushTint

03

mouth

03

EyeShadowTint

04

fat

04

UnderwearTint

05

nose3

05

HairTint

06

chin

07

face

08

nose4

09

skinny

10

jaw

11

brows2

12

angry

13

smirk

14

smirk2

15

smirk3

16

smile

17

nose6

18

jaw_forward

19

lips

20

lips2

21

mouth_wide

22

eyes1

23

eyes2

24

eyes3

25

eyes4

26

eyes_retraction

27

lips3

28

eyes5

29

nose7

30

forehead

31

bodyfat

Character’s Skeleton Bone Names

Ugly list I know

  • Root

    • Pelvis

      • spine_01

        • spine_02

          • spine_03

            • clavicle_l

              • UpperArm_L

                • lowerarm_l

                  • Hand_L

                    • index_01_l

                      • index_02_l

                        • index_03_l

                    • middle_01_l

                      • middle_02_l

                        • middle_03_l

                    • pinky_01_l

                      • pinky_02_l

                        • pinky_03_l

                    • ring_01_l

                      • ring_02_l

                        • ring_03_l

                    • thumb_01_l

                      • thumb_02_l

                        • thumb_03_l

                    • weapon_l

            • clavicle_r

              • UpperArm_R

                • lowerarm_r

                  • Hand_R

                    • index_01_r

                      • index_02_r

                        • index_03_r

                    • middle_01_r

                      • middle_02_r

                        • middle_03_r

                    • pinky_01_r

                      • pinky_02_r

                        • pinky_03_r

                    • ring_01_r

                      • ring_02_r

                        • ring_03_r

                    • thumb_01_r

                      • thumb_02_r

                        • thumb_03_r

                    • weapon_r

            • neck_01

              • Head

                • LeftEye

                • RightEye

                • LeftLidUp

                • LeftLidLow

                • RightLidUp

                • RightLitLow

      • Thigh_L

        • calf_l

          • Foot_L

            • ball_l

      • Thigh_R

        • calf_r

          • Foot_R

            • ball_r