View Single Post
01/15/17, 04:26 PM   #5
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 409
You don't need the eventcode in the function declaration, technically. I prefer to add it, because some events do pass useful stuff, and it makes it a bit clearer that it's an event function, but you don't need it.

So, since I realized I wasn't too clear on how the 'overloading' works:

local function abc(first, second, third, fourth)
end

If you pass no parameters, then in abc, first, through fourth will be nil. Passing just one will mean that second, third, and fourth are nil. You could also do abc(nil, 1, nil, 2) meaning first and third are nil. You'll probably see eventually in the eso API that there's some parameters labelled nilable. That means that it can be nil.

I highly suggest reading some lua tutorials. Lua has quite a few things that are different, that can trip people up, not least of which is function placement.
  Reply With Quote