PDA

View Full Version : Official Lotro plugin manager


daimon
12-12-2011, 09:02 AM
included in Update 5, 12/12/2012


Lua Plugin Manager
At long last, a manager UI has been added to support all of your Lua plugins!
During character selection, you can open the manager via the “Manage Plugins” button. There you can define which plugins you would like to load automatically each time you log in with the characters selected via a drop-down menu present for each plugin entry. Please note: the character selection list includes both normal characters and monster play characters linked to your account on the given server.
You can also access the manager when in game (logged in) via a start menu entry under the system sub-menu for both normal characters and monster play characters. Here, you will not only be able to change the auto-loading status of your plugins, but you can also immediately load/unload plugins.
The in game plugin manager also introduces support for plugin-defined option panels that can be accessed by hitting the “Options” tab when a plugin is selected. What these options do for a given plugin is completely defined by the plugin authors. If a given plugin has not defined an options panel, then the tab will be disabled.http://lorebook.lotro.com/wiki/Update_5,_Armies_of_Isengard,_Official

unclecid
12-12-2011, 11:04 AM
just saw this in the update notes.

must say i am excited, surprised and impressed.

:D

daimon
12-12-2011, 12:13 PM
And it's working like a charm :)

Eili
12-12-2011, 12:24 PM
Unfortunatly it does not

I use Bevy to have simple bars hiding out of combat and showing in combat.

The new manager load Bevy and the configuration but empty everything.

I tried all i can, but the bars remains empty after each log off.

I took the time to make a new configuration that was wiped too by the new manager.

it does not keep at least for Bevy the setup of the bars (i mean what you put in slots)

daimon
12-12-2011, 12:45 PM
Yes, same thing seems to happen with Baruk bars

daimon
12-12-2011, 12:54 PM
This might not be loader related bug, it might be a wider problem. Anyone who has tried the game with the old method and does their quickslot plugins bug too ?

Baruk seems to loose at least items that are in quickslots. However porting skills and mounts are working as intended

Stever1388
12-12-2011, 01:11 PM
Seems items from your bag that are in quickslots disappear when loading using the LOTRO Plugin Manager, but if you load the plugin manually after you log in, then the items will remain in place. Skills don't seem to suffer from this problem. I believe this is probably due to the invalid shortcut error you get when you try and set a quickslot to a inventory item that no longer is in your inventory. When you initially run out of the item the quickslot turns grey like normal quickslots do, but if you unload and then reload the plugin without getting any more of that item, then instead of it coming back in grey, it just gets removed from the quickslot.

Also, the Travel plugin by D.H1cks doesn't seem to load when using the LOTRO Plugin Manager, I get some "Rings Online\Plugins\Turbine\UI\Lotro\Quickslot.lua:11: Invalid shortcut for quickslot specified." error. All the other plugins I use so far seem to be working ok.

If I load Bootstrap using the LOTRO Plugin Manager to have Bootstrap load everything else I get the same errors, but if I load Bootstrap after I'm logged in it works just like it did before Update 5.

D.H1cks
12-12-2011, 01:13 PM
My PagedSlots plugin 'appears' to have kept its items, but its been so long since I logged in a toon that used it I don't know if anything dropped.

But I do have some food items that stayed.

As for the Travel Window, that should be fixed with the 9.3 version. Please let me know if it is not.

Edit: Hmmm, seems paged slots is having some other issues though.....

Edit 2: Travel Window still fails when logging in, but works when loaded manually. But, it only appears to be failing on the character that has the Glan Vraig Map. It could be related.

Eili
12-12-2011, 01:38 PM
In fact the first time you load with Lotro manager everything is fine.

Then if you start using the plugins, or log off to alt and come back everything is bugged.

/me very happy i made a save of my complete folder before the patch.
I am simply not using it until Turbine works.

Bootstrap for the win :)

