Difference between revisions of "NCScriptsObjectEventHandling"
Line 34: | Line 34: | ||
<p style="width: 60%;margin: 0 auto">Example</p> | <p style="width: 60%;margin: 0 auto">Example</p> | ||
<div style="width:60%;margin: 0 auto"> | <div style="width:60%;margin: 0 auto"> | ||
− | + | function CharacterListRequestResult(characterlist) | |
+ | if(characterlist) then | ||
+ | for k,v in pairs(table_name) do | ||
+ | print(k,v) | ||
+ | end | ||
+ | end | ||
+ | end | ||
+ | RegisterEventHandler(EventType.CharacterListRequestResult, "request", CharacterListRequestResult) | ||
</div> | </div> | ||
Revision as of 19:39, 25 November 2019
Event Handler & Examples
Arrived Paramsbool - true if mobile arrives successfully at the end location |
Fires on a mobile when he arrives or fails to arrive at his path or move end point. |
Example
function OnPatrolArrived(arriveSuccess) if( AI.StateMachine.CurState ~= "Patrol" ) then -- ignore this message if we are no longer patrolling return end -- TODO: Handle the case where he fails to path properly -- for now we just move on to the next point in the patrol if not(arriveSuccess) then end DoPatrol() end RegisterEventHandler(EventType.Arrived, "patrol", OnPatrolArrived)
CharacterListRequestResult Paramseventid - event identifier passed to the character list request Returns table - list of character name and associated character id |
This message fires when a character list request either succeeds or fails. |
Example
function CharacterListRequestResult(characterlist) if(characterlist) then for k,v in pairs(table_name) do
print(k,v)
end end end RegisterEventHandler(EventType.CharacterListRequestResult, "request", CharacterListRequestResult)
ClientObjectCommand Params(...) If arguments are specified, they are sent in a parameterized list of strings |
Fires on an object specified by the client with the client supplied data. Object messages are ways to execute script directly on specified object from the client. See the client specific reference NEED REF to see which commands the client can send. EventIdentifier:. |
Example
CODE BLOCK
ClientTargetAnyObjResponse ParamsEventId - specified when RequestClientTargetAnyObj(...) is called |
This is a response from the client from the RequestClientTargetAnyObj(...) function. Gameobject - object user selected, nil if user cancelled |
Example
CODE BLOCK
ClientTargetGameObjResponse |
. |
Example
CODE BLOCK
ContextMenuResponse |
. |
Example
CODE BLOCK
CreatedObject |
. |
Example
CODE BLOCK
DestroyAllComplete |
. |
Example
CODE BLOCK
DestroyedObject |
. |
Example
CODE BLOCK
DynamicWindowResponse |
. |
Example
CODE BLOCK
EnterView |
. |
Example
CODE BLOCK
GetBanListResult |
. |
Example
CODE BLOCK
GlobalVarUpdateResult |
. |
Example
CODE BLOCK
ItemEquipped |
. |
Example
CODE BLOCK
ItemUnEquipped |
. |
Example
CODE BLOCK
LoadedFromBackup |
. |
Example
CODE BLOCK
LeaveView |
. |
Example
CODE BLOCK
CreatedObject |
. |
Example
CODE BLOCK
ModuleAttached |
. |
Example
CODE BLOCK
PathingInterrupted |
. |
Example
CODE BLOCK
PlayerSpeech |
. |
Example
CODE BLOCK
RequestEquip |
. |
Example
CODE BLOCK
RequestPickUp |
. |
Example
CODE BLOCK
StartMoving |
. |
Example
CODE BLOCK
StopMoving |
. |
Example
CODE BLOCK
Timer |
. |
Example
CODE BLOCK
Use |
. |
Example
CODE BLOCK
UserLogin |
. |
Example
CODE BLOCK
UserLogout |
. |
Example
CODE BLOCK