Jump to content
Eternal Lands Official Forums
Aislinn

New feature, equipment swap equlivalent items

Recommended Posts

You're generating a lot of excitement with this client!  I just had someone ask me if it's possible for the two-handed weapons, like a halberd, remove both the sword and shield when using the Equipment Swap option.  Currently, we get a red error message "Can't wear, a similar item is already worn!"  Actually, this would be nice with and without using the equipment swap.

 

Share this post


Link to post
Share on other sites
35 minutes ago, Aislinn said:

You're generating a lot of excitement with this client!  I just had someone ask me if it's possible for the two-handed weapons, like a halberd, remove both the sword and shield when using the Equipment Swap option.  Currently, we get a red error message "Can't wear, a similar item is already worn!"  Actually, this would be nice with and without using the equipment swap.

 

 

In that case server has to know which weapons are double-handed and which are not (OL server knows that). But EL server does not know afaik.

Share this post


Link to post
Share on other sites
59 minutes ago, Kaddy said:

 

In that case server has to know which weapons are double-handed and which are not (OL server knows that). But EL server does not know afaik.

 

Okay so I guess I can ask radu about it.  Might help if I go prepared with all information.  (And I'll bring up the double click to equip, too.)  I put down what I know of from encyc, are there others?

Wooden staff

Quarterstaff

Spear

Halberd

Halberd of Action

Dragon Blade

Dragon Blade of Mirroring

Scythe

Staff of the Mage

Staff of the Active Mage

Staff of Protection

Share this post


Link to post
Share on other sites
On 1/28/2020 at 1:52 PM, bluap said:

Bit late now, but I did talk to Learner and he confirmed the smarter swap is done my the OL server.

 

I just talked to radu about this and he thinks both double-click to equip and smart-swap (two-handed weapons replacing both sword and shield) are doable directly from the client.  He said the client can send two commands to the server and this will cover it.

Share this post


Link to post
Share on other sites

Well, my original point was that the client does not currently have the information to do either the double-click to equip/swap or the information about which items are double-handed weapons or even which equipped items are weapons or shields.  The server does have this information but whether is in a usable form, I could not say.  We can of course provide suitable information to make this work in the client along with a bit of logic to use it.  I'm up for the coding challenge if others can gather the information.  We probably need a list of weapons, a list of shields, and a list of double-handed weapons - all with the corresponding item IDs.  We could make these data files read by the client so that we can update the information if it changes.

Share this post


Link to post
Share on other sites

Two Handed Weapons

Wooden staff

Quarterstaff

Spear

Halberd

Halberd of Action

Dragon Blade

Dragon Blade of Mirroring

Scythe

Staff of the Mage

Staff of the Action Mage

Staff of Protection

 

Shields

Wooden Shield

Enhanced Wooden Shield

Iron Shield

Steel Shield

Titanium Shield

Used Titanium Shield

Bronze Shield

Blue Dragon Shield

Titanium Shield of Life Drain

 

Swords

 

I'll be adding to this and will let you know when it's complete. 

Edited by Aislinn
Removed faulty item ID numbers

Share this post


Link to post
Share on other sites

according to item_info.txt:

Quote

130 |      122 |     10 | Enhanced Wooden Shield

(122 is image id, and 10 is weight)

 

Afaik, item_info.txt should always be present, as it's needed for the "new" way of handling inventory.

 

@Aislinn: May I ask where you found the ID's? My version of item_info.txt has different ID's for the items you list (e.g. "titanium shield" is 450, "used titanium shield" is 466). Bots (used to) use ID's that had nothing to do with the server ID's (as those only became available in 2010 or so).

 

Update:

I extracted all wearable items from item_info.txt (~370), what remains is classifying them according to type

(once you start coding that, might as well go the whole way and implement it for all types...).

Before doing that, could someone confirm that the types are:

- head

- body

- legs

- feet

- medallion

- weapon

- shield (includes gloves)

- cape

(and two-handed weapon occupying "weapon" and "shield" simultanuously)?

Edited by revi

Share this post


Link to post
Share on other sites

I totally agree with revi here.

 

If we are to do some smart equipment swap, it should include all items like clothes and stuff too.

 

I can help with item list, just let me know.

 

Edited by Kaddy

Share this post


Link to post
Share on other sites

I have a first working version of the "swap equivalent item" feature.  I just need to implement the bit with the two handed weapons.  I'm using a new data file that is similar to the into_info.txt file but contains the type of item instead of the EMU.  The fields are item ID, image ID, type and description.  The description field is not needed but obviously helps creating the list.  We could add an additional field to the item_info.txt file but that is generated by Radu from the server so it may be better kept separate.  The feature works like this; if you have say the fur cloak equipped and double click another cloak in you inventory, the two items are swapped, each taking the position of the other.  Hopefully that is what you wanted. Here's an extract of the file:

      92 |       85 | CLOAK | Fur Cloak
     149 |      132 | CLOAK | Powersaving Cloak
     364 |      247 | HEAD | Raccoon hat
     365 |      249 | HEAD | Skunk hat
      95 |      168 | NECK | Silver Medallion
      96 |      167 | NECK | Gold Medallion
     144 |      139 | BODY | Titanium Chain Mail
     319 |      178 | BODY | Iron Plate Mail
     142 |      137 | LEGS | Leather Pants
     540 |      373 | LEGS | Augmented Leather Pants
     333 |      180 | FEET | Damaged Iron Greave
     143 |       93 | FEET | Leather Boots
      54 |       63 | WEAPON_ONE | Bones
     334 |      140 | WEAPON_ONE | Wood Branches
      93 |       86 | WEAPON_TWO | Leather Gloves
     682 |      427 | WEAPON_TWO | Halberd
     132 |      124 | SHIELD | Steel Shield
     450 |      361 | SHIELD | Titanium Shield

Table edited: I should add.  I've used the types Revi mentioned replacing Medallion with NECK as we have the fox scarf too.  Also, while I've used SHIELD above, gloves appear to behave more like two handed weapons so that needs some more checking.  The other type I'm calling WEAPON_TWO for two handed weapons and gloves would appear to come under that.  These is a minor part of the code hard-wired to the type names (text to number conversion), but everything else is defined in the text file.

Edited by bluap

Share this post


Link to post
Share on other sites
36 minutes ago, bluap said:

I have a first working version of the "swap equivalent item" feature.  I just need to implement the bit with the two handed weapons.  I'm using a new data file that is similar to the into_info.txt file but contains the type of item instead of the EMU.  The fields are item ID, image ID, type and description.  The description field is not needed but obviously helps creating the list.  We could add an additional field to the item_info.txt file but that is generated by Radu from the server so it may be better kept separate.  The feature works like this; if you have say the fur cloak equipped and double click another cloak in you inventory, the two items are swapped, each taking the position of the other.  Hopefully that is what you wanted. Here's an extract of the file:


      92 |       85 | CLOAK | Fur Cloak
     149 |      132 | CLOAK | Powersaving Cloak
     364 |      247 | HEAD | Raccoon hat
     365 |      249 | HEAD | Skunk hat
      95 |      168 | NECK | Silver Medallion
      96 |      167 | NECK | Gold Medallion
     144 |      139 | BODY | Titanium Chain Mail
     319 |      178 | BODY | Iron Plate Mail
     142 |      137 | LEGS | Leather Pants
     540 |      373 | LEGS | Augmented Leather Pants
     333 |      180 | FEET | Damaged Iron Greave
     143 |       93 | FEET | Leather Boots
      54 |       63 | WEAPON_ONE | Bones
     334 |      140 | WEAPON_ONE | Wood Branches
      93 |       86 | WEAPON_TWO | Leather Gloves
     682 |      427 | WEAPON_TWO | Halberd
     132 |      124 | SHIELD | Steel Shield
     450 |      361 | SHIELD | Titanium Shield

Table edited: I should add.  I've used the types Revi mentioned replacing Medallion with NECK as we have the fox scarf too.  Also, while I've used SHIELD above, gloves appear to behave more like two handed weapons so that needs some more checking.  The other type I'm calling WEAPON_TWO for two handed weapons and gloves would appear to come under that.  These is a minor part of the code hard-wired to the type names (text to number conversion), but everything else is defined in the text file.

In the server, the terminology isn't about what type of item, but the location only, so Left Hands, Right Hand, Both Hands would be more accurate/ It just happens that Shields are all all flagged as Left Hand.

Share this post


Link to post
Share on other sites
34 minutes ago, Learner said:

In the server, the terminology isn't about what type of item, but the location only, so Left Hands, Right Hand, Both Hands would be more accurate/ It just happens that Shields are all all flagged as Left Hand.

That makes much more sense now, an interesting insight into the server thanks.  So we could use LEFT_HAND instead or WEAPON_ONE, LEFT_HAND instead of SHIELD, and BOTH_HANDS instead of WEAPON_TWO.

 

I have the WEAPON_TWO/BOTH_HANDS swap working now too.  A single handed item can replace a two handed item.  Also, a two handed item can replace a one handed item, but any shield is also removed.

Edited by bluap

Share this post


Link to post
Share on other sites
21 hours ago, bluap said:

The feature works like this; if you have say the fur cloak equipped and double click another cloak in you inventory, the two items are swapped, each taking the position of the other.  Hopefully that is what you wanted.

 

lol are you kidding me? :P That's exactly how we wanted!

 

 

20 hours ago, bluap said:

That makes much more sense now, an interesting insight into the server thanks.  So we could use LEFT_HAND instead or WEAPON_ONE, LEFT_HAND instead of SHIELD, and BOTH_HANDS instead of WEAPON_TWO.

 

I have the WEAPON_TWO/BOTH_HANDS swap working now too.  A single handed item can replace a two handed item.  Also, a two handed item can replace a one handed item, but any shield is also removed.

 

Can we have a build so we can test out?

Share this post


Link to post
Share on other sites
3 hours ago, Kaddy said:

Can we have a build so we can test out?

I'll commit the code and do some builds tomorrow.

Share this post


Link to post
Share on other sites

I've committed the "swap equivalent item" feature.  You will need to download an additional data file called item_extra_info.txt and save it to your data or update directory, otherwise you will not see any change.  I've created an initial version of the file but there will be omissions and some miss-placed types.  Please test but also check the file contains the correct data.

 

Build links in the usual places:

 

Updated the data file, reading back and using the list already provided....

Edited by bluap

Share this post


Link to post
Share on other sites

There are a couple of additional things we may want....

1) If you are just wearing a shield and no weapon and double-click a two-handed item - should we remove the shield and equip the two handed item?

