LibRPC Fa: Difference between revisions
(Created page with "<poem style="border: 2px solid #d6d2c5; background-color: #f2f4e6; padding: 1em;"> This function was added in LibRPC (API 1.3) (not released as on writing this page) and will not work on previous versions. </poem> {{Welcome|desc=This will return a userdata which can be passed either to the first order parameter or any of the second order parameters of functions F, Fa, RFC and RFCa.| params=<syntaxhighlight>[string]funcname or [userdata]</syntaxhighlight> <poem> ::funcnam...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
</poem> | </poem> | ||
{{Welcome|desc=This will return a userdata which can be passed either to the first order parameter or any of the second order parameters of functions F, Fa, RFC and RFCa.| | {{Welcome|desc=This will return a userdata which can be passed either to the first order parameter or any of the second order parameters of functions F, Fa, RFC and RFCa.| | ||
params=<syntaxhighlight>[string]funcname or [userdata]</syntaxhighlight> | params=<source lang="lua">(funcname or [userdata])(t, a, b, ... )</source> | ||
First Order<syntaxhighlight>[string]funcname or [userdata]</syntaxhighlight> | |||
<poem> | <poem> | ||
::funcname : The name of a function of the npcscript or userdata returned by F or Fa. | ::funcname : The name of a function of the npcscript or userdata returned by another F or Fa. | ||
SecondOrder<source lang="lua">( t, a, b, c,... )</source> | |||
retvals=The function returns userdata. | ::t : The table, class or class instance which will be passed as environment. | ||
::a, b,... : The parameters of the function. | |||
</poem>| | |||
retvals=The function returns userdata when called as in example. | |||
| | | | ||
relfuncs=*[[LibRPC_RFC|RFC]] | relfuncs=*[[LibRPC_RFC|RFC]] |
Latest revision as of 09:51, 25 June 2023
This function was added in LibRPC (API 1.3) (not released as on writing this page) and will not work on previous versions.
Description:
This will return a userdata which can be passed either to the first order parameter or any of the second order parameters of functions F, Fa, RFC and RFCa.
Parameters:
(funcname or [userdata])(t, a, b, ... )
First Order
[string]funcname or [userdata]
funcname : The name of a function of the npcscript or userdata returned by another F or Fa.
( t, a, b, c,... )
t : The table, class or class instance which will be passed as environment.
a, b,... : The parameters of the function.
Return Values:
The function returns userdata when called as in example.
Related Functions
The following functions may be helpful as they relate to this function in one way or another.
Parameter types supported of the returned closure are:
Numbers/Integers | |
Float | |
String | |
bool | true/false |
Null | null |
Vector | Vector(x,y,z) |
Quaternion | Quaternion(x,y,z,w) |
Userdata returned by F (Function) | F("print")(500) See F |
Array |
The following parameter types are not supported:
Blob |
Class Instances other than Vector or Quaternion |