My Project
Public Member Functions | Public Attributes | List of all members
ParaScripting::ParaCharacter Class Reference

ParaObject class: it is used to control game scene objects from scripts. More...

#include <ParaScriptingCharacter.h>

Public Member Functions

bool IsValid ()
 check if the object is valid
 
 ParaCharacter (CBaseObject *pObj)
 
void SetSpeedScale (float fSpeedScale)
 the default value of speed scale is 1.0f, which will use the character's default speed.
 
float GetSpeedScale ()
 
void FallDown ()
 if the biped is in air, it will fall down. More...
 
void SetSizeScale (float fScale)
 the default value of size scale is 1.0f, which will use the character's default size. More...
 
float GetSizeScale ()
 
void SetFocus ()
 ask the camera to follow this character.The camera will be immediately focused on this character without translation.
 
void AddAction2 (int nAction, const object &param)
 add an action symbol, and let the character state manager determine which states it should go to. More...
 
void AddAction (int nAction)
 
bool WalkingOrRunning ()
 return true if character uses walk as the default moving animation.otherwise it uses running. More...
 
bool HasAnimation (int nAnimID)
 whether an animation id exist. More...
 
bool IsCustomModel ()
 check whether this character is customizable.
 
void ResetBaseModel (ParaAssetObject assetCharBaseModel)
 Reset base model. More...
 
void SetSkin (int nIndex)
 set the replaceable skin according to the skin database. More...
 
int GetSkin ()
 return the current skin index. More...
 
void LoadStoredModel (int nModelSetID)
 Load a stored model in data base by the model set ID. More...
 
void PlayAnimation (const object &anims)
 play a specified animation. More...
 
int GetAnimID ()
 get the current animation ID of the character. More...
 
const char * GetAnimFileName ()
 get the current animation's filename. More...
 
void EnableAnimIDMap (bool bEnable)
 set whether the m_mapAnimIDs will be used. More...
 
bool IsAnimIDMapEnabled ()
 get whether the m_mapAnimIDs will be used.Disabled by default
 
bool AddAnimIDMap (int nFromID, int nToID)
 get whether the m_mapAnimIDs will be used.Disabled by default animation ID mapping is a mapping from one animation ID to another ID. More...
 
void ClearAllAnimIDMap ()
 remove all mapping. More...
 
bool HasMountPoint (int nMountPointID)
 whether the character has a mount point at the given ID. More...
 
bool IsMounted ()
 whether the object is mounted on another object. More...
 
void MountOn_ (const char *sTarget)
 mount the current object on another object. More...
 
void MountOn (ParaObject &target)
 the target must contain at least one mount point. More...
 
void MountOn2 (ParaObject &target, int nMountID)
 the target must contain at least one mount point. More...
 
void UnMount ()
 this will force unmount the characer. More...
 
void SetBodyParams (int skinColor, int faceType, int hairColor, int hairStyle, int facialHair)
 Set the character body parameters. More...
 
int GetBodyParams (int type)
 Get the character body parameters. More...
 
void SetDisplayOptions (int bShowUnderwear, int bShowEars, int bShowHair)
 Set the display options for the character. More...
 
bool GetDisplayOptions (int type)
 Get the display option parameters. More...
 
void SetCharacterSlot (int nSlotID, int nItemID)
 set the model ID of a specified character slot. More...
 
int GetCharacterSlotItemID (int nSlotID)
 Get the model ID of a specified character slot. More...
 
void LoadFromFile (const char *filename)
 load all settings of the model to file. More...
 
void SaveToFile (const char *filename)
 save all settings of the model to file. More...
 
void RefreshModel ()
 update the entire model from its characters settings, such as body parameters and equipments. More...
 
void UseAIModule (const char *sAIType)
 use a specified AI object. More...
 
void AssignAIController (const char *sAICtrlerName, const char *sParam1)
 assign a new controller to the current AI object. More...
 
bool IsAIControllerEnabled (const char *sAICtrlerName)
 whether a certain controller is enabled. More...
 
