pebxcvi's picture
big update
d7bb13e
raw
history blame
41.3 kB
1.64 Person .522
1.64.1 Person.AttachToEntity .522
1.64.2 Person.DoAction .523
1.64.3 Person.DoActionBroadcast .524
1.64.4 Person.EnableChatBubbles .525
1.64.5 Person.EnableCollision .525
1.64.6 Person.Findlnlnstance .526
1.64.7 Person.GetAnimReg .527
1.64.8 Person.GetAvatarStatusType .527
1.64.9 Person.GetBehavior .528
1.64.10 Person.GetBehaviorCategory .528
1.64.11 Person.GetBoneCount .529
1.64.12 Person.GetBonelndex .530
1.64.13 Person.GetBoneLocalMatrix .530
1.64.14 Person.GetBoneWorldMatrix .531
1.64.15 Person.GetCurrentAction .531
1.64.16 Person.GetGroundllserld .532
1.64.17 Person.GetPleight .532
1.64.18 Person.Getld .533
1.64.19 Person.GetldsOfFriendsInlnstance .534
1.64.20 Person.GetldsOfRemotePeoplelnlnstance .534
1.64.21 Person.GetlnstanceSessionMasterld .535
1.64.22 Person.GetlnventoryltemObjectld .535
1.64.23 Person.GetLocalBounds .536
1.64.24 Person.GetMood .537
1.64.25 Person.GetName .537
1.64.26 Person.GetPosition .538
1.64.27 Person.GetRigComponentObjectld .538
1.64.28 Person.GetRigComponentTypes.539
1.64.29 Person.GetRigField .540
1.64.30 Person.GetRotationY.540
1.64.31 Person.GetUser .541
1.64.32 Person.GetVelocity .541
1.64.33 Person.GetWidth .542
1.64.34 Person.GetWorldBounds .542
1.64.35 Person.HasLock .543
1.64.36 Person.InterpolatePosition .544
1.64.37 Person.IsCollision .544
1.64.38 Person.IsLoaded .545
1.64.39 Person.IsLocked .546
1.64.40 Person.IsOnGround .546
1.64.41 Person. IsRigUsingComponent .547
1.64.42 Person.IsValid .547
1.64.43 Person.IsVisible .548
1.64.44 Person.Lock.549
1.64.45 Person.ResetCurrentStatusText .550
1.64.46 Person.SetAnimReg .550
1.64.47 Person.SetBehavior.551
1.64.48 Person.SetCurrentStatusText .552
1.64.49 Person.SetLabelText .552
1.64.50 Person.SetPosition .553
1.64.51 Person.SetRotationY .553
1.64.52 Person.SetVisible .554
1.64.53 Person.Unlock .554
Person
Person. AttachToEntity
Brief
Attaches the person to specified entity so when the entity moves around the person moves with it.
Definition
Person.AttachToEntity( Person person, Entity entity = nil, Matrix44 localTransform = nil )
Arguments
entity - the entity to attach to or nil to detach player from current entity.
Return Values
None.
Description
When attached to an entity, setting position and rotation will affect the local transform only. The transform must be locked by the calling lua
environment otherwise a lua error is generated. If the person is unlocked it automatically detaches from the entity.
Examples
person = LocalPlayer.GetPerson ()
car = Entity.Create ()
Person.AttachToEntity( person, car )
See Also
None
Person. DoAction
Brief
Plays an action on a Person
Definition
Person.DoAction( Person person, string actionName, boolean autoUnlock = false )
Person.DoAction( Person person, string actionName, boolean autoUnlock, number unlockFeatures )
Arguments
person - the person to play an action on.actionName - Name of the action to be performed. It can be a custom animation loaded remotely through
LocalPlayer.AddRepertoire as well as one of the following standard actions:
"agree�
"beckon"
"bow"
"cheer"
"clap"
"disagree"
"frustration"
"laugh"
"point"
"wave"
"stand_up_from_seat"autoUnlock - if true, then the animation lock on the person is automatically released after the action has completed.
Defaults to false.unlockFeatures - only used if the autoUnlock parameter is true. If omitted then defaults to releasing the locks that were set when
Person.DoAction was called, otherwise will only release the locks specified,
features specified.
Return Values
Returns true if the action succeeds.
Description
The animation must be locked by the calling lua environment otherwise a lua error is generated. If the action isn't recognized a lua error is
generated. If it fails and autollnlock is true it unlocks immediately.
Examples
if Person.HasLock ( person ) then
Person.DoAction( person, "clap" )
end
See Also
� Person.Lock
� Person.Unlock
� Person.IsLocked
� Person.HasLock
� Person.SetBehavior
� Person.DoActionBroadcast
Person.DoActionBroadcast
Brief
Piays an action on a Person
Definition
Person.DoActionBroadcast( Person person, string actionName, boolean autoUnlock = false )
Person.DoActionBroadcast( Person person, string actionName, boolean autoUnlock, number unlockFeatures
)
Arguments
person - the person to play an action on.actionName - Name of the action to be performed. It can be a custom animation loaded remotely through
LocalPlayer.AddRepertoire as well as one of the following standard actions:
"agree�
"beckon"
"bow�
"cheer"
"clap"
"disagree"
"frustration"
"laugh"
"point"
"wave"
"stand_up_from_seat"autoUnlock - if true, then the animation lock on the person is automatically released after the action has completed.
Defaults to false.unlockFeatures - only used if the autoUnlock parameter is true. If omitted then defaults to releasing the locks that were set when
Person.DoActionBroadcast was called, otherwise will only release the locks specified,
features specified.
Return Values
Returns true if the action succeeds.
Description
The animation must be locked by the calling lua environment otherwise a lua error is generated. If the action isn't recognized a lua error is
generated. If it fails and autoUnlock is true it unlocks immediately. If calling DoActionBroadcast on the LocalPlayer, this function will broadcast the
action to other clients in the scene. Using DoActionBroadcast impacts on the amount of network traffic, so avoid calling this function frequently.
Examples
if Person.HasLock( person ) then
Person.DoActionBroadcast( person, "clap" )
end
See Also
� Person.Lock
� Person.Unlock
� Person. IsLocked
� Person.HasLock
� Person.SetBehavior
� Person.DoAction
Person.EnableChatBubbles
Brief
Sets chat bubbles on or off.
Definition
! Person.EnableChatBubbles( Person person, boolean enabled )
Arguments
enabled - True to enable chat bubbles or false to disable.
Return Values
None.
Description
With this function, a script can allow chat bubbles to be switched on or off at will. Chat will still appear in the chat log as normal. Please note: In
order to use this function, the is_allowed_chat_bubble_change property in the object's mini_game component must be set to true.
Examples
local person = LocalPlayer.GetPerson( );
if ( Person.Lock( person, PersonLockType.ChatBubbles ) == true ) then
Person.EnableChatBubbles( person, false );
end
See Also
� Person.Lock
� Person.Unlock
Person.EnableCollision
Brief
Toggles collision detection for the person's avatar.
Definition
! Person.EnableCollision( Person person, boolean value )
Arguments
person - the person to modify.value - Whether collision should be on or off.
Return Values
None.
Description
Toggles collision detection for the person's avatar. The collision must be locked by the calling lua environment otherwise a lua error is generated.
Examples
! if Person.IsCollision ( person ) then
Person.EnableCollision( person, false )
| end
See Also
� Person.IsCollision
Person.Findlnlnstance
Brief
Finds a person in the instance from the person ID.
Definition
! Person Person.Findlnlnstance( string personld )
Arguments
personld - The person to find.
Return Values
A Person if found and nil otherwise.
Description
Finds a person in the instance from the specified person ID.
Examples
me = Person.Findlnlnstance( LocalPlayer.GetPersonld() )
See Also
Local Player.GetPersonld
Person. GetAnimReg
Brief
Returns the value of the specified animation register.
Definition
number|boolean|string Person.GetAnimReg(Person person, string registerName)
Arguments
person - person to query.registerName - the name of the animation register to get.
Return Values
The value of the register, with the type based on the register type.
Description
If the register doesn't exist or the animation register doesn't have Lua read access an error will be thrown.
Examples
! fatness = person:GetAnimReg("Fatness")
See Also
� Person. SetAnimReg
Person.GetAvatarStatusType
Brief
Returns the current avatar status type of the person specified
Definition
number Person.GetAvatarStatusId( Person person )
Arguments
person - The person to query.
Return Values
The enumerated value of the current status type.
Description
The user can change the status of their avatar from the emotes menu. This method returns the current user status type. Changing the status type
affects the facial animation (mood) used, and the status text above the avatar that remote users see. The possible status types are:
AvatarStatusType.Neutral
AvatarStatusT ype. Happy
AvatarStatusType.Sad
AvatarStatusType. Angry
AvatarStatusType.Confused
AvatarStatusType. Unwell
AvatarStatusType.Busy
AvatarStatusType. IsLookingForHelp
AvatarStatusT ype. WantT oChat
AvatarStatusType. WantToPlayGame
Examples
me = LocalPlayer.GetPerson()
if Person.GetAvatarStatusType( me ) == AvatarStatusType.Happy then
DoSomethingHappy()
end
See Also
� Person.GetMood
Person.GetBehavior
Brief
Returns the name of the current behavior playing on the person.
Definition
string Person.GetBehavior( Person person )
Arguments
person - The person to query.
Return Values
The name of the current behavior playing on the person.
Description
Returns the name of the current behavior playing on the person or nil if the behavior is a Plome internal behavior. For a list of Home's public
behaviors see Person.SetBehavior. For post 1.40 behaviour, if the behaviour belongs to the calling script environment, will only specify the name.
If the behaviour belongs to another object, that has allowed its behaviours to be public, then will specify the object id, as well as the name. For
pre-1.40 behaviour. For the local player, will only return the name of the behaviour, but for remote persons, will return the fully qualified name
(objectld:name) - this is for backwards compatibility. If the behaviour is a system public behaviour, will return the name only.
Examples
behaviorName = Person.GetBehavior( person )
See Also
� Person.SetBehavior
Person. GetBehaviorCategory
Brief
Returns the specified person's behavior state.
Definition
string|nil Person.GetBehaviorCategory( Person person )
Arguments
person - The person to update.
Return Values
Returns the specified person's behavior state.
Description
Returns nil if in an internal behavior or be one of the following: "dancing'' "posing" �sitting_on_floor" "sitting_on_seat" "standing" "moving"
Behaviors should be catagorized into one of the above states. This function can be used to check if a person is dancing etc. without checking the
animation behavior name.
Examples
! if Person.GetBehaviorCategory( LocalPlayer.GetPerson() ) == 'dancing* then
StartTheParty()
| end
See Also
� Person.GetBehavior
� Person.SetBehavior
Person. GetBoneCount
Brief
Get the number of bones in the person's skeleton.
Definition
! number Person.GetBoneCount(Person person)
Arguments
person - Person to query.
Return Values
Number of bones in the skeleton, or 0 if the skeleton is not available.
Description
Retrieves the number of bones/joints in the person's skeleton. If no skeleton is present or loaded, 0 is returned.
Examples
! local boneCount = LocalPlayer.GetPerson():GetBoneCount()
See Also
Person.GetBonelndex
Person.GetBonelndex
Brief
Find the index of a bone in the person's skeleton.
Definition
! number Person.GetBonelndex(Person person, string boneName)
Arguments
person - Person to query.boneName - Name of bone to locate.
Return Values
The index of the bone in the skeleton (in range 1 - GetBoneCount()), or 0 if not found.
Description
Retrieves the index of the specified bone/joint in the person's skeleton. The index is 1 -based. If the bone cannot be found, or there is no skeleton
attached or loaded, 0 is returned.
Examples
1 local leftHandlndex = LocalPlayer.GetPerson():GetBonelndex("lefthand")
See Also
� Person.GetBoneCount
� Person.GetBoneLocalMatrix
� Person.GetBoneWorldMatrix
Person.GetBoneLocalMatrix
Brief
Get the local transform matrix for a bone in the skeleton.
Definition
! Person.GetBoneLocalMatrix(Person person, string|number bone, Matrix44 result)
Arguments
person - Person to query.bone - Bone name or index.result (out) - Matrix44 value to store result into.
Return Values
None.
Description
Retrieve the local-space transform matrix for a specified bone in the skeleton. If the bone is not found an error will result. Retrieving the matrix by
index will be more efficient if done more than once.
Examples
local mat = Matrix44.Create ()
LocalPlayer.GetPerson():GetBoneLocalMatrix("lefthand", mat)
� or
local leftHandlndex = LocalPlayer.GetPerson():GetBonelndex("lefthand")
LocalPlayer.GetPerson():GetBoneLocalMatrix(leftHandlndex, mat)
See Also
� Person. GetBoneWorldMatrix
� Person.GetBonelndex
Person.GetBoneWorldMatrix
Brief
Get the world transform matrix for a bone in the skeleton.
Definition
Person.GetBoneWorldMatrix(Person person, string|number bone, Matrix44 result)
Arguments
person - Person to query.bone - Bone name or index.result (out) - Matrix44 value to store result into.
Return Values
None.
Description
Retrieve the world-space transform matrix for a specified bone in the skeleton. If the bone is not found an error will result. Retrieving the matrix by
index will be more efficient if done more than once.
Examples
local mat = Matrix44.Create ()
LocalPlayer.GetPerson():GetBoneWorldMatrix("lefthand", mat)
� or
local leftHandlndex = LocalPlayer.GetPerson():GetBonelndex("lefthand")
LocalPlayer.GetPerson():GetBoneWorldMatrix(leftHandlndex, mat)
See Also
� Person.GetBoneLocalMatrix
� Person.GetBonelndex
Person.GetCurrentAction
Brief
Returns the name of the current action the person is in, if any.
Definition
! string Person.GetCurrentAction( Person person )
Arguments
person - The person to query.
Return Values
Returns the name of the current action.
Description
If the person is not in an action nil is returned. Home internal actions will also return nil. For a list of Home public actions see Person.DoAction.
Examples
I actionName = Person.GetCurrentAction( LocalPlayer.GetPerson() )
See Also
� Local Player. DoAction
� LocalPlayer.IsDoingAction
Person. GetGroundllserld
Brief
Return the userlD of the collision on which the person is standing.
Definition
! number Person.GetGroundUserld( Person person )
Arguments
person - The person to query
Return Values
The userlD.
Description
Return the userlD of the collision on which the person is standing. Check Person.IsOnGround before calling this function; if the person is not on
the ground an error will occur.
Examples
! if ( person:IsOnGround() ) then
print( Person.GetGroundUserld( person ) )
| end
See Also
� Person.IsOnGround
Person.GetHeight
Brief
Retrieve the avatar's height in meters.
Definition
! number Person.GetHeight(Person person)
Arguments
person - the person to query.
Return Values
The height of the person's avatar in meters, or nil if the avatar is not yet loaded.
Description
The value returned is the height of the avatar when in the bind pose, given the current height settings, in meters. This will return nil if the avatar is
currently a fallback.
Examples
! if ( person:GetHeight() <1.0 ) then print ("Hello shorty") end
See Also
None
Person.Getld
Brief
Returns the person's ID.
Definition
j string Person.GetId( Person person )
Arguments
person - The person to query.
Return Values
The person's ID.
Description
Returns the person's ID. A person's ID value is unique per instance, but not across instances and is not persistent. That is, a person ID can be
used within an instance to uniquely identify any person in that instance, but it should be assumed to be assigned at random to players entering
the instance, and only valid while that player is in the instance. Players in another instance of the same scene will not be accessible by person ID.
Players exiting and re-entering the instance will almost certainly be assigned a different person ID, but a person's ID will not change while they
remain in the same instance.
Examples
me = LocalPlayer.GetPerson()
if Person.GetId( me ) ~= LocalPlayer.GetPersonld() then
print( "Oh no!" )
end
See Also
� LocalPlayer.GetPerson
� LocalPlayer.GetPersonld
Person.GetldsOfFriendsInlnstance
Brief
Returns a table of people IDs in the current instance that are friends.
Definition
string[] Person.GetldsOfFriendsInlnstance()
Arguments
None
Return Values
A table of person ID strings.
Description
Returns a table of person IDs in the current instance that are friends.
Examples
! ids = Person.GetIdsOfFriendsInlnstance()
; numFriends = #ids
j print( "There are " .. numFriends .. " friends in the instance." )
See Also
None
Person. GetldsOfRemotePeoplelnlnstance
Brief
Returns a table of all remote person IDs in the current instance.
Definition
string[] Person.GetldsOfRemotePeoplelnlnstance()
Arguments
None
Return Values
A table of person ID strings.
Description
Returns a table of person IDs for all remote avatars in the current instance.
Examples
! ids = Person.GetIdsOfRemotePeoplelnlnstance()
i numAvatars = #ids + 1
I print( "There are " .. numAvatars .. " avatars in the instance." )
See Also
None
Person.GetlnstanceSessionMasterld
Brief
Returns the current instance's session master Person ID.
Definition
string Person.GetlnstanceSessionMasterld()
Arguments
None
Return Values
A person ID of the session master or nil if not ready yet.
Description
Returns the current instance's session master Person ID. Each instance has a session master automatically assigned to it. When a new instance
is created the first person in that instance will be the session master and if they leave then a new session master is chosen if other users are in
the instance.
Examples
local sessionMasterld = Person.GetInstanceSessionMasterld()
local sessionMaster = nil
if sessionMasterld ~= nil then
sessionMaster = Person.Findlnlnstance( sessionMasterld )
SendNetworkMessageToRequestlnstanceState( sessionMaster )
end
See Also
� User.GetSceneOwner
Person. GetlnventoryltemObjectld
Brief
Obtain the object id of the currently deployed companion object.
Definition
! string Person.GetInventoryltemObjectId(Person person)
Arguments
person - The person to query.
Return Values
The object ID of the deployed inventory item if present, and nil otherwise.
Description
Obtains the object id of the currently deployed companion object, or returns nil if one is not currently active.
Examples
if (Person.GetlnventoryltemObjectld(person) == "12345678-12345678-12345678-12345678") then
isAllowedlntoMiniGame = true
| end
See Also
None
Person.GetLocalBounds
Brief
Retrieve the local-space bounds of a person.
Definition
! boolean Person.GetLocalBounds(Person person, Vector4 min, Vector4 max)
Arguments
person - The person to query.min (out) - Vector4 value to receive the minimum extent.max (out) - Vector4 value to receive the maximum extent.
Return Values
True if the bounds were retrieved successfully, false if the person is not yet loaded.
Description
Get the local-space bounds of a person's model. This will reflect the user's clothing choices and height selection. If the person's avatar is not
loaded, this function will return false.
Examples
local min = Vector4.Create ()
local max = Vector4.Create()
if (LocalPlayer.GetPerson():GetLocalBounds(min, max)) then
print("Local player avatar is", max:Y() - min:Y(), "metres tall")
end
See Also
� Person.GetWorldBounds
Person. GetMood
Brief
Returns the mood of the specified person.
Definition
MoodType Person.GetMood(Person person)
Arguments
person - the person to interrogate the mood value for.
Return Values
The enumerated value of the mood.
Description
The mood type is the facial animation that is used on the idling person. This is controlled by the user through the status option in the emotes
menu. Different statuses can share the same mood, ie Confused and IsLookingForHelp statuses both use the same mood Confused. The
enumerated type of MoodType is:
MoodType.Neutral
MoodType.Happy
MoodType.Sad
MoodType.Angry
MoodType.Confused
Examples
if (person:GetMood() == MoodType.Sad) then
print("Why the long face?")
end
See Also
� Person. GetAvatarStatusType
Person. GetName
Brief
Returns the person's Online ID.
Definition
string Person.GetName( Person person )
Arguments
person - The person to query.
Return Values
The person's Online ID.
Description
Returns the person's Online ID, but only if you launch HomeDeveloper.self in online mode. If launching in offline mode, only the local player's
Person will be accessible, and the function will return the string "Me".
Examples
! me = LocalPlayer.GetPerson()
i print( "My name is " .. Person.GetName( me ) )
See Also
� LocalPlayer.GetPerson
Person.GetPosition
Brief
Returns the position of the person.
Definition
Vector4 Person.GetPosition( Person person )
Person.GetPosition( Person person, Vector4 outVec )
Arguments
person - The person to query.outVec - The Vector4 to store the result to.
Return Values
The position of the person.
Description
Returns a vector containing the position of the specified person.
Examples
! me = LocalPlayer.GetPerson()
print( "I am at: ", Person.GetPosition( me ) )
See Also
Local Player.GetPerson
Person.GetRigComponentObjectld
Brief
Returns the specified component type's object ID.
Definition
! string Person.GetRigComponentObjectId( Person person, string componentType )
Arguments
person - The person to query.componentType - The component type to search for. It is case sensitive.
Return Values
The component's object ID or nil if not found.
Description
Returns the specified component type's object ID. The component must be loaded to identity its type.
Examples
! me = LocalPlayer.GetPerson()
i types = Person.GetRigComponentTypes( person )
| print( 'type=* .. types[ 1 ] ' object id=' .. Person.GetRigComponentObjectId( person, types[ 1 ] )
)
See Also
� Person.GetRigComponentTypes
Person.GetRigComponentTypes
Brief
Returns a table of strings for the current rig's component types.
Definition
! string[] Person.GetRigComponentTypes( Person person )
Arguments
person - The person to query.
Return Values
Table of strings for the rig component types.
Description
Returns a table of strings for the current rig's component types. The rig must be loaded to obtain the information.
Examples
me = LocalPlayer.GetPerson()
rigCompTypes = Person.GetRigComponentTypes( me )
if rigCompTypes ~= nil then
for index, item in ipairs( rigCompTypes ) do
print( 'type = ' .. item )
end
end
See Also
� Person.GetRigComponentObjectld
Person.GetRigField
Brief
Returns the value of the field and nil if not found
Definition
string|number|boolean Person.GetRigField( Person person, string field )
Arguments
person - The person to query.field - The field to retrieve. Can be one of the following:
"sex" (returns the string "male" or "female")
Return Values
The value of the field and nil if not found. Supported types are boolean, string and number.
Description
Returns the value of the field and nil if not found. The rig must be loaded to get the correct result.
Examples
me = LocalPlayer.GetPerson()
| print( "My gender is " .. Person.GetRigField( me, "sex" ) )
See Also
� LocalPlayer.GetPerson
Person. GetRotationY
Brief
Returns the y-axis rotation of the person.
Definition
number Person.GetRotationY( Person person )
Arguments
person - The person to query.
Return Values
The rotation in the y-axis of the person in degrees.
Description
Returns the rotation in the y-axis of the specified person in degrees.
Examples
i me = LocalPlayer.GetPerson()
! print( "My rotation is: " .. Person.GetRotationY( me ) )
See Also
� LocalPlayer.GetPerson
Person.GetUser
Brief
Returns the User object for this person.
Definition
User Person.GetUser( Person person )
Arguments
person - The person to query.
Return Values
The User object for the specified person.
Description
Returns the User object attached to the specified person.
Examples
local user = person:GetUser()
print(person:GetName() .. (user:IsFriend() and " is " or " is not ") .. "your friend!")
See Also
Person.GetVelocity
Brief
Returns the current velocity of the person.
Definition
Vector4 GetVelocity( Person person )
locity( Person person, Vector4 outVec )
Arguments
person - the person to queryoutVec - The Vector4 to store the result in
Return Values
Returns the current velocity of the person specified if no outVec is supplied.
Description
Returns a vector containing the velocity of the person specified.
Examples
1 local me = LocalPlayer.GetPerson()
i elocity is: ", Person.GetVelocity( me ) )
See Also
None
Person.GetWidth
Brief
Retrieves the width factor of an avatar.
Definition
! number Person.GetWidth(Person person)
Arguments
person - the person to query.
Return Values
The width factor of the person in the range [ -1, 1 ], or nil if the avatar isn't yet loaded and available.
Description
Return the width factor of the avatar, which is in the range -1 to 1, with -1 being thin, 0 being average, and 1 being fat.
Examples
1 if ( Person.GetWidth() == 1) then BreakChair() end
See Also
None
Person.GetWorldBounds
Brief
Retrieve the world-space bounds of a person.
Definition
boolean Person.GetWorldBounds(Person person, Vector4 min, Vector4 max)
Arguments
person - The person to query.min (out) - Vector4 value to receive the minimum extent.max (out) - Vector4 value to receive the maximum extent.
Return Values
True if the bounds were retrieved successfully, false if the person is not yet loaded.
Description
Get the world-space bounds of a person's model. This will reflect the user's clothing choices and height selection. If the person's avatar is not
loaded, this function will return false.
Examples
local min = Vector4.Create ()
local max = Vector4.Create ()
if (LocalPlayer.GetPerson():GetWorldBounds(min, max)) then
print("Local player avatar is", max:Y() - min:Y(), "metres tall")
end
See Also
� Person.GetLocalBounds
Person.HasLock
Brief
true if the person is locked by the calling Lua environment and false otherwise.
Definition
boolean Person.HasLock( Person person )
boolean Person.HasLock( Person person , number lockFeatures, boolean any = false )
Arguments
person - the person to query.lockFeatures - specific lock features to test to see if they are locked by this lua environmentany - if lockFeatures is
specified, then this parameter is used to indicate that if any of the features specified are locked, then return true
otherwise will only return true if all the features specified are locked.
Return Values
true if the person is locked by the calling Lua environment and false otherwise.
Description
true if the person is locked by the calling Lua environment and false otherwise.
Examples
if Person.HasLock( person ) == true then
Person.DoAction( person, "Clap" )
end
See Also
� Person.Lock
� Person.Unlock
� Person.IsLocked
� Person.DoAction
� Person.SetBehavior
Person.InterpolatePosition
Brief
Allows the client to interpolate the position of the person in the frames between successive calls to InterpolatePosition.
Definition
! Person.InterpolatePosition( Person person, Vector4 position, Vector4 velocity, number facingAngle,
i number timeOffset = 0)
Arguments
person - the person to interpolate the position onposition - the position to use for the interpolationvelocity - the velocity to use for the
interpolationfacinqAnqle - the anqle the person is facinqtimeOffset - the difference in time between the session clocks (in seconds) - if omitted
then defaults to 0.0
Return Values
None.
Description
The calling lua environment must have atleast a Transform lock on the person for the call to succeed This call will only work on NPC persons (will
throw a Lua error for the the local player person).
Examples
person:InterpolatePosition( recvdPos, recvdVel, recvdAngle, timeOffset )
See Also
� Person.Lock
� Person.GetPosition
� Person.GetVelocity
Person.IsCollision
Brief
Reports whether the person's collision is enabled.
Definition
boolean Person.IsCollision( Person person )
Arguments
person - the person to query.
Return Values
true if collision for the player is on and false otherwise.
Description
Reports whether the person's collision is enabled.
Examples
! if Person.IsCollision( person ) then
Person.EnableCollision( person, false )
| end
See Also
� Person.EnableCollision
Person.IsLoaded
Brief
Indicates when a person's avatar is fully loaded and visible.
Definition
boolean Person.IsLoaded(Person person)
Arguments
person - The person to query.
Return Values
True if the person's avatar is fully loaded and ready, or false if still loading or invalid.
Description
When a person initially enters the scene, their avatar and associated components may still be loading in the background. Some functionality such
as locking is not available until the avatar is ready, so this function can be used to query the loading state of the person. If the person object is
invalid, this function will return false.
Examples
if (person:IsValid() and person:IsLoaded()) then
if (not person:Lock(PersonLockType.All)) then
print("Unable to get lock!")
end
end
See Also
� Person.IsValid
Person.IsLocked
Brief
true if the person is locked by any lua environment and false otherwise.
Definition
! boolean Person.IsLocked(Person person)
Arguments
person - the person to query.
Return Values
true if the person is locked by any lua environment and false otherwise.
Description
true if the person is locked by any lua environment and false otherwise.
Examples
if Person.IsLocked( person ) == true and Person.HasLock( person ) == false then
print( �Waiting to get the lock' )
| end
See Also
� Person.Lock
� Person.Unlock
� Person.HasLock
� Person.DoAction
� Person.SetBehavior
Person. IsOnGround
Brief
Return whether the person is on the ground or not.
Definition
! boolean Person.IsOnGround( Person person )
Arguments
person - The person to query
Return Values
true if on the ground, false otherwise.
Description
Return whether the person is on the ground or not.
Examples
! print( Person.IsOnGround( person ) );
See Also
� Person.GetGroundllserld
Person.IsRigUsingComponent
Brief
Returns true if the specified object is being used and false otherwise.
Definition
boolean Person.IsRigUsingComponent( Person person, string objectld )
Arguments
person - The person to query.objectld - The object ID to test for its usage.
Return Values
true if the specified object is being used and false otherwise.
Description
Returns true if the specified object is being used and false otherwise. Does not require the specified object have have completed its loading for
the function to succeed.
Examples
me = LocalPlayer.GetPerson()
smartJacketId = "853B950D-ACF84EE7-920D819B-5A9A6C16"
if Person.IsRigUsingComponent( me, smartJacketld ) then
accessGranted = true
end
See Also
� LocalPlayer.GetPerson
Person.IsValid
Brief
Returns whether the handle to the person is valid or not.
Definition
boolean Person.IsValid( Person person )
Arguments
person - The person to query.
Return Values
Returns whether the handle to the person is valid or not.
Description
Returns whether the handle to the person is valid or not. Invalid persons can be caused if the person leaves the scene while you still have a
handle to that person.
Examples
if Person.IsValid( randomPerson ) == false then
person = GetAnotherPerson()
| end
See Also
� Person.Findlnlnstance
� Person. IsLoaded
Person.IsVisible
Brief
Return whether the person is visible or not to the user.
Definition
boolean Person.IsVisible( Person person )
Arguments
None
Return Values
Return whether the person is visible or not
Description
If a user can see a Person in game this will return true, otherwise false. No lock is required since you are only querying the value.
Examples
Person.SetVisibile( person, true );
print( Person.IsVisible( person ) );
See Also
� Person.Lock
� Person.Unlock
Person.Lock
Brief
Locks a combination of the person's animation, collision state, transform, label or chatbubbles so it can be controlled by script rather than network
messages or pad input.
Definition
boolean Person.Lock( Person person, number lockType = nil )
Arguments
person - the person to query.lockType - Can be one of the following or nil:
PersonLockType. Animation
PersonLockType.Transform
PersonLockType.Collision
PersonLockType. Visibility
PersonLockType. Label
PersonLockType.ChatBubbles
PersonLockType. EmoteMenu
PersonLockType. Wardrobe
PersonLockType.Default = PersonLockType.Animation + PersonLockType.Transform + PersonLockType.Collision + PersonLockType.Visibility
PersonLockType.All - all the lock types together
If lockType is nil then PersonLockType.Default is used.
Return Values
True if the Lua environment was able to obtain the lock (or already has the lock) on the person, otherwise false.
Description
A Lua error is generated if the lockType passed in aren't one of the possible values above. Lua errors are also generated if
PersonLockType.Label or PersonLockType.ChatBubbles is used when not in a minigame which supports it. A lock can only be obtained for
people currently joined to the active game, and will be released automatically for all people when the local player quits the game. A script should
not rely on this automatic behaviour however, and locks should be explicitly released as soon as they are no longer required. *NB To prevent a
delay in character loading causing scripts to fail, always ensure that calls to Person.Lock() return true before using any functions which require a
locked character. If the function returns false, wait for a short period and then attempt to lock the character again. This can be performed in a
co-routine if necessary. 1.55 Added PersonLockType.Wardrobe. This lock type can only be used on the Local Player person, otherwise a Lua
error is thrown.
Examples
� Example 1, locking specific types.
Person.Lock( person, PersonLockType.Transform ) � Locked the transform
Person.Lock( person, PersonLockType.Collision ) � Unlocked the transform and now locked the collision
Person.Lock( person, PersonLockType.Collision + PersonLockType.Visibility ) � Now additionally locked
the visibility
� Example 2, locking transform, collision, animation and visibility,
if Person.Lock ( person ) then
Person.DoAction( person, "clap" )
end
See Also
� Person.Unlock
� Person.IsLocked
� Person.HasLock
� Person.DoAction
� Person.SetBehavior
Person.ResetCurrentStatusText
Brief
Reset the status text to show in the over-head person label.
Definition
| Person.ResetCurrentStatusText( Person person )
Arguments
person - The person to update.
Return Values
None.
Description
Reset the status text to show in the over-head person label.
Examples
me = LocalPlayer.GetPerson()
j Person.ResetCurrentStatusText( me )
See Also
� LocalPlayer.GetPerson
Person.SetAnimReg
Brief
Sets the value of the specified animation register for the specified person.
Definition
! Person.SetAnimReg(Person person, string registerName, number|boolean|string value)
Arguments
person - person to set the animation register for.registerName - the name of the animation register to set.value - the value to set the register (the
type should agree with the register type).
Return Values
None.
Description
If the register doesn't exist or does not have Lua write access, or the value type and the register type don't match, then an error will be thrown.
Examples
person:SetAnimReg("myReg", 0.3)
See Also
� Person. GetAnimReg
Person.SetBehavior
Brief
Sets the current behavior of the person
Definition
Person.SetBehavior( Person person, string behaviorName, number unlockPeriodSeconds = 0, boolean
snapAnimation = false )
Person.SetBehavior( Person person, string behaviorName, number unlockPeriodSeconds, boolean
snapAnimation, number unlockFeatures )
Arguments
person - The Person to set the behavior onbehaviorName - The name of the behavior.unlockPeriodSeconds - if great than 0 then the animation
lock on the person is automatically released after
the period specified has elapsed. Defaults to 0.snapAnimation - if true, then removes blend from previous action/behavior (defaults
false)unlockFeatures - only used if the unlockPeriodSeconds parameter is greater than 0. If omitted then defaults to releasing the locks that were
set when
Person.SetBehavior was called, otherwise will only release the locks specified.
Return Values
Error code. BehaviorError.None if everything was fine, BehaviorError.Invalid if the behavior cannot be set, BehaviorError.NotReady if the person
is not ready for setting the behavior
Description
The following behaviors Home behaviors are available for use:
sitjow
sit_mid
sit_high
sit_low_recline
sit_mid_recline
standing
Additionally, any behaviors defined by the developer within an objects repertoire are available for use by the developer. The animation must be
locked by the calling lua environment otherwise a lua error is generated. If the behavior specified isn't recognised, then a lua error is thrown.
Examples
if Person.HasLock ( person ) == true then
Person.SetBehavior( person, "sit_mid" )
end
See Also
� Person.Lock
� Person.Unlock
� Person. IsLocked
Person.HasLock
� Person.DoAction
Person.SetCurrentStatusText
Brief
Set the status text to show in the over-head person label.
Definition
Person.SetCurrentStatusText( Person person, string text, bool persist = false )
Arguments
person - The person to update.text - The status text to show in the over-head person label.persist - boolean which determines whether the text is
displayed in picture captures.
Return Values
None.
Description
Set the status text to show in the over-head person label. The status text is used to indicate an activity that the user is currently partaking in. This
function must not be used without first obtaining permission from your RHQ.
Examples
! me = LocalPlayer.GetPerson()
i Person.SetCurrentStatusText( me,
"Racing!" )
See Also
None
Person.SetLabelText
Brief
Change the current text label displayed atop the avatar.
Definition
Person.SetLabelText( Person person, enumeration setting )
Arguments
setting - the current setting to use for player labels.
PersonLabelText.On
PersonLabelText.Off
PersonLabelText.Name
Return Values
None.
Description
With this function, a script can set the labels above a person to show full labels, just the name, or even switch them off. Please note: In order to
use this function, the is_allowed_label_change property in the object's mini_game component must be set to true.
Examples
local person = LocalPlayer.GetPerson( );
if ( Person.Lock( person, PersonLockType.Label ) == true ) then
Person.SetLabelText( person, PersonLabelText.Off );
end
See Also
� Person.Lock
� Person.Unlock
Person.SetPosition
Brief
Sets the position of the the person, assuming the calling Lua environment owns the lock (with transformation attribute)
Definition
SetPosition( Person person, Vector4 position )
Arguments
position - the desired world position of the person
Return Values
None.
Description
The transform must be locked by the calling lua environment otherwise a lua error is generated.
Examples
! Person.SetPosition( person, pos )
See Also
� Person.Lock
� Person.Unlock
Person.SetRotationY
Brief
Sets the rotation in the (world) Y axis of the person.
Definition
Person.SetRotationY( Person person, number angle)
Arguments
person - The Person to set.angle - The world angle in degrees.
Return Values
None.
Description
The transform must be locked by the calling lua environment otherwise a lua error is generated.
Examples
I Person.SetRotationY( person, 180 )
See Also
� Person.Lock
� Person.Unlock
Person.SetVisible
Brief
Sets the visibility of the the person.
Definition
! Person.SetVisible( Person person, boolean enable )
Arguments
enable - whether to switch visibility on or off for that person
Return Values
None.
Description
Sets the visibility of the the person. The visibility must be locked with visibility attribute PersonLockType.Visibility by the calling lua environment
otherwise a lua error is generated. If the person is not valid the call is ignored.
Examples
I Person.SetVisible( person, false )
See Also
� Person.Lock
� Person.Unlock
� Person.IsLocked
� Person.HasLock
Person.Unlock
Brief
Unlocks the features specified on the person. If all features are unlocked, then lock is released, allowing other Lua environments to get a lock.
Definition
Arguments
person - the Person to unlock.unlockFlags - the features to unlock. If 0 is passed in will return false.
Return Values
A true return value only indicates that the features requested to be unlocked were unlocked, which may mean that other features are still locked
and that the person is not yet free to be locked by another calling environment - Use if (Person.HasLock(person, PersonLockType.AII )==false)
to verify if lock has been released on the person. 'Return value behaviour has changed for 1.45 - see history for previous behaviour.
Description
If all features are unlocked, it then allows other lua environments to lock the person. The features are:
PersonLockType. Animation
PersonLockType.Transform
PersonLockType.Collision
PersonLockType. Visibility
PersonLockType. Label
PersonLockType.ChatBubbles
PersonLockType. EmoteMenu
PersonLockType.Default = PersonLockType.Animation + PersonLockType.Transform + PersonLockType.Collision + PersonLockType.Visibility
PersonLockType.AII - all the lock types together
Examples
Person.Unlock( person , PersonLockType.Animation + PersonLockType.Transform )
See Also
� Person.Lock
� Person.IsLocked
� Person.HasLock
� Person.DoAction
� Person.SetBehavior