Stever1388
12-12-2011, 08:02 PM
Whether there are other problems with the loading of plugins beyond the problems seen from BevyBars, Baruk, TonicBars, etc, I don't know since I haven't tested it that much, but I'm pretty sure the problem with the bars plugins (and Travel when the Glan Vraig map is used) is that the plugins are loaded before the actual backpack is accessible (or loaded). You can test this by with this code:

import "Turbine";

player = Turbine.Gameplay.LocalPlayer.GetInstance();
backpack = player:GetBackpack();
backpack.ItemAdded = function(sender, args)
Turbine.Shell.WriteLine("Item added to Backpack.");
end

You will see when you finish logging in that there's a bunch of "Item added to Backpack" in your Standard chat channel, showing that the items are added after the plugin is loaded. Whenever a plugin attempts to create a Shortcut using the Data and Type fields from an item that is no longer in your backpack, an error is thrown. There seem to be a few very rare exceptions to this though, the one I know of is store bought Champion Fervour potions that I used up but still show up (greyed out though like it should) in BevyBars. Health potions, food, battle/warding scrolls, etc will all be removed from your bars if you run out of them and unload/reload your plugin, which can be a pain since you then need to set up those bars again. I know BevyBars uses the PCall function to check whether the QuickSlot:SetShortcut() method will throw an error. Then when the plugin saves it saves those slots as clear.

The best way I can see around this problem is that when a quickslot's shortcut returns an error, the quickslot is flagged, possibly changing the way the quickslot looks to the user (that way they know something should go there but they are currently out of it). Then when whenever a ItemAdded event is fired, go through all the quickslots that are flagged and see if any are updated. That way when loading through the LOTRO Plugin Manager, the quickslots will initially be empty but as the backpack is loaded in the slots should be fixed. This would also have the added benefit that whenever you run out of health pots you don't have to worry about getting more before you reload the plugin.

D.H1cks
12-12-2011, 08:08 PM
The best way I can see around this problem is that when a quickslot's shortcut returns an error, the quickslot is flagged, possibly changing the way the quickslot looks to the user (that way they know something should go there but they are currently out of it). Then when whenever a ItemAdded event is fired, go through all the quickslots that are flagged and see if any are updated. That way when loading through the LOTRO Plugin Manager, the quickslots will initially be empty but as the backpack is loaded in the slots should be fixed. This would also have the added benefit that whenever you run out of health pots you don't have to worry about getting more before you reload the plugin.

Seems about right.

Tshakaar
12-12-2011, 08:42 PM
If it can help, the bug i have with TonicBars when loading by the new manager is the same when i tried to put an alias on a quickslot to load it.

Now, 2 more years to see the possibility to choose the skin before connecting a toon.

Stever1388
12-12-2011, 08:56 PM
If it can help, the bug i have with TonicBars when loading by the new manager is the same when i tried to put an alias on a quickslot to load it.

Now, 2 more years to see the possibility to choose the skin before connecting a toon.