2) You are wearing a two-handed item and double click a shield - should we swap the shield for the two-handed item?

Probably the 1) is OK, not sure about 2).  Both need a code change.

Share this post


Link to post
Share on other sites
51 minutes ago, bluap said:

There are a couple of additional things we may want....

1) If you are just wearing a shield and no weapon and double-click a two-handed item - should we remove the shield and equip the two handed item?

2) You are wearing a two-handed item and double click a shield - should we swap the shield for the two-handed item?

Probably the 1) is OK, not sure about 2).  Both need a code change.

 

1) Yes

2) Yes

 

Also just a quick observation, Silver Circlet and Gold Circlet are missing from HEAD list.  (I noticed right off because Aisy wears these.)  I can add them myself but thought I'd mention it.

Share this post


Link to post
Share on other sites
23 minutes ago, Aislinn said:

 

1) Yes

2) Yes

 

Also just a quick observation, Silver Circlet and Gold Circlet are missing from HEAD list.  (I noticed right off because Aisy wears these.)  I can add them myself but thought I'd mention it.

OK, I'll make those code changes.  I've updated the file to include Circlets. I've also added many more clothes.

Edited by bluap

Share this post


Link to post
Share on other sites

This works GREAT, but two of my weapons aren't double clicking for me: Titanium Serpent Sword of Thermal and Radioactive Rapier From the Shop (yes that really is its official name).  I'm getting "Can't wear, a similar i tem is already worn".  They do swap fine when I drag and drop.

Share this post


Link to post
Share on other sites

Not sure why that would be but try searching the list for errors and dups.   In any case, I've update the data file again.  It now contains about 370 items as Revi suggested.

Share this post


Link to post
Share on other sites
3 hours ago, Kaddy said:

I added alot of new weapons and armors to the list

item_extra_info.txt

Looks like we all posted at the same time, I missed this before.  I can't read the link you posted for some reason.

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.

×