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", Vector(), Rotator())
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Middle", "beard", Vector(), Rotator())
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Mustache_01", "beard", Vector(), Rotator())
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Mustache_02", "beard", Vector(), Rotator())
Man:AddStaticMeshAttached("beard", "NanosWorld::SM_Beard_Side", "beard", Vector(), Rotator())

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

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

Functions

Returns

Name

Description

server-only-label

PickUp(Item/Grenade/Weapon)

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

server-only-label

SetHealth(number NewHealth)

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

number

GetHealth()

Gets the Character’s Health.

server-only-label

SetMaxHealth(number NewMaxHealth)

Sets the MaxHealth of this Character.

number

GetMaxHealth()

Gets the Character’s MaxHealth.

server-only-label

Respawn()

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

server-only-label

Drop()

Drops any Pickable the Character is holding

server-only-label

GrabProp(Prop)

Gives a Prop to the Character

server-only-label

UnGrabProp()

UnGrabs/Drops the Prop the Character is holding

Rotator

GetControlRotation()

Gets the rotation this character is looking at

Prop

GetGrabbedProp()

Gets the Grabbing Prop

Actor

GetPicked()

Gets the holding Picked Item/Grenade/Weapon

Vehicle

GetVehicle()

Gets the Vehicle the Character is on

Player

GetPlayer()

Gets the Player controlling this Character

server-only-label

SetRagdollMode(boolean)

Sets Character Ragdoll Mode

boolean

IsInRagdollMode()

Gets Character Ragdoll Mode

server-only-label

SetViewMode(number)

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

number

GetViewMode()

Gets Character View Mode

server-only-label

RandomizeCustomization()

Randomize all character customizations

server-only-label

LeaveVehicle()

Leaves the current Vehicle

server-only-label

EnterVehicle(Vehicle, number Seat)

Enters the Vehicle at Seat (0 - Driver)

server-only-label

SetMovementEnabled(boolean)

Enables/Disables Character’s Movement

boolean

IsMovementEnabled()

Gets Character Movement Enabled

server-only-label

SetMorphTarget(number ID, number Value)

server-only-label

SetScalarParameter(number ID, number Value)

server-only-label

SetVectorParameter(number ID, Vector Value)

number

GetMorphTarget(number ID)

number

GetScalarParameter(number ID)

Vector

GetVectorParameter(number ID)

number

GetTeam()

number

GetSpeedMultiplier()

server-only-label

AddStaticMeshAttached(number ID, string StaticMeshPath, string Socket, Vector RelativeLocation, Rotator RelativeRotation)

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

AddSkeletalMeshAttached(number 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

RemoveStaticMeshAttached(number ID)

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

server-only-label

RemoveSkeletalMeshAttached(number ID)

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

server-only-label

MoveTo(Vector Location, number AcceptanceRadius)

AI: Makes this Character to walk to the Location

server-only-label

LookAt(Vector Location)

AI: Tries to make this Character to look at Location

server-only-label

SetWeaponAimMode(number State)

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

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

Functions (Inherited from Actor)

Returns

Name

Description

Vector

GetLocation()

Get the actor’s position in the game world

Rotator

GetRotation()

Gets the actor’s rotation in the game world

number

GetCollision()

Gets the current actor’s collision

boolean

IsGravityEnabled()

Gets the actor’s gravity enabled

server-only-label

SetRotation(Rotator NewRotation)

Sets the actor’s rotation in the game world

server-only-label

SetLocation(Vector NewLocation)

Sets the actor’s location in the game world

server-only-label

SetScale(Vector Scale)

Sets the actor’s scale

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

server-only-label

SetInitialLocation(Vector NewInitialLocation)

Sets the initial location

server-only-label

Vector

GetInitialLocation()

Gets the initial location

server-only-label

SetTintColor(Color NewTintColor)

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

Color

GetTintColor()

Gets the Tint Color

server-only-label

Destroy()

Destroys this Actor

boolean

IsValid()

Returns if this is Valid

string

GetType()

Returns the type of this Actor

server-only-label

AttachTo(Actor Other, string BoneName, Vector RelativeLocation)

Attaches this Actor to any other Actor with a Relative Offset

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)

SetValue(string Key, any Value)

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

any

GetValue(string Key)

Gets a value given a key

Events

Name

Arguments

Description

PickUp

Character self, Item/Grenade/Weapon object

When Character picks up anything

Drop

Character self, Item/Grenade/Weapon object

When Character drops anything

GrabProp

Character self, Prop prop

When Character grabs up a Prop

UnGrabProp

Character self, Prop prop

When Character drops a Prop

EnterVehicle

Character self, Vehicle vehicle

When Character enters a vehicle

LeaveVehicle

Character self, Vehicle vehicle

When Character leaves a vehicle

Respawn

Character self

When Character Respawns

Death

Character self

When Character Dies

TakeDamage

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

When Character takes Damage

Fire

Character self, Weapon weapon

When Character fires a Weapon

Possessed

Character self, Player possesser

When Character is possessed

Unpossessed

Character self, Player old_possesser

When Character is unpossessed

Punch

Character self

When Character punches

Reload

Character self, Weapon weapon, number AmmoToReload

When Character reloads a weapon

WeaponAimModeChanged

Character self, number OldState, number NewState

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

ViewModeChanged

Character self, number OldState, number NewState

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

SwimmingModeChanged

Character self, number OldState, number NewState

0 - None, 1 - Superficie, 2 - Underwater

StanceModeChanged

Character self, number OldState, number NewState

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

RagdollModeChanged

Character self, number OldState, number NewState

FallingModeChanged

Character self, number OldState, number NewState

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

GaitModeChanged

Character self, number OldState, number NewState

0 - None, 1 - Walking, 2 - Sprinting

MoveCompleted

Character self, boolean Success

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

Events (Inherited from Actor)

Name

Arguments

Description

Spawn

Entity actor

Triggered when an Entity is Spawned/Created

Destroy

Entity actor

Triggered when an Entity is Destroyed

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