ParaMovieCtrler GetMovieController ()
 get the movie controller. More...
 
ParaSeqCtrler GetSeqController ()
 get the sequence controller. More...
 
ParaFaceTrackingCtrler GetFaceTrackingController ()
 get the face tracking controller. More...
 
void CastEffect (int nEffectID)
 cast a magic effect by the effect ID. More...
 
void CastEffect2 (int nEffectID, const char *sTarget)
 cast a magic effect by the effect ID. More...
 
void AddAttachment (ParaAssetObject ModelAsset, int nAttachmentID)
 
void AddAttachment3 (ParaAssetObject ModelAsset, int nAttachmentID, int nSlotID)
 
void AddAttachment4 (ParaAssetObject ModelAsset, int nAttachmentID, int nSlotID, float fScaling)
 
void AddAttachment5 (ParaAssetObject ModelAsset, int nAttachmentID, int nSlotID, float fScaling, ParaAssetObject ReplaceableTexture)
 
ParaAttributeObject GetAttachmentAttObj (int nAttachmentID)
 get the attachment object's attribute field. More...
 
void RemoveAttachment (int nAttachmentID)
 the model to be detached. More...
 
void RemoveAttachment2 (int nAttachmentID, int nSlotID)
 
void Stop ()
 stop the biped if it is moving. More...
 
