Attn: Mote : Where did UserGlobals disappear to ?
Attn: Mote : Where did UserGlobals disappear to ?
Year, gear equipping fixed.
haruhigumi: My version was renamed as Mote-Globals.lua, while the user can create a version called user-globals.lua. If user-globals.lua exists, it will load that instead. That way it's completely separated from any files you might pull from the repository.
function buff_change(status,gain_or_loss) and if buffactive.xxxxxx not working... my guess till resources get update
I see, Also like how you added something to load a separate gear set (makes it easier for someone updating from say my Rng example), however with this RNG_gear.lua http://pastebin.com/Wc8ctAu6
I'm getting the following error
And this is the main RNG.lua in progress. : http://pastebin.com/mLAgEcUJCode:GearSwap: Loaded your RNG Lua File! GearSwap: Lua error (runtime - ...86)Windower4/addons/GearSwap/Data/Mote-Utility.lua:429: GearSwap: Nothing was returned by the include (RNG_gear.lua). Cannot add it to the user enviroment.
Example code:
Code:local user = {} function user.init_user_gear_sets() add_to_chat(123,'sidecar load') end return user
Also, there's a bug in my auto-selection of gorgets/belts/etc, somewhere. Will have to debug it. For now, you can comment out lines 526-529 of Mote-Include to get around it.
Also appears to be a bug in Mote-Utility.lua:171
When I try to do curing waltz with that refine_waltz function, I get
Attempt to index global 'WaltzTPCost' a nil value.
Hrm course my stuff like U_Shot_Ammo do not appear to be of a larger scope, as such when called from say precast or such, it complains of being a nil value.
Had to add that plus DefaultAmmo into the get_sets in the main file, which in a way sort of defeats the purpose (but not as big a problem since it leaves the bulk of the changes outside of the main).
I also noticed that stuff like
don't work side-carded.Code:sets.Kiting = {feet="Fajin Boots"}
gearswap is giving me refresh.lua.456 attempt to index field '?' (a nil value)
The bug in auto-selection is that day and weather element info is currently broken. As such, only set_spell_obi_cape_ring(spell) (line 526) needs commenting out. Gorget/belt/staff selection should still work.
I'll push a version with it commented out for now.
I'm testing on whm, and it seems to work perfectly fine. You should have a file called rng_gear.lua, and within it have a copy of init_gear_sets, named: user.init_user_gear_sets (assuming you're using the above template).
Oh, I guess I should ask, you rebuilt from the template didn't you? The layout of the functions has changed a bit recently. get_sets() is just a light helper function to make sure the other functions get called properly.
In progress and example are the two files utilizing that method of side-carding.
http://pastebin.com/u/KBeezie
and yes it's rng_gear.lua, I had to move U_Shot_Ammo and Default Ammo into the main file's get_sets() because they weren't being carried over from the rng_gear.lua (As if the scope of it ended there). And when I was only using rng_gear.lua for my gear sets, turning kiting on was not equiping the fajin boots, but if I left the gear sets in the main file instead, it works.
Regarding template, I'd look at it and compare if any function names and such have changed.
Also in regards to your documentation:
As you mentioned there's no example of it in the repository, and the instructions mentions nothing regarding needing to set local user = {} and return user in order to make it not error out. And I'm thinking it's probably a scope issue because with just that and the same thing I had in init_gear_sets() those variables don't all seem to have the scope needed in the functions. ie: Kiting wasn't working, and some of the other variables. Works fine if I just don't do the side loaded file and just keep it in the init_gear_sets() in the main file.Code:Within whm_gear.lua, create a function called init_user_gear_sets(). When first created you can copy everything from the main file's init_gear_sets() function, and then fill in your own actual gear. user_unload() is called when the file is unloaded, if you need any custom unload logic.
In your rng_gear.lua, you have:
function init_user_gear_sets()
which needs to be:
function user.init_user_gear_sets()
Otherwise init_user_gear_sets isn't added to the user table, and so doesn't get returned, and thus doesn't get added to the calling environment, which means nothing you define in it will be retained.
Same for user_unload.
The doc file should have that basic template shown, but I need to add the unload function in there as well.
I may actually not even need a different function name, but use init_gear_sets for both the job.lua and job_gear.lua. By including it, it should overwrite the one in the main file. A quick test seems to work. If it doesn't break anything, I'll probably do that.