Jump to content
Eternal Lands Official Forums
Alberich

can't switch arrow types with full inventory

Recommended Posts

When you have all slots used in your inventory and want to switch your equipped arrows e.g. from pking to magic arrows it's not possible because you can't put the equipped arrow on the ones in your inventory.

 

Even with half full inventory it should be possible to put equipped arrows on the pile of the same type in your inv, to be forced to click an empty slot is kinda annoying (btw same goes for all equipped things).

When you put something from storage to inventory it doesn't matter where you click why doesn't work the same from equipment to inventory?

Share this post


Link to post
Share on other sites
When you have all slots used in your inventory and want to switch your equipped arrows e.g. from pking to magic arrows it's not possible because you can't put the equipped arrow on the ones in your inventory....

I've just had a look at the code and done some tests. The client code checks that the destination slot is empty before sending the message to the server to unequip the item. If this test for an empty destination is removed things work much like you wish. Say you have a stack of bones, with one equipped. Moving the equipped item to any slot in the inventory (occupied or not) returns it to the stack.

 

However, if you only have one if these items, or its not stackable, you can still only unequip it by dropping into an empty slot. In fact the server does not like you doing this and tells you to stop "messing" with the server. This leaves two questions for the server side handling:

 

1) Is it OK to send the move item message when it is going to fail? i.e. can the server just let it fail without the message?

 

2) Even for the above case, the server could, in theory find a free slot and use that. Obviously, the unequip would fail if this was the only item of that type (or the item is not stackable) and there were no free slots.

Share this post


Link to post
Share on other sites
When you have all slots used in your inventory and want to switch your equipped arrows e.g. from pking to magic arrows it's not possible because you can't put the equipped arrow on the ones in your inventory....

I've just had a look at the code and done some tests. The client code checks that the destination slot is empty before sending the message to the server to unequip the item. If this test for an empty destination is removed things work much like you wish. Say you have a stack of bones, with one equipped. Moving the equipped item to any slot in the inventory (occupied or not) returns it to the stack.

 

However, if you only have one if these items, or its not stackable, you can still only unequip it by dropping into an empty slot. In fact the server does not like you doing this and tells you to stop "messing" with the server. This leaves two questions for the server side handling:

 

1) Is it OK to send the move item message when it is going to fail? i.e. can the server just let it fail without the message?

 

2) Even for the above case, the server could, in theory find a free slot and use that. Obviously, the unequip would fail if this was the only item of that type (or the item is not stackable) and there were no free slots.

Never send a message to the server when you know it will fail. The basic reason for the free slot check in the client is to tell it where to put specific items in inventory. Only a small number of items (stack+equipable) have a problem like this and in general think about the fact you need to have some working work to unequip stuff or you'd start dropping things.

Share this post


Link to post
Share on other sites
Never send a message to the server when you know it will fail.

Agreed, that would be silly. However, in this case, the client does not know if the item is stackable. If it is stackable, the move to an occupied slot (even if the slot contains a different item) will work if we have more than one of the items.

Share this post


Link to post
Share on other sites

Is it possible to check if there is at least one empty slot and move the item from the equipment to it's stack or the next empty slot in inventory?

The case that your inventory is full is pretty rare anyway.

Share this post


Link to post
Share on other sites
Is it possible to check if there is at least one empty slot and move the item from the equipment to it's stack or the next empty slot in inventory?

The case that your inventory is full is pretty rare anyway.

Yes, that would be easy to do, all client side too and no changes to server interaction. If no one objects I'll make that change at least.

Share this post


Link to post
Share on other sites

I am afraid I do not understand. If there is a free slot, shouldn't the user manually move it there? Else, how does the client know that the player wants to unequip the item?

Share this post


Link to post
Share on other sites
I am afraid I do not understand. If there is a free slot, shouldn't the user manually move it there? Else, how does the client know that the player wants to unequip the item?

If you pick an item and click on a stack of the same item shouldn't it be placed there?

But it seems technically not possible to check client side if an item is stackable so checking for a free slot is the next best solution for this problem.

 

I don't get your last question, when you select an item from the Equipment and click in the inventory I'm pretty sure you wanted to unequip it or did we overlook a case?

Share this post


Link to post
Share on other sites

The client could learn which items are not stackable. This knowledge can't be persistent of course, but session-based.

 

When there are two items with the same id, "the same items", in two or more slots, this item is not stackable.

Share this post


Link to post
Share on other sites
I am afraid I do not understand. If there is a free slot, shouldn't the user manually move it there? Else, how does the client know that the player wants to unequip the item?

Alberich's reply reflects my thoughts exactly.

 

Just finding the next free slot is an easy and obvious way to work IMHO. For stackable items, the item just returns to the stack which ever item slot you drop it. None stackable items go to the slot you drop into if it is free, otherwise the first free slot from the top. The only down side of this change is that it only works if you have at least one free slot; otherwise it just functions as before. If the client learnt about stackable items, then it could handle the full slot case but using the image id is not a error-free way to distinguish items (ids are sometimes used for different items). Anyhow, I've coded the change which is very simple and small. In use I can't believe it has not always worked this way.

Edited by bluap

Share this post


Link to post
Share on other sites
cvs commit please :)

Now I'm back from my holidays I could....

 

Edit: My apologies, I was mistaken, the client does know if an item is stackable. :blush: I've modified my change to allow stackable items (with a stack) to be unequipped even if there are no free spaces. The only time this might go wrong is if two different, wearable and stackable items had the same image id. I believe the server would reject the un-equip in that case. You could still un-equip the item into a free slot in any case. I'm testing this change now....

Edited by bluap

Share this post


Link to post
Share on other sites

I committed the discusses change a few days ago.

 

I have also just committed a new function that allows you two swap one equiped item for another by dropping the new item onto the occupied slot of the item you want to unequip. This function is has to be enabled from the item window context menu. It is off by default as I know some people will hate it; some might like it though. :P

Share this post


Link to post
Share on other sites
I have also just committed a new function that allows you two swap one equiped item for another by dropping the new item onto the occupied slot of the item you want to unequip. This function is has to be enabled from the item window context menu. It is off by default as I know some people will hate it; some might like it though. :blush:
Thank you very much, I love this function!

 

I noticed a minor problem probably server side.

When I got a training arrow or pk bolt equipped and none of them left in the inventory i can't switch them with other arrow/bolt type.

I get 'This position is already occupied. Stop fucking around with the server!'

 

But it I get this only with these two arrow bolt/types and only if there none of that type left in my inventory.

Share this post


Link to post
Share on other sites

Swapping items is great, thank you.

 

Just got one small issue with it, happend so far twice to me.

While swapping weapons and equiping new pick I misclicked on CoL and so CoL got removed from equipment.

During heavy fight or pking this can result in fast death. Is there any chance this could be fixed?

Share this post


Link to post
Share on other sites

Sure. Don't drag your weapon onto it.

 

The client does not know or care the difference between a COL and a sword, it only obeys your instructions.

 

Human error will eventually teach you to pay attention to what you are doing.

 

May I suggest putting the COL at the bottom, and the sword at the top of your quickslots?

Share this post


Link to post
Share on other sites
While swapping weapons and equiping new pick I misclicked on CoL and so CoL got removed from equipment.

During heavy fight or pking this can result in fast death. Is there any chance this could be fixed?

Like labrab said, the client can't really make it conditional on items. You could just disable the function during a fight. This is why I made it configurable via the right click menu.

Share this post


Link to post
Share on other sites
I get 'This position is already occupied. Stop fucking around with the server!'

But it I get this only with these two arrow bolt/types and only if there none of that type left in my inventory.

I'll get myself a bolt and check this out.....

Share this post


Link to post
Share on other sites

I had a thought on this, not sure how complicated this would be or not, so I'm throwing it out here :P

 

What if items that were equipped never left their inventory slot (just a copy of its icon would appear in the equipement if even needed there at all...) and it was highlighted in green (or something) to indicate it's 'in use'. Now, the person wants to swap headgear, they right click on their hat, it tries to wear it like it does now, but if there's a similar item being worn (some other hat) it just swaps the item being worn (nothing leaves inventory slots here....) Removal is simply right-clicking the 'in use' item again and it gets 'un-worn' (no color around it now in inventory.)

 

This would allow one to increase inventory slots to 42 (6x7 looks nice) and every slot would have the potential of being 'equipped' or not, depending on the item (and what's already worn, of course...) The euipment slots would be just for show (to indicate your 'outfit') or even removed if you think they'd be uneeded at this point.

 

The results would be 2 less overall slots, but every slot could be full and no swapping. The first reaction to this might be, "omfg, I'm losing slots" until one realizes that you now have 6 more slots you could carry stackables in, instead of just equipment, as the equipment slots are now (so all of the slots are more usuable.) It also allows for future equipment types without really having to add more slots (like waist items, for example...) as well as adding new slots to inventory later without really changing logic (just more slots...)

 

Hopefully this all makes sense (it's clear in my head, but not sure I can make it clear with just words...) If this idea has issues, perhaps some flavor if it will help :P

 

DB

Edited by DogBreath

Share this post


Link to post
Share on other sites
I get 'This position is already occupied. Stop fucking around with the server!'

But it I get this only with these two arrow bolt/types and only if there none of that type left in my inventory.

I'll get myself a bolt and check this out.....

It seems there is an other condition, there has to be a training and pk arrow/bolt either in equipped or in inv and there is no free inv slot before the item you want to equip.

 

Steps to reproduce:

  1. put one pk bolt and training bolt in your inventory
  2. equip the last one
  3. try to swap them

 

 

I noticed something else perhaps it's tied to it. When I got some one training bolt in inv and one pk bolt equipped (none pk bolt in inv) and try to unequip the bolt and place it on any other item it fails (does nothing), placing it in an empty slot works. (For any other item it doesn't matter where to place it)

Share this post


Link to post
Share on other sites
Steps to reproduce:

  1. put one pk bolt and training bolt in your inventory
  2. equip the last one
  3. try to swap them

The only time this might go wrong is if two different, wearable and stackable items had the same image id.

The training bolt and the pk bolt have the same image, that why they won't swap. Checking the code, I realise I can reorganise things so that this is only an issue when you have run out of free slots. In this case, when the image id's are the same, the code will wrongly think it can stack the items and so get the server error. I'll check this over a bit more in the morning and commit when all is well.

 

When I got a training arrow or pk bolt equipped and none of them left in the inventory i can't switch them with other arrow/bolt type.
Hopefully, this was a typing error and you meant "training bolt" not "training arrow" as I can't see a problem with those.

Share this post


Link to post
Share on other sites
When I got a training arrow or pk bolt equipped and none of them left in the inventory i can't switch them with other arrow/bolt type.
Hopefully, this was a typing error and you meant "training bolt" not "training arrow" as I can't see a problem with those.

Yes sorry, meant pk and training bolt.

 

Thanks for fixing this.

Share this post


Link to post
Share on other sites

Well I have commited my fix for this problem but the duplicate image ids are still causing an issue when we have no free flots. I have added more tests so that commands are not sent to the server when they should not be but one issue still remains:

 

The issue occurs under this "rare" condition; if we have no free inventory slots, one or more stackable items unequipped and a single, different equipped item with the same id as the aforementioned stack. When we try to unequip the single item, the client tries to place it on the stack of the other item.

 

This may mean we have to abandon this feature; i.e. allowing a stackable item to be unequipping when there are no free slots.

 

Any comments.

 

Edit: I should add that if the item to be unequipped is not the only one of its type, and there multiple possible stacks because of duplicate ids, the client does not try to unequip the item. A user message is displayed (which will be moved into the translation list if we keep this feature).

Edited by bluap

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×