Go to Page... |
Compatibility: | Live (1.0) |
Updated: | 04/27/14 11:24 PM |
Created: | 04/27/14 11:24 PM |
Monthly downloads: | 32 |
Total downloads: | 1,590 |
Favorites: | 2 |
MD5: |
## DependsOn: EPA
![]() |
Comment Options |
Minceraft |
View Public Profile |
Send a private message to Minceraft |
Send email to Minceraft |
Find More Posts by Minceraft |
Add Minceraft to Your Buddy List |
![]() |
|
Forum posts: 6
File comments: 2
Uploads: 0
|
Nice work. I try to keep my own work solid, but feeling doubious about other people's perhaps well meaning but potentially bad, maybe poorly written AddOns. Maybe your Addon can be used to catch problem ones.
For me I just make everything local by default and just let the game's error handling (an extension of Lua's error and panic handlers) tell me when there is a problem (when it can't find a reference). I see a lot of people use the common Lua OOP'like pattern making their Addon modular by putting it in a table as such: Lua Code:
Plus there is a performance advantage as well because Lua will access locals by index vs a key/hash label (see the debug library for more on this). I miss the package/module setup too. They unfortunately nil those libs out on load. Along with "require()" too probably just to block the external DLL loading facility. It's too bad they don't just hack those things out of it (that allow external access) and leave in the rest. Note the particular flavor of Lua they are using is Havok Script. It has some neat things like it's built in performance "struct" data structure libs, etc., that ESO doesn't use, also nil'ed out. Maybe they wanted the unparalleled integrated Lua development environment (with Visual Studio plugin(s), etc). Havok Script is hyped at "2x faster..", but clearly LuaJit would leave it in the dust! Now If you look at the game's internal Lua files (google for an unpacker for "data000.dat") you see they generally use a pretty basic (not big on OOP stuff) Lua model for their internal development. Although they have a ton of built in client binds (with class like setups with metatables, etc.) too. There are some Lua module/require replacements FYI, but I'm too lazy/busy at the moment to track the URLs down. I found this good read here on the subject (from that other, unmentionable evil empire, game): http://www.wowwiki.com/Lua_variable_scoping Note a good trick to limit the scope (but things still need to be declared "local"), also to setup a garbage clean for a bunch of init stuff, and maybe help if you ever hit the limit of file scope locals, etc., is to use "do end blocks". Example: Lua Code:
A read on it: http://www.ludicroussoftware.com/blo...sposable-code/ EDIT: Opps yea you can't make table functions local like that. I removed that part. Also I found making your AddOn (see my "MyAddOn" example above) local can cause a problem in some cases.
Last edited by SpecialK : 04/30/14 at 12:17 AM.
|
![]() |
![]() |
SpecialK |
View Public Profile |
Send a private message to SpecialK |
Send email to SpecialK |
Find More Posts by SpecialK |
Add SpecialK to Your Buddy List |
LilBudyWizer |
View Public Profile |
Send a private message to LilBudyWizer |
Send email to LilBudyWizer |
Find More Posts by LilBudyWizer |
Add LilBudyWizer to Your Buddy List |
SinusPi |
View Public Profile |
Send a private message to SinusPi |
Send email to SinusPi |
Find More Posts by SinusPi |
Add SinusPi to Your Buddy List |
![]() |