void MoveTo (double x, double y, double z)
 move (using the current style i.e. More...
 
void MoveAndTurn (double x, double y, double z, float facing)
 move (using the current style i.e. More...
 
double GetCartoonFaceComponent (int nComponentID, int SubType)
 get the cartoon face associated with this object. More...
 
string GetCartoonFaceComponentCode (int nComponentID, int SubType)
 same as GetCartoonFaceComponent, except that the returned value is a string code. More...
 
void SetCartoonFaceComponent (int nComponentID, int SubType, double value)
 see GetCartoonFaceComponent() More...
 
void SetCartoonFaceComponentCode (int nComponentID, int SubType, const char *color)
 see GetCartoonFaceComponentCode() More...
 
bool IsSupportCartoonFace ()
 check whether the associated cartoon model supports cartoon face. More...
 
void SetSkinColorMask (const char *strColor)
 the color mask to be applied to cartoon face and ccs base layer. More...
 
string GetSkinColorMask ()
 the color mask to be applied to cartoon face and ccs base layer. More...
 
int GetGender ()
 get the character gender. More...
 
int GetRaceID ()
 get the character race ID according to CharRacesDB table More...
 

Public Attributes

CBipedObject::WeakPtr_type m_pCharacter
 

Detailed Description

ParaObject class: it is used to control game scene objects from scripts.

Member Function Documentation

§ AddAction2()

void ParaScripting::ParaCharacter::AddAction2 ( int  nAction,
const object param 
)

add an action symbol, and let the character state manager determine which states it should go to.

this function will not perform any concrete actions on the biped objects.

Parameters
nActionplease see script/ide/action_table.lua for a list of valid values.
paramthe param specifying more details about the action. This value default to nil if nAct is S_ACTIONKEY, then this is const ActionKey* if nAct is S_WALK_POINT, then this is nil or 1, specifying whether to use angle.

§ AddAnimIDMap()

bool ParaScripting::ParaCharacter::AddAnimIDMap ( int  nFromID,
int  nToID 
)

get whether the m_mapAnimIDs will be used.Disabled by default animation ID mapping is a mapping from one animation ID to another ID.

This mapping is usually not used (empty). However, it is used when we can want to secretly replace animation used by this animation instance, by adding a ID to ID map. e.g. we can replace female walk animation ID with an external female walk animation ID.

Note
: remember to EnableAnimIDMap() in order for the mapping to take effect.
Parameters
nFromID
nToIDif it is negative, the mapping nFromID is removed.

§ AddAttachment()

void ParaScripting::ParaCharacter::AddAttachment ( ParaAssetObject  ModelAsset,
int  nAttachmentID 
)
Parameters
ModelAssetthe model to be attached. This can be both ParaX model or static mesh model.
nAttachmentIDto which part of the character, the effect model is attached. ATT_ID_SHIELD = 0, ATT_ID_HAND_RIGHT = 1, ATT_ID_HAND_LEFT = 2, ATT_ID_TEXT = 3, ATT_ID_GROUND = 4, ATT_ID_SHOULDER_RIGHT = 5, ATT_ID_SHOULDER_LEFT = 6, ATT_ID_HEAD = 11, ATT_ID_FACE_ADDON = 12, ATT_ID_EAR_LEFT_ADDON = 13, ATT_ID_EAR_RIGHT_ADDON = 14, ATT_ID_BACK_ADDON = 15, ATT_ID_WAIST = 16, ATT_ID_NECK = 17, ATT_ID_BOOTS = 18, ATT_ID_MOUTH = 19, ATT_ID_MOUNT1 = 20,
nSlotIDthe slot id of the effect. default value is -1. if there is already an effect with the same ID it will be replaced with this new one.
scalingscaling of the texture
ReplaceableTexturereplace the texture.

§ AssignAIController()

void ParaScripting::ParaCharacter::AssignAIController ( const char *  sAICtrlerName,
const char *  sParam1 
)

assign a new controller to the current AI object.

if there is no AI object, we will create a default one to use.

Parameters
sAICtrlerName:validAI controller name is: "sequence"|"movie"|"face"|"follow"|"avoid"
sParam1this format of this parameter is dependent on the sAICtrlerName. see below:

sAICtrlerName = "face": Face tracking controller: sParam1 = "true"|"false": "true" to enable face tracking. e.g. Char:AssignAIController("face", true);

sAICtrlerName = "follow": follow another named biped: sParam1 = "" | "sName" | "sName radius angle" : "" to disable following, or follow a biped called sName.

  • sName: the name of the biped to follow,
  • radius: [optional, default to 2.5f] it is the default radius around the target biped. it will control the biped to try it best to stand on this circle.
  • angle: [optional, default to Pi] it will control the biped to stand beside the target with the target facing shifted by this value. note that +-Pi means behind the biped;0 means in front of the character. e.g. "playername", "playername 2.5 3.14", "playername 3.0 0", "playername 3.0 1.57", "playername 3.0 -1.57" e.g. Char:AssignAIController("follow", "player1"); e.g. Char:AssignAIController("follow", "player1 2.5 3.14");

sAICtrlerName = "movie": enable a movie controller. sParam1 = ""|"true"|"false": "" or "true" to enable a movie, or "false" to disable it. e.g. Char:AssignAIController("movie", "true");Char:AssignAIController("movie", "false"); use GetMovieController() to get the controller

sAICtrlerName = "sequence": enable a sequence controller. sParam1 = ""|"true"|"false": "" or "true" to enable a sequence, or "false" to disable it. e.g. Char:AssignAIController("sequence", "true");Char:AssignAIController("sequence", "false"); use GetSeqController() to get the controller

See also
: UseAIModule()

if there is no AI object, we will create a default one to use

§ CastEffect()

void ParaScripting::ParaCharacter::CastEffect ( int  nEffectID)

cast a magic effect by the effect ID.

Parameters
nEffectIDeffect ID in the effect database if effect id is negative, the effect will be removed from the object.

§ CastEffect2()

void ParaScripting::ParaCharacter::CastEffect2 ( int  nEffectID,
const char *  sTarget 
)

cast a magic effect by the effect ID.

Parameters
nEffectIDeffect ID in the effect database if effect id is negative, the effect will be removed from the object.
sTargettarget of the effect, if there is any. it can either to the name of the target object, or an attachment ID on the current character. in case it is an attachment ID. It should be in the following format. <d> d is the attachment ID. For customizable characters, some IDs are: 0 ATT_ID_SHIELD, 1 ATT_ID_HAND_RIGHT, 2 ATT_ID_HAND_LEFT, – default value 5 ATT_ID_SHOULDER_RIGHT, 6 ATT_ID_SHOULDER_LEFT, 11 ATT_ID_HEAD, e.g. char:CastEffect(1, "NPC0"); – fire missile 1 at NPC0. char:CastEffect(2, "<2>"); – attach the effect 2 to the current character's hand.

§ ClearAllAnimIDMap()

void ParaScripting::ParaCharacter::ClearAllAnimIDMap ( )

remove all mapping.

§ EnableAnimIDMap()

void ParaScripting::ParaCharacter::EnableAnimIDMap ( bool  bEnable)

set whether the m_mapAnimIDs will be used.

Disabled by default

§ FallDown()

void ParaScripting::ParaCharacter::FallDown ( )

if the biped is in air, it will fall down.

In case a biped is put to stop and the terrain below it changes. one should manually call this function to let the biped fall down. Internally it just set the vertical speed to a small value

§ GetAnimFileName()

const char * ParaScripting::ParaCharacter::GetAnimFileName ( )

get the current animation's filename.

If it is an internal animation, it will return nil. If it is from bone animation provider, it returns the file name from which the animation is loaded.

§ GetAnimID()

int ParaScripting::ParaCharacter::GetAnimID ( )

get the current animation ID of the character.

Usually 0-46 is for normal animation like idle and walking; 0-1000 are reserved for internally animation. 1000-2000 are game specific; 2000 plus are automatically generated. One should call GetAnimFileName() for id above 2000.

Returns
: it may return -1 if invalid.

§ GetAttachmentAttObj()

ParaScripting::ParaAttributeObject ParaScripting::ParaCharacter::GetAttachmentAttObj ( int  nAttachmentID)

get the attachment object's attribute field.

§ GetBodyParams()

int ParaScripting::ParaCharacter::GetBodyParams ( int  type)

Get the character body parameters.

@ param type: the body parameter type of the character BP_SKINCOLOR =0, BP_FACETYPE = 1, BP_HAIRCOLOR = 2, BP_HAIRSTYLE = 3, BP_FACIALHAIR = 4

§ GetCartoonFaceComponent()

double ParaScripting::ParaCharacter::GetCartoonFaceComponent ( int  nComponentID,
int  SubType 
)

get the cartoon face associated with this object.

Parameters
nComponentIDone of the following value. cartoon face slots on the face of the character enum CartoonFaceSlots { CFS_FACE = 0, CFS_WRINKLE = 1, CFS_EYE = 2, CFS_EYEBROW = 3, CFS_MOUTH = 4, CFS_NOSE = 5, CFS_MARKS = 6,

CFS_TOTAL_NUM, }; SubType:

  • 0: style: int [0,00]
  • 1: color: 32bits ARGB
  • 2: scale: float in [-1,1]
  • 3: rotation: float in (-3.14,3.14]
  • 4: x: (-128,128]
  • 5: y: (-128,128]
    Note
    : check IsSupportCartoonFace() before using this function

§ GetCartoonFaceComponentCode()

string ParaScripting::ParaCharacter::GetCartoonFaceComponentCode ( int  nComponentID,
int  SubType 
)

same as GetCartoonFaceComponent, except that the returned value is a string code.

Parameters
nComponentIDenum CartoonFaceSlots, in most cases, this is CFS_FACE(0). SubType:
  • 0: style: int [0,00]: code is the string presentation of int.
  • 1: color: 32bits ARGB: code is hex presentation of RGB of the value, such as "ffffff"
  • 2: scale: float in [-1,1]: code is one hex number, where "0" is 0, "9" is 9/9, "a" is -1/7, "f" is -7/7.
  • 3: rotation: float in (-3.14,3.14]: code is at most 2 hex number, where "0" is 0.
  • 4: x: (-128,128]: code is at most 2 hex number, where "0" is 0.
  • 5: y: (-128,128]: code is at most 2 hex number, where "0" is 0. return the code usually hex format, such as "ffffff"

§ GetCharacterSlotItemID()

int ParaScripting::ParaCharacter::GetCharacterSlotItemID ( int  nSlotID)

Get the model ID of a specified character slot.

Parameters
nSlotIDthe ID of the slot to be set for the character. Normally there are 16 slots on the character.
Returns
: the item ID on the given slot. 0 stands for empty. -1 if invalid slot ID

§ GetDisplayOptions()

bool ParaScripting::ParaCharacter::GetDisplayOptions ( int  type)

Get the display option parameters.

@ param type: the display option parameter of the character DO_SHOWUNDERWEAR =0, DO_SHOWEARS = 1, DO_SHOWHAIR = 2

§ GetFaceTrackingController()

ParaFaceTrackingCtrler ParaScripting::ParaCharacter::GetFaceTrackingController ( )

get the face tracking controller.

the sequence controller will be created if it does not exist.

if there is no AI object, we will create a default one to use

§ GetGender()

int ParaScripting::ParaCharacter::GetGender ( )

get the character gender.

Returns
: 0 if male, 1 if female, -1 if error

§ GetMovieController()

ParaMovieCtrler ParaScripting::ParaCharacter::GetMovieController ( )

get the movie controller.

the movie controller will be created if it does not exist.

if there is no AI object, we will create a default one to use

§ GetRaceID()

int ParaScripting::ParaCharacter::GetRaceID ( )

get the character race ID according to CharRacesDB table

Returns
: race ID, -1 if error

§ GetSeqController()

ParaSeqCtrler ParaScripting::ParaCharacter::GetSeqController ( )

get the sequence controller.

the sequence controller will be created if it does not exist.

if there is no AI object, we will create a default one to use

§ GetSkin()

int ParaScripting::ParaCharacter::GetSkin ( )

return the current skin index.

the default skin is at index 0.

§ GetSkinColorMask()

string ParaScripting::ParaCharacter::GetSkinColorMask ( )

the color mask to be applied to cartoon face and ccs base layer.

It can be used to fine tune skin color on top of exiting base skin and face textures. Default value is "ffffff". setting this to a different value will degrade the performance a little.

Returns
the hex string of RGB, such as "fffff"

§ HasAnimation()

bool ParaScripting::ParaCharacter::HasAnimation ( int  nAnimID)

whether an animation id exist.

this function may have different return value when asset is async loaded.

Parameters
nAnimIDpredefined id.

§ HasMountPoint()

bool ParaScripting::ParaCharacter::HasMountPoint ( int  nMountPointID)

whether the character has a mount point at the given ID.

Such characters are usually cars, horses, planes, etc.

Parameters
nMountPointIDthis is usually 0.

§ IsAIControllerEnabled()

bool ParaScripting::ParaCharacter::IsAIControllerEnabled ( const char *  sAICtrlerName)

whether a certain controller is enabled.

Parameters
sAICtrlerName"sequence"|"movie"|"face"|"follow"|"avoid" see also AssignAIController();

if there is no AI object, return false

§ IsMounted()

bool ParaScripting::ParaCharacter::IsMounted ( )

whether the object is mounted on another object.

§ IsSupportCartoonFace()

bool ParaScripting::ParaCharacter::IsSupportCartoonFace ( )

check whether the associated cartoon model supports cartoon face.

§ LoadFromFile()

void ParaScripting::ParaCharacter::LoadFromFile ( const char *  filename)

load all settings of the model to file.

Need to call RefreshModel() after loading.

§ LoadStoredModel()

void ParaScripting::ParaCharacter::LoadStoredModel ( int  nModelSetID)

Load a stored model in data base by the model set ID.

A stored model usually contain the attachments and equipments, but not the base model. This function is only valid when the base model has already been set.

Parameters
nModelSetIDthe ID of the model set in the database. Some ID may be reserved for user-specified model

§ MountOn()

void ParaScripting::ParaCharacter::MountOn ( ParaObject target)

the target must contain at least one mount point.

if there are multiple mount point, it will mount to the closet one.

Parameters
targetthe name of the target object on which the current character is mounted on.

§ MountOn2()

void ParaScripting::ParaCharacter::MountOn2 ( ParaObject target,
int  nMountID 
)

the target must contain at least one mount point.

if there are multiple mount point, it will mount to the closet one.

Parameters
targetthe name of the target object on which the current character is mounted on.
nMountIDthe attachment ID of the model. if -1 (default), we will attach to the nearest mount position.

§ MountOn_()

void ParaScripting::ParaCharacter::MountOn_ ( const char *  sTarget)

mount the current object on another object.

Parameters
sTargetthe name of the global target object on which the current character is mounted on.

§ MoveAndTurn()

void ParaScripting::ParaCharacter::MoveAndTurn ( double  x,
double  y,
double  z,
float  facing 
)

move (using the current style i.e.

walk or run) to a position relative to the current position and turn.

§ MoveTo()

void ParaScripting::ParaCharacter::MoveTo ( double  x,
double  y,
double  z 
)

move (using the current style i.e.

walk or run) to a position relative to the current position.

§ PlayAnimation()

void ParaScripting::ParaCharacter::PlayAnimation ( const object anims)

play a specified animation.

Parameters
anims
  • it can be int of animation ID(external animation id is supported) see local nAnimID = ParaAsset.CreateBoneAnimProvider(-1, filename, filename, false);
  • it can also be string of animation file name
  • it can also be a table of {animID, animID}: currently only two are supported. The first one is usually a non-loop, and second one can be loop or non-loop.

§ RefreshModel()

void ParaScripting::ParaCharacter::RefreshModel ( )

update the entire model from its characters settings, such as body parameters and equipments.

This will rebuild the composed character texture.

§ RemoveAttachment()

void ParaScripting::ParaCharacter::RemoveAttachment ( int  nAttachmentID)

the model to be detached.

See also
AddAttachment();
Parameters
nAttachmentIDthis value is reserved and can be any value.
nSlotIDthe slot id of the effect. default value is -1. all attachments with the SlotID will be removed.

§ ResetBaseModel()

void ParaScripting::ParaCharacter::ResetBaseModel ( ParaAssetObject  assetCharBaseModel)

Reset base model.

Base model is the frame model, to which other sub-models like weapons and clothing are attached. NOTE: the current version will delete the entire model instance, so that any sub-models attached to this model will be deleted and that the default appearance of the base model will show up, if one does not update its equipment after this call.

Parameters
assetCharBaseModelIt is the new base model asset;it should be a valid ParaX model asset.

§ SaveToFile()

void ParaScripting::ParaCharacter::SaveToFile ( const char *  filename)

save all settings of the model to file.

§ SetBodyParams()

void ParaScripting::ParaCharacter::SetBodyParams ( int  skinColor,
int  faceType,
int  hairColor,
int  hairStyle,
int  facialHair 
)

Set the character body parameters.

Need to call RefreshModel() after finished with the settings. All body parameters are integer ranging from 0 to maxType, where maxType is the maximum number of types of of a certain body parameter. For each body parameter, one can specify -1 to retain its current value. This is useful, when the caller only wants to change one or several of the body parameters. The default body parameters is (0,0,0,0,0).

§ SetCartoonFaceComponent()

void ParaScripting::ParaCharacter::SetCartoonFaceComponent ( int  nComponentID,
int  SubType,
double  value 
)

see GetCartoonFaceComponent()

Note
: check IsSupportCartoonFace() before using this function

§ SetCartoonFaceComponentCode()

void ParaScripting::ParaCharacter::SetCartoonFaceComponentCode ( int  nComponentID,
int  SubType,
const char *  color 
)

see GetCartoonFaceComponentCode()

Note
: check IsSupportCartoonFace() before using this function

§ SetCharacterSlot()

void ParaScripting::ParaCharacter::SetCharacterSlot ( int  nSlotID,
int  nItemID 
)

set the model ID of a specified character slot.

Need to call RefreshModel() after finished with the settings.

Parameters
nSlotIDthe ID of the slot to be set for the character. Normally there are 16 slots on the character. CS_HEAD =0, CS_NECK = 1, CS_SHOULDER = 2, CS_BOOTS = 3, CS_BELT = 4, CS_SHIRT = 5, CS_PANTS = 6, CS_CHEST = 7, CS_BRACERS = 8, CS_GLOVES = 9, CS_HAND_RIGHT = 10, CS_HAND_LEFT = 11, CS_CAPE = 12, CS_TABARD = 13, CS_FACE_ADDON = 14, // newly added by andy – 2009.5.10, Item type: IT_MASK 26 CS_WINGS = 15, // newly added by andy – 2009.5.11, Item type: IT_WINGS 27 CS_ARIES_CHAR_SHIRT = 16, // newly added by andy – 2009.6.16, Item type: IT_WINGS 28 CS_ARIES_CHAR_PANT = 17, CS_ARIES_CHAR_HAND = 18, CS_ARIES_CHAR_FOOT = 19, CS_ARIES_CHAR_GLASS = 20, CS_ARIES_CHAR_WING = 21, CS_ARIES_PET_HEAD = 22, CS_ARIES_PET_BODY = 23, CS_ARIES_PET_TAIL = 24, CS_ARIES_PET_WING = 25, CS_ARIES_CHAR_SHIRT_TEEN = 28, // newly added by andy – 2011.8.13, Item type: IT_ARIES_CHAR_SHIRT_TEEN 40
nItemIDthe ID of the item to be put into the character slot. The default value for all slots is 0. One may empty a certain slots by setting its nItemID to 0.

§ SetDisplayOptions()

void ParaScripting::ParaCharacter::SetDisplayOptions ( int  bShowUnderwear,
int  bShowEars,
int  bShowHair 
)

Set the display options for the character.

in case of boolean input: 1 stands for true; 0 stands for false, -1 stands for retaining its current value. Need to call RefreshModel() after finished with the settings.

§ SetSizeScale()

void ParaScripting::ParaCharacter::SetSizeScale ( float  fScale)

the default value of size scale is 1.0f, which will use the character's default size.

increasing this value will enlarge the character as well as its physical radius.

§ SetSkin()

void ParaScripting::ParaCharacter::SetSkin ( int  nIndex)

set the replaceable skin according to the skin database.

this only applies to non-customizable characters.if the index exceeds, it will use the default one. the default skin is at index 0.

Parameters
nIndexthe skin index.

§ SetSkinColorMask()

void ParaScripting::ParaCharacter::SetSkinColorMask ( const char *  strColor)

the color mask to be applied to cartoon face and ccs base layer.

It can be used to fine tune skin color on top of exiting base skin and face textures. Default value is "ffffff". setting this to a different value will degrade the performance a little.

Parameters
strColorthe hex string of RGB, such as "RGB".

§ Stop()

void ParaScripting::ParaCharacter::Stop ( void  )

stop the biped if it is moving.

§ UnMount()

void ParaScripting::ParaCharacter::UnMount ( )

this will force unmount the characer.

However, it is usually not natural to do this explicitly, since we do not know how the character should behave after mount. Instead, one can call player_obj:ToCharacter():AddAction(action_table.ActionSymbols.S_JUMP_START) to unmount by jumping off.

§ UseAIModule()

void ParaScripting::ParaCharacter::UseAIModule ( const char *  sAIType)

use a specified AI object.

Parameters
sAITypevalid AI object is: "NPC"|""|"NULL" "" is the same as "NPC" "NULL" means no AI module.

§ WalkingOrRunning()

bool ParaScripting::ParaCharacter::WalkingOrRunning ( )

return true if character uses walk as the default moving animation.otherwise it uses running.


The documentation for this class was generated from the following files: