Quantcast
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO Stand-Alone Plugins > Bags, Bank & Inventory


Post A Reply
Author Comments Comment Options
Unread 04-16-2012, 10:50 PM  
iSpawnAtHome
The Wary

Forum posts: 0
File comments: 1
Uploads: 0
Question Scalability

Hello, I've always been bothered by how small the inventory icons are. Is there a possibility to make the addon scale? Like make it bigger
iSpawnAtHome is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 04-12-2012, 07:33 PM  
Habna
The Wary
 
Habna's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 247
Uploads: 3
Quote:
Something got moved around, but lotro isn't quite finished with registering that this event has occured
I think that to. Adding a delay of 0.2 sec will totaly prevent the "busy" thing, but i'm not going to add this delay. In early version this delay was there. It was remove to achive super fast sorting. So i'm waiting for lotro to get as fast as there update function! If sort get stuck you can quickly re-load HugeBag by right clicking the left bar (in widget mode) or on the title (in window mode) until I found something to prevent this bug.
Habna is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 04-09-2012, 04:49 AM  
Dwamur
The Wary
Interface Author - Click to view interfaces

Forum posts: 4
File comments: 12
Uploads: 0
>>
"You are too busy to do that right now" is a LOTRO reply that means you are doing something that prevents using other functions. eg: in the middle of crafting, in the middle of a trade, dismounting, carrying stuff on a carry quest etc.
>>

In this case, standing still in a crafting hall waiting for the sort function to finish. Once the error has triggered, sort will no longer work, as it believes it is still in sort mode. Detecting the lotro error and ending the sort function early would allow another go at sorting. Another option would be a slight (0.1s) delay between item moves to avoid the race condition that I think is at the root of this. Although that would slow sort noticeably.

Usually, the sort will start, shuffle a few things around, then stop with "you are too busy to do that right now". I am thinking it has to be a race condition: Something got moved around, but lotro isn't quite finished with registering that this event has occured, then the next piece in the bag gets moved around, and hence the error. We'd not see it with anything but the lightning-fast shuffle that a bag sort routine can bring to the table.
Dwamur is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-30-2012, 03:53 AM  
mglinka99
The Wary

Forum posts: 0
File comments: 30
Uploads: 0
Ok. Here are some screenshots. I hope it helps finding the error.

Sorry, i can not attach the pics into this post. So I've uploaded them to a hoster.

Start

Sort_success

New_Items

Sort_error
mglinka99 is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-29-2012, 10:09 AM  
Levva
The Wary

Forum posts: 0
File comments: 7
Uploads: 0
Quote:
If its an LUA issue i guess we have to wait for a LUA fix.
NO you misunderstand. It is NOT a LUA problem and it will NEVER be fixed by the LUA code.

LUA tables have a sort routine called table.sort() this function is working EXACTLY as designed. The issue is that if any two items are considered identical then the outcome is not guaranteed to swap the position of the two objects. Thus the author of a plugin must ensure his sort function that tells table.sort how to work always has unique items so that the sort never compares two identical values.

I called it a "core LUA failure" due to the fact that its not at all obvious to an author not fully familiar with LUA coding that they MUST be careful in their sort routine design to avoid duplicate comparison issues. However it is always the author that must avoid the problem that is simply how LUA was designed to work, ie: a lightweight and fast coding language that leaves the authors to do a bit of extra work if they use some of the more intensive features.

If you actually say what the exact issue you are having is and what items you have that are not getting sorted then the author might have a chance of fixing it. ie: what two items do you have that could be identical? Screenshots before and after could help too.

BTW how did you install the fix? To be 100% sure of a fix you need to have the game unloaded, delete the old version and copy the files in new and then and only then start the game. If you simply overwrite one folder with another then you may not have replaced the fixed files as version stamping can cause issues. Delete and install is the only guaranteed way of ensuring you have the latest version.

Last edited by Levva : 03-29-2012 at 10:13 AM.
Levva is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-28-2012, 09:46 AM  
mglinka99
The Wary

Forum posts: 0
File comments: 30
Uploads: 0
Same sorting problem with newest version.

If its an LUA issue i guess we have to wait for a LUA fix.

Anyway, I dont wanna miss this plugin.

Great job
mglinka99 is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-25-2012, 07:14 AM  
Levva
The Wary

Forum posts: 0
File comments: 7
Uploads: 0
Quote:
I'm not sure if it's 100% functional because it was functioning with me before your changes anyway I did the changes in case :P Thx Levva!
The issue is that the LUA base code table.sort is not a stable algorithm so it WILL have the potential to fail if it EVER encounters a situation where the two items compared are "equal" however "equal" is defined in your sort function.

It is essentially random as to whether the table.sort function changes the order of the two items or not when they are equal and its this very randomness that makes things appear fine during testing as sods law says as the author you never see the problem in your own testing, only when users test it

So it was simply a matter that you had accidentally not covered a possible two items are equal scenario and thus it would randomly fail. ie: it was a core lua failure really and you not being fully aware of having to cover that condition. Now you have added a check that GUARANTEES uniqueness it will never fail.

Last edited by Levva : 03-25-2012 at 07:59 AM.
Levva is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-25-2012, 07:09 AM  
Levva
The Wary

Forum posts: 0
File comments: 7
Uploads: 0
Re: issue

Quote:
Hello, well i am still having the problem of sorting, always give me this "You are too busy to do that right now.", and i am not doing nothing at all and then i can't sort it anymore.

Suggestions?
"You are too busy to do that right now" is a LOTRO reply that means you are doing something that prevents using other functions. eg: in the middle of crafting, in the middle of a trade, dismounting, carrying stuff on a carry quest etc.
Levva is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-25-2012, 06:16 AM  
LMOF
The Wary

Forum posts: 0
File comments: 4
Uploads: 0
issue

Hello, well i am still having the problem of sorting, always give me this "You are too busy to do that right now.", and i am not doing nothing at all and then i can't sort it anymore.

Suggestions?
LMOF is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-24-2012, 05:25 PM  
Habna
The Wary
 
Habna's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 247
Uploads: 3
Quote:
It would work because then the items are unique and so the bug in the sort routine wouldn't fail as it would never encounter two items of same name and same quantity.
I'm not sure if it's 100% functional because it was functioning with me before your changes anyway I did the changes in case :P Thx Levva!

Last edited by Habna : 03-24-2012 at 07:54 PM.
Habna is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-24-2012, 04:16 PM  
Levva
The Wary

Forum posts: 0
File comments: 7
Uploads: 0
Quote:
Changing the names worked, sorting works flawlessly now. Thx for advice!
It would work because then the items are unique and so the bug in the sort routine wouldn't fail as it would never encounter two items of same name and same quantity.
Levva is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-24-2012, 01:47 PM  
Feladr
The Wary

Forum posts: 0
File comments: 12
Uploads: 0
Changing the names worked, sorting works flawlessly now. Thx for advice!
Feladr is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-24-2012, 05:45 AM  
Levva
The Wary

Forum posts: 0
File comments: 7
Uploads: 0
The problem with your sort routine is that table.sort is not a stable function. ie: "elements considered equal by the given order may have their relative positions changed by the sort." (from the LUA manual)

Your sort function you pass to table.sort also isn't stable as it doesn't fully deal with the identical situation and thus you will always get two identically named and identically quantity items possible flipping and thus meaning the sort fails or carries on indefinitely.

To fix this you need to make the sort stable. ie: you need to include an extra check for something that will ALWAYS be unique for that item being sorted. Actually you have ALREADY provided the means to achieve this you just haven't used it in your sort.

So the simplest way to make your sort stable is to do the following...

In sort.lua you have already given then items a unique .id value. This value is attached to the object when the table is initialised this is ideal as you never actually change this during the sort so you can guarantee that this value will ALWAYS be unique during the sort.

Thus to fix your sort routine you need only add an extra check to
Code:
	table.sort(VirtPack, function (a,b)	
		if a.Weight == b.Weight then
			if a.Name == b.Name then
				return (a.Quantity < b.Quantity)
			else  
				return strip(a.Name) < strip(b.Name)
			end
		else  
			return (a.Weight < b.Weight) 
		end
		end)
adding a check such as

Code:
	table.sort(VirtPack, function (a,b)	
		if a.Weight == b.Weight then
			if a.Name == b.Name then
				if a.Quantity == b.Quantity then
					return (a.id < b.id)
				else
					return (a.Quantity < b.Quantity)
				end
			else  
				return strip(a.Name) < strip(b.Name)
			end
		else  
			return (a.Weight < b.Weight) 
		end
		end)
ie: if name is same AND quantity is same then use ID to force a unique sort thus turning the sort code from an unstable sort algorithm into a stable one.

Hope this helps understand where the issue you have been having lies.
Levva is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-23-2012, 08:08 PM  
Habna
The Wary
 
Habna's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 247
Uploads: 3
Quote:
Yes, they do, I left the default name. I'll rename them on the next reforge and tell you if it changed anything.
Thx
Habna is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 03-23-2012, 05:21 PM  
Feladr
The Wary

Forum posts: 0
File comments: 12
Uploads: 0
Yes, they do, I left the default name. I'll rename them on the next reforge and tell you if it changed anything.
Feladr is offline Report comment to moderator   Reply With Quote Reply With Quote
Post A Reply

 
Category Jump:
Search this Category:
 

All times are GMT -5. The time now is 09:39 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui