RFC: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
m (Habi moved page F to RFC without leaving a redirect)
No edit summary
Line 3: Line 3:
</poem>
</poem>
{{Welcome|
{{Welcome|
desc=Call a function of npcscript from server.|
desc=Calling RFC will returns function which can be used to call remote functions of npcscripts( i.e. functions in npcscripts: StartRecordingPlayback, SendDeathInfo, .. ) when called with their parameters. Note that a single call to RFC(..) will return function and a double call RFC(..)(param1, param2, .. ) where param1, param2 are parameters of remote function only will call the remote function.|
params=<syntaxhighlight lang="lua">(npcid, [string]funcname)</syntaxhighlight>
params=<syntaxhighlight lang="lua">(npcid, [string]funcname)</syntaxhighlight>
<poem>::npcid : The ID of the target npc on whose environment the function will be searched.
<poem>::npcid : The ID of the target npc on whose environment the function will be searched.
::funcname : The name of the remote function</poem>|
::funcname : The name of the remote function</poem>|
retvals= This will return a function object which can be used as if it is the remote function itself.(except of return values)|
}}
}}

Revision as of 18:38, 23 January 2023

This function was added in v1.6 beta and will not work on previous versions.


Description:
Calling RFC will returns function which can be used to call remote functions of npcscripts( i.e. functions in npcscripts: StartRecordingPlayback, SendDeathInfo, .. ) when called with their parameters. Note that a single call to RFC(..) will return function and a double call RFC(..)(param1, param2, .. ) where param1, param2 are parameters of remote function only will call the remote function.


Parameters:

(npcid, [string]funcname)

npcid : The ID of the target npc on whose environment the function will be searched.
funcname : The name of the remote function


Return Values:
This will return a function object which can be used as if it is the remote function itself.(except of return values)