This problem was discussed in this thread (http://forums.lotro.com/showthread.php?410845-Loading-Plugins-from-Shortcuts-Causes-Errors) already, and a work a round has been found. TonicBars might be a bit more difficult to fix though. It's possible that might help with loading TonicBars using the LOTRO Plugin Manager.

Kalex
12-12-2011, 09:16 PM
I'm having issues with random quickslots on TonicBars disappearing when porting with update 5.

Adder
12-12-2011, 10:31 PM
Just a note here... besides the issues with the quickslot bars already discussed, most, if not all of the other plugins seem to be working correctly when loaded with the Turbine Plugin Manager. I currently have 64 plugins downloaded and was testing as many as I could today, and with the exception of those that were already having issues, all of them loaded just fine. I'll keep testing and let you know if there are any other issues but so far so good. :)

One more note... both Bootstap and Manager work correctly when loaded with the Turbine Manager. If a plugin DOES have issues (like the Travel plugin), try loading it through the autoload of one of these managers loaded from the Turbine Manger. I've tried a few plugins in this manner and it works like a charm.

Equendil
12-12-2011, 11:07 PM
Right, Update 5 made two of my plugins broken and one semi redundant, I'm going to be busy :)

stryker84
12-13-2011, 12:02 AM
tonic bars doesn't load properly either. Any extension bars are off in the upper left corner. They reset themselves if you go to add another extension bar, but they do this everytime you log on.

Haven't tried loading the regular way yet.

MrJackdaw
12-13-2011, 01:07 AM
I tried inserting a time delay before the main body of the plugin runs, but now a bug occurs where the plugins load function fires an error as though it is trying to be run twice.

Annoying.

magill
12-13-2011, 01:17 AM
I've configured the Turbine Plugin Manager to load Shady's (Cearbhall's) PluginManager, use this to load all your other Plugins.

However, this does NOT fix the problem with TonicBars...

In addition to the Extension Bars being all loaded in the upper left, all Inventory Bars are also "stacked" in the upper left corner.

MrJackdaw
12-13-2011, 01:53 AM
Yes, I tried using Turbines manager to load Bevy/SortPack and still had problems. *sigh*

EDIT: I have thought about making a wrapper to load bevy when the main game has finished loading - perhaps just a button for the user to click once they are in-game. Would that be an acceptable work-around?

Galuhad
12-13-2011, 09:14 AM
I wonder if the problem is caused by the plugin manager trying to load all the plugins simultaneously. Has anyone tried using it to load just one plugin? If this is the problem then perhaps use it to auto-load BootStrap and call your plugins from there. Otherwise it may be needed for authors to revise their load methods if the data is clashing with other plugins possibly causing these bugs?

Cearbhall
12-13-2011, 01:20 PM
not the best way i'm sure but can get around this until Turbine fixes it


--create quickslots

local needsItemAddedEvent = false
local function setShortCuts()
needsItemAddedEvent = false

for i = 1, 5 do
if DB.quickslots[i] then
local qs = window.quickslots[i]

local sc = Turbine.UI.Lotro.Shortcut(DB.quickslots[i][1], DB.quickslots[i][2])
local ok = pcall(qs.SetShortcut, qs, sc)
if not ok then
needsItemAddedEvent = true
end
end
end

if not needsItemAddedEvent and ItemAdded then
Shady.Helper.Event.UnregisterCallback(backpack, 'ItemAdded', ItemAdded)
end
end

plugin.Load = function()
setShortCuts()

if needsItemAddedEvent then
local player = Turbine.Gameplay.LocalPlayer.GetInstance()
backpack = player:GetBackpack()
ItemAdded = Shady.Helper.Event.RegisterCallback(backpack, 'ItemAdded', function(s, args)
setShortCuts()
end)
end
end


downside: quickslot's shortcut gets set everytime ItemAdded event fires
Of course you can check to see if all your quickslots setshortcut without error and unregister the backpack.ItemAdded event

edit: updated it to do just that

Stever1388
12-15-2011, 01:18 PM
I think the biggest problem stems from the fact that you can't use Quickslot:SetShortcut() to set an invalid shortcut, whether the shortcut was once valid or not. I'm not really sure how much interest there is in this, since it could be overcome in tons of other ways, depending on author preference and all that, but here is an extension of the Quickslot class stores the Shortcut when you use Quickslot:SetShortcut() separately from the actual Turbine.UI.Lotro.Quickslot:SetShortcut() method, meaning it will save the Shortcut even if the Shortcut is invalid, and will then continue to return that Shortcut when you call GetShortcut(). This should work for everyone without changing any code other than changing quickslot = Turbine.UI.Lotro.Quickslot() code to quickslot = Quickslot() (or where ever they place Quickslot.lua)

This doesn't actually fix the problem, it's up the programmer to then set Backpack ItemAdded event handlers to watch for items being added to the inventory so that the Quickslots can be updated.

This also surrounds the other SetShortcut() method with pcall() to prevent those errors, but returns true/false if the SetShortcut() worked/didn't work so you can still act accordingly.

-- This class attempts to fix the problem with the Quickslot class that
-- prevents it from storing invalid Shortcuts, even if the Shortcut was once valid.
-- For example, if you have a Health Potion in a Quickslot, and you run out of that potion,
-- the next time you load the plugin that Quickslot will be cleared (you can't set a Shortcut if
-- you don't have the item in your bag). At that point GetShortcut() will return an empty Shortcut.
-- Using this class, GetShortcut() would still return the Health Potion shortcut.

-- Please note that if you use this class you MUST use the AddCallback function by Pengoros
-- for ShortcutChanged, since this class uses that EventHandler to make sure
-- the Shortcut returned by GetShortcut() is the correct one.

-- One other thing, it is up to the programmer to decide how they want to handle invalid shortcuts outside
-- of this class. This class will not update a Quickslot/Shortcut every time the Backpack:ItemAdded event
-- is fired, so Quickslots/Shortcuts will not be fixed even if you get the item back into your inventory.
-- You will have to reload the plugin to get it to appear again.

import "Turbine.UI.Lotro";

-- Extend normal Turbine Quickslot class
Quickslot = class ( Turbine.UI.Lotro.Quickslot );

-- Constructor
function Quickslot:Constructor()
Turbine.UI.Lotro.Quickslot.Constructor( self );

-- self.shortcut stores the Shortcut even if
-- Turbine.UI.Lotro.Quickslot:SetShortcut(shortcut)
-- would throw an error
self.shortcut = Turbine.UI.Lotro.Quickslot.GetShortcut( self );

-- Create an EventHandler that watches for when the Shortcut has changed;
-- when it has, set self.shortcut to the new Shortcut
shortcutChangedHandler = function(sender, args)
self.shortcut = Turbine.UI.Lotro.Quickslot.GetShortcut( self );
end

AddCallback( self, "ShortcutChanged", shortcutChangedHandler );
end

-- Sets the Shortcut of the Quickslot by setting self.shortcut to the new Shortcut.

-- To simplify things, this method uses pcall() to set the Shortcut, which
-- means you won't get errors when setting Shortcuts.

-- In order to know whether the Shortcut was successfully set though, this method
-- returns true if the Shortcut was set, and false if an error would have been thrown.

-- If you DO NOT want your Shortcuts set to invalid Shortcuts (even though they will never reappear
-- on the Quickslot unless the user gets the item back into their inventory and then reloads the plugin), set Shortcuts
-- like this: if(Quickslot.SetShortcut(Shortcut) == false) then Quickslot.SetShortcut(Turbine.UI.Lotro.Shortcut()) end
function Quickslot:SetShortcut(value)
self.shortcut = value;
return pcall(function() Turbine.UI.Lotro.Quickslot.SetShortcut( self , value) end);
end

-- This function only returns self.shortcut; However, the only time this will be different than
-- using the old GetShortcut() will be when you use SetShortcut() and SetShortcut() returns false.
function Quickslot:GetShortcut()
return self.shortcut;
end

-- The amazing Callback function by Pengoros
function AddCallback(object, event, callback)
if (object[event] == nil) then
object[event] = callback;
else
if (type(object[event]) == "table") then
table.insert(object[event], callback);
else
object[event] = {object[event], callback};
end
end
return callback;
end

If anyone sees anything inherently wrong with this code, let me know, because I'm using it to do some fixes of plugins I use and need to work correctly with the LOTRO Plugin Manager (as I am really lazy and hate having to load plugins each time I log in, even though I use a shortcut key and Bootstray so it takes all of 2 keystrokes to do so). I haven't had any problems with it the last day I've used it, but I can't say I've done a whole bunch of testing.

If there's interest I (or someone else, doesn't really matter) can post this as a file so people can download it and use it. But as I said, not sure there will be much interest, since I'm not the best LUA programmer and there's probably better ways to do this depending on how your plugins are already coded.

MrJackdaw
12-16-2011, 02:24 AM
Stever1388 - This works to fix the loading bug! Rolling (with slight modification) into the next Bevy release!

Thank you!