|
| 20 Apr 2017 04:44 AM |
It's really weird and you can only find it by disassembling ROBLOX. It's only used in a few C-side parts of ROBLOX's Lua. It's fired whenever you use the : operator to call a method on a userdata (or on a table, but only if that method doesn't exist).
Its arguments are: self (table/userdata), the arguments of the call, and the method name (string)
Example:
local obj = newproxy(true)
getmetatable(obj).__namecall = function(...) local args = {...} print(args[1]) --the obj userdata print(args[2]) --the 1st arg of the call print(args[3]) --the 2nd arg of the call print(args[#args]) --the method name return 5 --value that the call returns end
obj:test(1,2,3) obj:asdf(true,"hi",math.pi) local five = obj:thing() print(five)
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 04:47 AM |
for clarity: I wrote that on the spot and didn't notice, but the 3rd arg in those test calls won't get printed (because args[1] is self)
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 04:52 AM |
"or on a table" Not on a table. Similar to __len, it only works on userdata. I just tested this, it does exist and it's pretty cool.
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 04:53 AM |
my bad, thanks for the correction
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 04:58 AM |
Did you mention it to wiki staff? They might want to add this.
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 05:05 AM |
I feel like it's not meant to be documented. They just recently added some really strong security checks to the VM and certain functions like luaD_precall, and I *think* this is related to those specific changes. It's just some weird internal stuff that you can basically just use __index for anyway
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 05:06 AM |
"I feel like it's not meant to be documented. They just recently added some really strong security checks ..." Also known as forbidden knowledge?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Apr 2017 05:09 AM |
How about I link them to this thread and let them decide?
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 05:09 AM |
Cool!
Worship bait!1!1!11111!!!!!1 |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 05:10 AM |
I don't have any contact with wiki writers, admins, etc this is something that I've given up on entirely so many people get into things like RBXDev easy, but I don't
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 05:36 AM |
nvm I thought you were asking me to link them
|
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 20 Apr 2017 06:32 AM |
| That's sweet, thanks for letting us know! |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 06:20 PM |
np I hope more people see it
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Apr 2017 06:34 PM |
| Maybe it's undocumented because it's new 🤔 |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2017 07:10 PM |
cnkillme you're the biggest critic on earth, why can't you just see a post and enjoy it for once
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
| |
|
| |
|
|
| 21 Apr 2017 02:46 AM |
I want more people to see this!
|
|
|
| Report Abuse |
|
|
|
| 21 Apr 2017 02:53 AM |
| LOL, I actually seen this like 2 days ago because I accidently didnt put an argument for my function and it printed an error in Output talking about __namecall, but I didn't know dip about it. |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2017 05:14 AM |
I tried and couldn't get that error, I'm interested what did it say? :p
|
|
|
| Report Abuse |
|
|
Wasteds
|
  |
| Joined: 10 Jul 2014 |
| Total Posts: 615 |
|
| |
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 21 Apr 2017 06:50 AM |
| If I may ask, how or where did you find out about this? |
|
|
| Report Abuse |
|
|
| |
|