pebxcvi's picture
update
ee7329c
Raw
History Blame Contribute Delete
24.6 kB
1.39 LocalPlayer .313
1.39.1 LocalPlayer.AddRepertoire .313
1.39.2 LocalPlayer.AddToPlayersMetList.314
1.39.3 LocalPlayer.DebugRemovePortable .314
1.39.4 LocalPlayer.DebugSetPortable .315
1.39.5 LocalPlayer.DoAction .315
1.39.6 LocalPlayer.EnableAutoFliding .316
1.39.7 LocalPlayer.GetAccountRegion .317
1.39.8 LocalPlayer.GetAccountTerritory .317
1.39.9 LocalPlayer.GetAge .318
1.39.10 LocalPlayer.GetAvatarRig .318
1.39.11 LocalPlayer.GetCurrentLogin .319
1.39.12 LocalPlayer.GetCurrentRegion .320
1.39.13 LocalPlayer.GetFirstLogin .320
1.39.14 LocalPlayer.GetFriendCount .321
1.39.15 LocalPlayer.GetFriends .322
1.39.16 LocalPlayer.GetFlomeAccountld .322
1.39.17 LocalPlayer.GetFlomeRegion .323
1.39.18 LocalPlayer.GetLastLogin .323
1.39.19 LocalPlayer.GetLoginCount.324
1.39.20 LocalPlayer.GetPerson .325
1.39.21 LocalPlayer.GetPersonld .325
1.39.22 LocalPlayer.GetPreviousUserType .326
1.39.23 LocalPlayer.GetUser .326
1.39.24 LocalPlayer.GetUserType .327
1.39.25 LocalPlayer.lsChatAllowed .328
1.39.26 LocalPlayer.lsDoingAction.328
1.39.27 LocalPlayer.lsInWardrobe .329
1.39.28 Local Player. Relocate .329
1.39.29 LocalPlayer.RelocateToGroupInstance .330
1.39.30 LocalPlayer.RelocateToUniquelnstance .331
1.39.31 LocalPlayer.RemoveRepertoire .331
1.39.32 Local Player. RestoreAvatar .332
1.39.33 LocalPlayer.SetAvatarRig .332
1.39.34 LocalPlayer.SetClothingltems .333
1.39.35 LocalPlayer.SetRelocateObject .333
1.39.36 LocalPlayer.SetRigComponentObjectld .334
LocalPlayer
LocalPlayer.AddRepertoire
Brief
Adds the specified repertoire resource from the object provided, to the local player. The action is replicated across the network, so the remote
person will add the repertoire
Definition
Repertoire LocalPlayer.AddRepertoire( string label, number priority )
Arguments
label - the label of the repertoire to add.
priority - the priority over existing repertoires already added. The higher the number, the greater
the priority. The default repertoire is added with a priority of zero.
Return Values
Reference to the repertoire resource that was added, or nil if failed to add.
Description
Examples
! repertoire = LocalPlayer.AddRepertoire( "level1", 0 )
See Also
None
LocalPlayer.AddToPlayersMetList
Brief
Add a player to the XMB Players Met List.
Definition
LocalPlayer.AddToPlayersMetList( string playerName )
Arguments
personld - PSN ID of the player to add.
Return Values
None.
Description
The player won't be added if they're a Friend, or Blocked, or if they're the Local Player. Also, the player won't be added if they're not currently in
the scene. It's advised this function is used sparingly and with care. E.g. if used to add other players in a Mini-game, please limit it to 16.
Examples
LocalPlayer.AddToPlayersMetList("MyPSNId")
See Also
None
LocalPlayer.DebugRemovePortable
Brief
Removes the local player's person's active object.
Definition
LocalPlayer.DebugRemoveActiveObject( string objectld )
Arguments
None
Return Values
None.
Description
Removes the local player's person's active object. For debug purposes only.
Examples
! LocalPlayer.DebugRemoveActiveObject()
See Also
None
LocalPlayer.DebugSetPortable
Brief
Sets the local player's portable.
Definition
j LocalPlayer.DebugSetPortable( string objectld )
Arguments
objectld - The object ID of the portable.
Return Values
None.
Description
Sets the local player's portable. For debug purposes only.
Examples
j LocalPlayer.DebugSetPortable( "00000000-00000000-00000000-00000001" )
See Also
None
LocalPlayer.DoAction
Brief
Makes the local player's avatar perform the specified action.
Definition
LocalPlayer.DoAction( string actionName )
Arguments
actionName - Name of the action to be performed. It can be a custom animation loaded 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"
Return Values
true if the action was recognised, false otherwise.
Description
Makes the local player's avatar perform the specified action.
Examples
LocalPlayer.DoAction( "wave" )
See Also
� LocalPlayer. IsDoingAction
� LocalPlayer.AddRepertoire
LocalPlayer.EnableAutoHiding
Brief
Enable/Disable the automatic hiding of the LocalPlayer's avatar when the camera gets too close.
Definition
! LocalPlayer.EnableAutoHiding( boolean enable )
Arguments
enable - false to turn off auto-hiding, or true to re-enable it.
Return Values
None.
Description
The client automatically hides the avatar when the camera gets too close, for usability and aesthetic reasons. In certain circumstances it may be
advantageous to disable this behavior, such as when creating a first person view.
Examples
! LocalPlayer.EnableAutoHiding(false)
See Also
None
LocalPlayer.GetAccountRegion
Brief
Returns a string representing the PSN account region.
Definition
I string LocalPlayer.GetAccountRegion()
Arguments
None
Return Values
A string representing the PSN account region.
Description
Returns a string representing the PSN account region.
Examples
! if ( LocalPlayer.GetAccountRegion() == "en-GB" ) then
print( "I am British!" )
| end
See Also
� LocalPlayer.GetHomeRegion
� LocalPlayer.GetCurrentRegion
LocalPlayer.GetAccountTerritory
Brief
Returns a string representing the PSN account territory.
Definition
! string LocalPlayer.GetAccountTerritory()
Arguments
None
Return Values
A string representing the PSN account territory.
Description
Returns a string representing the PSN account territory. Can be one of the following:
"SCEE" (Europe)
"SCEA" (North America)
"SCEJ" (Japan)
"SCEAsia" (Rest of Asia)
Examples
| if ( LocalPlayer.GetAccountTerritory() == "SCEE" ) then
print( "I am European!" )
I end
See Also
� LocalPlayer.GetAccountRegion
� System.GetRegionsTerritory
LocalPlayer.GetAge
Brief
Returns the local player's age in years.
Definition
! number LocalPlayer.GetAge()
Arguments
None
Return Values
The local player's age in years.
Description
Returns the local player's age in years. If there are any errors (such as being signed out), this will return -1.
Examples
: print( 'I am ' .. LocalPlayer.GetAge() .. ' year(s) old.' )
See Also
None
LocalPlayer.GetAvatarRig
Brief
Returns the rig type (gender) of the LocalPlayer avatar.
Definition
RigType LocalPlayer.GetAvatarRig()
Arguments
None
Return Values
The rig type of the LocalPlayer avatar, as a number from the enumerated type RigType (see description).
Description
Returns the rig type (gender) of the LocalPlayer avatar, as one of the following values:
RigType.Undefined
RigType.Male
RigType.Female
Examples
if (LocalPlayer.GetAvatarRig() == RigType.Male) then
LocalPlayer.SetRigComponentObjectld(kMaleHatObjectld)
else
LocalPlayer.SetRigComponentObjectld(kFemaleHatObjectld)
end
See Also
� LocalPlayer.SetAvatarRig
LocalPlayer.GetCurrentLogin
Brief
Returns the date of the current login.
Definition
bool LocalPlayer.GetCurrentLogin( Time t )
Arguments
t - a time value to fill in.
Return Values
Returns true if the first session date is set and a valid Time object was provided.
Description
This will return the date/time of the current login. Used to determine how long the user has been online. Note that this value is not guaranteed to
be tamper-proof as it is obtained from the user's hard disk; the value should be sanity-checked, and if its accuracy is critically important, should be
verified with an external source.
Examples
j t = Time.Create()
i if ( LocalPlayer.GetCurrentLogin( t ) )
print( 'Current login is ' .. Time.GetTime( t ) .. )
See Also
� LocalPlayer.GetUserType
� LocalPlayer.GetPreviouslIserType
� LocalPlayer.GetFirstLogin
� LocalPlayer.GetLastLogin
� LocalPlayer.GetLoginCount
� Time.Create
LocalPlayer.GetCurrentRegion
Brief
Returns a string representing the region of the space that the local player is currently in.
Definition
1 string LocalPlayer.GetCurrentRegion()
Arguments
None
Return Values
A string representing the current region the local player is in.
Description
Returns a string representing the region of the space that the local player is currently in. This is one of the PS Home supported regions.
Examples
! if ( LocalPlayer.GetCurrentRegion() == "en-US" ) then
print( "I am in an American space!" )
| end
See Also
� LocalPlayer. GetHomeRegion
� LocalPlayer.GetAccountRegion
LocalPlayer.GetFirstLogin
Brief
Returns the first login date.
Definition
! bool LocalPlayer.GetFirstLogin( Time t )
Arguments
t - a time value to fill in.
Return Values
Returns true if the first session date is set and a valid Time object was provided.
Description
This will return the date/time of the first login. Login tracking was added for the 1.55 release and therefore this date/time will be dated from this
release. Clearing savedata will reset this date. Note that this value is not guaranteed to be tamper-proof as it is obtained from the user's hard disk;
the value should be sanity-checked, and if its accuracy is critically important, should be verified with an external source.
Examples
t = Time.Create()
if ( LocalPlayer.GetFirstLogin( t ) )
print( �First login was � .. Time.GetTime( t ) .. )
See Also
� LocalPlayer.GetUserType
� LocalPlayer.GetPreviousUserType
� LocalPlayer.GetLastLogin
� LocalPlayer.GetCurrentLogin
� LocalPlayer.GetLoginCount
� Time.Create
LocalPlayer.GetFriendCount
Brief
Returns the number of friends.
Definition
! number LocalPlayer.GetFriendCount()
Arguments
None
Return Values
The number of friends.
Description
Returns the number of friends that the local player has.
Examples
! print( �I have � .. LocalPlayer.GetFriendCount() .. � friends.� )
See Also
Local Player.GetFriends
LocalPlayer.GetFriends
Brief
Returns an array of friends as User objects.
Definition
User[] LocalPlayer.GetFriends()
Arguments
None
Return Values
An array of User objects
Description
Returns an array of friends as User objects.
Examples
friends = LocalPlayer.GetFriends()
for index, friend in ipairs ( friends ) do
print( User.GetName( friend ) )
end
See Also
� User.GetName
Local Player.GetHomeAccountld
Brief
Fills in the unique accountld for the player
Definition
! LocalPlayer.GetLoginCount()
Arguments
biglnt - Unique account id to set
Return Values
None.
Description
This 32-bit accountld is allocated by the Flome game servers. It is unique and fixed for each account in the current environment. It will not be valid
when running offline. The primary use for this function is to acquire a unique 32-bit ID that can be used in the RelocateToUniquelnstance function
- allowing you to send the user to a space that is unique to their account.
Examples
local myAccountld = Biglnt.Create (32)
LocalPlayer.GetHomeAccountId( myAccountld )
See Also
None
LocalPlayer.GetHomeRegion
Brief
Returns a string representing the local player's PS Home region.
Definition
string LocalPlayer.GetHomeRegion()
Arguments
None
Return Values
A string representing the PS Home region.
Description
Returns a string representing the local player's PS Home region. The account region is remapped into a supported PS Home region as PS Home
does not support all regions.
Examples
! if ( LocalPlayer.GetHomeRegion() == "en-GB" ) then
print( "My PSN account region is mapped to British in PS Home!" )
| end
See Also
� LocalPlayer.GetHomeRegion
� LocalPlayer. GetCurrentRegion
Local Player.GetLastLogin
Brief
Returns the last login date.
Definition
bool LocalPlayer.GetLastLogin( Time t )
Arguments
t - a time value to fill in.
Return Values
Returns true if the last session date is set and a valid Time object was provided. Note that this
value is not guaranteed to be tamper-proof as it is obtained from the user's hard disk; the value
should be sanity-checked, and if its accuracy is critically important, should be verified with an
external source.
Description
This will return the date/time of the last login.
Examples
t = Time.Create()
if ( LocalPlayer.GetLastLogin( t ) )
print( 'Lost login was ' .. Time.GetTime( t ) .. )
See Also
� LocalPlayer. GetUserType
� LocalPlayer.GetPreviousUserType
� LocalPlayer.GetFirstLogin
� LocalPlayer. GetCurrentLogin
� LocalPlayer.GetLoginCount
� Time.Create
LocalPlayer.GetLoginCount
Brief
Returns the total number of sessions for the user.
Definition
number LocalPlayer.GetLoginCount()
Arguments
None.
Return Values
number - The number of sessions
Description
The total number of previous sessions the user has logged in. A new user will have a value of 0. Login tracking was added for the 1.55 release
and therefore this count will be since this release. Note that this value is not guaranteed to be tamper-proof as it is obtained from the user's hard
disk; the value should be sanity-checked, and if its accuracy is critically important, should be verified with an external source. Clearing savedata
will reset this count.
Examples
print( �Number of logins: ' .. LocalPlayer.GetLoginCount() )
See Also
� LocalPlayer.GetPreviousUserType
� LocalPlayer.GetFirstLogin
� LocalPlayer.GetLastLogin
� LocalPlayer.GetCurrentLogin
LocalPlayer.GetPerson
Brief
Returns the person object of the local player.
Definition
j Person LocalPlayer.GetPerson()
Arguments
None.
Return Values
Returns the person object of the local player.
Description
Returns the person object of the local player.
Examples
! me = LocalPlayer.GetPerson()
See Also
None
LocalPlayer.GetPersonld
Brief
Returns the local player's person ID.
Definition
! string LocalPlayer.GetPersonld()
Arguments
None
Return Values
The local player's person ID.
Description
Returns the local player's person ID. See Person.GetPersonld for more information on person IDs. This will return the same result as
Local Player.GetPerson():Getld().
Examples
print( 'My person ID is ' ... LocalPlayer.GetPersonld() )
See Also
LocalPlayer.GetPreviousUserType
Brief
Returns the user type from the previous login.
Definition
UserType LocalPlayer.GetPreviousUserType()
Arguments
None.
Return Values
One of the following user types
UserType.New - This is a new user
UserType.Returning - An old user who has returned
UserTYpe.Regular - A returning frequent user
UserType.Unknown - An unknown user type
Description
Returns the previous session's user type. This can be used to find out if the user type has just changed.
Examples
if ( LocalPlayer.GetUserType() ~= LocalPlayer.GetPrevousUserType() )
print( 'User type has changed this session' )
See Also
� LocalPlayer.GetUserType
� LocalPlayer.GetFirstLogin
� LocalPlayer.GetLastLogin
� LocalPlayer.GetCurrentLogin
� LocalPlayer.GetLoginCount
LocalPlayer.GetUser
Brief
Returns the user object of the local player.
Definition
User LocalPlayer.GetUser()
Arguments
None
Return Values
Returns the user object of the local player.
Description
Returns the user object of the local player.
Examples
! me = LocalPlayer.GetUser()
See Also
None
LocalPlayer.GetUserType
Brief
Returns the active user type.
Definition
! UserType LocalPlayer.GetUserType ()
Arguments
None.
Return Values
One of the following user types
UserType.New - This is a new user
UserType.Returning - An old user who has returned
UserTYpe.Regular - A returning frequent user
UserType.Unknown - An unknown user type
Description
Returns the current type of user logged in.
Examples
if ( LocalPlayer.GetUserType() == UserType.New )
print ( �New user' )
See Also
Local Player.GetPreviousUserType
� LocalPlayer.GetFirstLogin
� LocalPlayer.GetLastLogin
� LocalPlayer.GetCurrentLogin
� LocalPlayer.GetLoginCount
Local Player.IsChatAllowed
Brief
Returns true if the local player is not allowed to chat.
Definition
j boolean LocalPlayer.IsChatAllowed()
Arguments
None.
Return Values
True if the local player is not allowed to chat, or false otherwise.
Description
If the local player is not allowed to chat, they're unable to send or receive any Text Chat, or use the Voice Comms in any way.
Examples
! if (not LocalPlayer.IsChatAllowed())
DoNormalUpdate()
j end
See Also
None
LocalPlayer.lsDoingAction
Brief
Returns true if the Local Person is currently performing an action.
Definition
! boolean LocalPlayer.IsDoingAction( boolean nonlnterruptable = true )
Arguments
nonlnterruptable - If true, only return true if the current action is not interruptable (defaults to true).
Return Values
Returns true if the Local Person is currently performing an action.
Description
Returns true if the Local Person is currently performing an action. An action is a non repeating animation, such as the action "wave".
Examples
! print( LocalPlayer.IsDoingAction() )
See Also
� Local Player. DoAction
LocalPlayer.lsInWardrobe
Brief
Returns true if the local player is currently located in the wardrobe.
Definition
! boolean LocalPlayer.IsInWardrobe()
Arguments
None.
Return Values
True if the local player is in the wardrobe, or false otherwise.
Description
Returns true if the local player is currently located in the wardrobe.
Examples
! if (not LocalPlayer.IsInWardrobe())
DoNormalUpdate()
| end
See Also
None
LocalPlayer.Relocate
Brief
Relocates the local player to the specified scene.
Definition
LocalPlayer.Relocate( string sceneName, number instanceParam = 0, number valueParam = 0, string
spawnFrom = nil )
Arguments
sceneName - The name of the scene as specified in the scene list.instanceParam - Controls the creation of different instances of the same scene
(Optional - defaults to 0)valueParam - Specifies a value parameter that can be read by a script when the player has relocated to the new scene
(Optional - defaults to -1)spawnFrom - [ Optional ] Specifies the scene name that will be used to choose the spawn location in the destination
scene
Return Values
true if the destination scene name was recognised and the relocation process triggered, false if not
Description
Relocates the local player to the specified scene. Note that the relocation process is asynchronous, the user will continue to be considered
present in the scene and joined to a minigame if applicable until the scene transition occurs. Therefore, expect that your script will continue to
execute for some time after this call until the relocation has occurred. The following fixed scene names are also available:
BasicApartment - Harbour Studio
DEFAULT_APARTMENT - The user's default apartment
Examples
if PlayerHasUnlockedTheDoor() then
LocalPlayer.Relocate( 'Secret_Room' )
end
See Also
� LocalPlayer.SetRelocateObject
LocalPlayer.RelocateToGroupInstance
Brief
Relocates the local player to a group instance of the specified scene.
Definition
LocalPlayer.RelocateToGroupInstance( string sceneName, number valueParam = nil )
Arguments
sceneName - The name of the scene as specified in the scene list.j optional ] valueParam - A number that can be queried by the destination
scene.
Return Values
True if the destination scene name was recognized and the relocation process triggered, false if not.
Description
Relocates the local player to a group instance of the specified scene. Note that the relocation process is asynchronous, the user will continue to
be considered present in the scene and joined to a minigame if applicable until the scene transition occurs. Therefore, expect that your script will
continue to execute for some time after this call until the relocation has occurred.
Examples
See Also
� Local Player. Relocate
� LocalPlayer.RelocateToUniquelnstance
LocalPlayer.RelocateTollniquelnstance
Brief
Relocates the local player a unique instance of the specified scene.
Definition
LocalPlayer.RelocateToUniquelnstance( number instancelD, string sceneName )
Arguments
instancelD - Unique ID number of the scene (1 - 65535)sceneName - The name of the scene as specified in the scene list.[ optional ] valueParam
- A number that can be queried by the destination scene
Return Values
true if the destination scene name was recognised and the relocation process triggered, false if not
Description
Relocates the local player to the specified scene. Note that the relocation process is asynchronous, the user will continue to be considered
present in the scene and joined to a minigame if applicable until the scene transition occurs. Therefore, expect that your script will continue to
execute for some time after this call until the relocation has occurred. RelocateToUniquelnstance differs from the standard Relocate method with
an InstanceParam in 2 ways : 1) There will only ever be one instance of a scene with a particular UID. (If it is full, users will be denied access then
returned to a new instance of their current location) 2) It is handled more efficiently on Home's backend (and hence is the preferred method for
creating custom scene instances)
Examples
if PlayerHasSelectedPrivateSession() then
SessionUID = 500
LocalPlayer.RelocateToUniquelnstance( SessionUID, , Game_Room' )
end
See Also
� Local Player. Relocate
LocalPlayer.RemoveRepertoire
Brief
Removes the specified repertoire (by label) from the player
Definition
Repertoire LocalPlayer.RemoveRepertoire( string label )
Arguments
label - the label of the repertoire to remove.
Return Values
none
Description
Examples
! LocalPlayer.RemoveRepertoire( "levell" )
See Also
None
LocalPlayer.RestoreAvatar
Brief
Returns the avatar (clothing items and rig) to the last user selection made within the wardrobe.
Definition
! LocalPlayer.RestoreAvatar()
Arguments
None
Return Values
None.
Description
This method can only be used if the calling Lua environment has obtained the PersonLockType.Wardrobe lock, otherwise a lua error is thrown.
Examples
! LocalPlayer.RestoreAvatar()
See Also
� LocalPlayer.SetAvatarRig
� LocalPlayer.SetRigComponentObjectld
� Person.Lock
� Person.Unlock
LocalPlayer.SetAvatarRig
Brief
Set the avatar rig type (gender).
Definition
! boolean LocalPlayer.SetAvatarRig(RigType rigType)
Arguments
rigType - The rig type to change to (see description).
Return Values
True if able to change the rig (avatar is fully loaded and ready), otherwise false.
Description
Set the avatar rig type (gender) to one of the following values:
RigType.Male
RigType.Female Note that this function should be used with caution, and only with the user's consent.
Examples
LocalPlayer.SetAvatarRig(RigType.Male)
See Also
� LocalPlayer.GetAvatarRig
� Person.IsLoaded
LocalPlayer.SetClothingltems
Brief
Sets the clothing items on the player in one call
Definition
LocalPlayer.SetClothingltems( args )
Arguments
args - a table that contains the command arguments, the fields recognised are:
components [ table ] - a table of strings, each representing a component for the avatar to equip
Return Values
none
Description
the script must have the lock PersonLockType.Wardrobe, on the LocalPlayer person, before setting clothing items, otherwise a lua error be
thrown.
Examples
local components = {}
table.insert(components, "00000000-00000000-00000000-01010034")
table.insert(components, "00000000-00000000-00000000-01020001")
table.insert(components, "00000000-00000000-00000000-01030009")
local setting = { components = components }
LocalPlayer.SetClothingltems( setting );
See Also
None
LocalPlayer.SetRelocateObject
Brief
Sets the optional objectld that can be used to script the relocation process from one scene to another
Definition
LocalPlayer.SetRelocateObject( string objectld, number mode = 0 )
Arguments
objectld - The Id of the object to usemode - The scripted relocation mode. Default 0 means the relocation script is activated once the download of
the
destination scene has completed.
Mode 1 means the relocate script is started without first confirming the scene download (the scene_transition
object will need to handle the scene download)
Return Values
none
Description
Examples
LocalPlayer.SetRelocateObject( "12345678-12345678-12345678-12345678", 0 )
See Also
� Local Player. Relocate
LocalPlayer.SetRigComponentObjectld
Brief
Sets the rig's component to the specified object.
Definition
LocalPlayer.SetRigComponentObjectld( string objectld, string componentType )
Arguments
objectld - The object ID for the component.componentType - The type of the rig component to set. Can be one of the following:
"Hair�
"Tors"
"Hands"
"Legs"
"Feet"
*NB This param is ignored now (1.35 and later) - works out what the componentType is when the object is loaded...
Return Values
true if successful, else false. (Will fail if the player is not ready, ie has not yet been allocated its memory slot)
Description
Sets the rig's component to the specified object. From 1.55, the script must have the lock PersonLockType.Wardrobe, on the LocalPlayer person,
before setting clothing items, otherwise a lua error be thrown. The call may fail if the avatar is not in a state to accept new clothing components.
Examples
LocalPlayer.SetRigComponentObjectld( jacketObjectId, 'Tors� )
See Also
� Person.Lock