pebxcvi's picture
update
ee7329c
Raw
History Blame Contribute Delete
5.94 kB
1.72 Rewards .625
1.72.1 Rewards.AddTicket .625
1.72.2 Rewards.CollectTicket .626
1.72.3 Rewards.DoesFlaveTicket .627
1.72.4 Rewards.GetCurrentFocusObjectld .627
1.72.5 Rewards.GetCurrentFocusState .628
Rewards
Rewards. AddTicket
Brief
Adds a reward ticket corresponding to the specified object ID to the list of tickets awaiting collection by the user.
Definition
! boolean Rewards.AddTicket( string objectld, string callBackString = nil )
Arguments
objectld string - The ObjectID for which the ticket is allocated.callBackString - The optional call back string to run once the ticket has been
processed.
Return Values
False if immediately failed to add the ticket, such as it being in the inventory already and true if
successfully added. It may fail later though.
Description
This function assigns a reward ticket to a player which can award an object to a player instantly or can be used to collect a reward at a later point.
The type of ticket given is determined by the entitlementjd fields in the object's metadata (edited using the FIDK's Object Editor application).
These are set per region and can be either AUTOMATIC_REWARD (instantly awarded), or LUA_REWARD (awarded using
Rewards.CollectTicketO). If a callback is specified you can use Rewards.GetCurrentFocusObjectld and Rewards.GetCurrentFocusState inside
the callback to check the result.
The PS Flome client must be run in online mode in order for this function to work.
Examples
Rewards.AddTicket( "12345678-12345678-12345678-12345678" )
See Also
� Rewards.DoesFlaveTicket
� Rewards.CollectTicket
Rewards.CollectTicket
Brief
Attempts to collect a reward ticket that must have been previously added to the user's reward ticket list.
Definition
boolean Rewards.CollectTicket( string objectld, string param, string callBackString = nil )
Arguments
objectld - The object ID of the object to collect as a reward.param - Reserved for future use.callBackString - Optional lua string thats run once the
ticket has been collected or an error occurs in collection.
Return Values
true if call succeeds, or false if there is no ticket to collect.
Description
This function asks the PS Flome Reward System to attempt to collect the reward ticket corresponding to the specified object ID. This will add the
object to the user's permanent inventory. Note that PS Flome must first retrieve data regarding the object from its content servers to verify that the
item can be added, and so it is likely that the object will not appear in the user's inventory immediately. There are many conditions (such as the
object not having been set to be rewarded through Lua script) that can mean the object is not actually added to the inventory. A return value of
true from this function only indicates that the initial call was successful, it does not indicate that the user now owns the item. This can be verified
by querying LocalPlayer.lsInlnventory on successive frames. The PS Flome client must be run in online mode in order for this function to work.
Examples
Rewards.CollectTicket( "12345678-12345678-12345678-12345678" )
See Also
Rewards. DoesHaveTicket
� Rewards.AddTicket
Rewards. DoesHaveTicket
Brief
Checks whether a Reward Ticket for the specified ObjectID is currently awaiting collection.
Definition
boolean Rewards.DoesHaveTicket( string objectld )
Arguments
objectld - The object ID to check for.
Return Values
true if the reward ticket for the specified object ID is currently in the list awaiting collection.
Description
This function is used to determine when the user has been awarded a reward ticket but has not yet collected it. For example, an external title may
award the ticket using a REWARDS.XML written to the PLAYSTATION3's hard drive, based on a certain condition within the external title. The
title's developer could then develop a LUA script for PS Plome, that checks if the reward ticket has been awarded, then shows appropriate
feedback to the user before collecting the reward ticket. The PS Plome client must be run in online mode in order for this function to work.
Examples
rewardObjld = "12345678-12345678-12345678-12345678"
if ( Rewards.DoesHaveTicket( rewardObjld ) ) then
print("I have that ticket!")
end
See Also
� Rewards.AddTicket
� Rewards.CollectTicket
Rewards.GetCurrentFocusObjectld
Brief
Returns the object ID for the callback being called.
Definition
string Rewards.GetCurrentFocusObjectId()
Arguments
None
Return Values
The object ID in focus.
Description
Returns the object ID for the callback being called. Only valid when inside a callback. The PS Home client must be run in online mode in order for
this function to work.
Examples
function RewardCallBack()
local id = Rewards.GetCurrentFocusObjectId()
if id == g_laserGun then
local state = Rewards.GetCurrentFocusState ()
if state == 'collected* or state == 'added' then
ShowLaserMessageBox()
else
ShowNoLaserForYouError()
end
end
end
See Also
� Rewards.CollectTicket
� Rewards.GetCurrentFocusState
Rewards.GetCurrentFocusState
Brief
Returns the state for the callback being called.
Definition
string Rewards.GetCurrentFocusState ()
Arguments
None
Return Values
The state of callback in focus.
Description
Returns the state for the callback being called. Only valid when inside a callback. States returned are:
"collected" - The ticket has been collected.
"added" - The ticket has been added and ready for collection.
"noinfo" - There is no reward information for the object.
"failed" - A general error occurred.
"failed_automatic" - The collection failed as the reward is automaticly collected.
The PS Home client must be run in online mode in order for this function to work.
Examples
function RewardCallBack()
local id = Rewards.GetCurrentFocusObjectld()
if id == g_laserGun then
local state = Rewards.GetCurrentFocusState ()
if state == 'collected* or state == 'added' then
ShowLaserMessageBox()
else
ShowNoLaserForYouError()
end
end
end
See Also
� Rewards.GetCurrentFocusObjectld