I'm really lazy, and the new moderators seem to need something productive to do, so merge this if its old i guess, but:
I would like to be able to pick an item up and drop it on a full equipment slot, and have the old item replace the new on cursor.
Seems like a realistic request, amirite?
YOYOYO SHOUTOUT TO SABINATI WUT WUT
GREAT MODERATOR OR GREATEST MODERATOR?
-
Killface
- Posts: 264
- Joined: Mon Oct 05, 2009 5:27 am
Drop Item to Equipped Slot/Lift worn item off
Jackard wrote:kvc has eleven secret herbs and spices
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
-
loftar
- Posts: 9096
- Joined: Fri Apr 03, 2009 7:05 am
- Location: Your character database
Re: Drop Item to Equipped Slot/Lift worn item off
That'd be nice, but it's actually programmatically trickier than it might at first seem.
Part of the equipment "protocol" is checking whether all prerequisites for equipping an item are satisfied, which includes checking that the slot(s) the item might need is free. If there is already an item equipped there, the check will, therefore, fail. Thus, in order to equip an item in an occupied slot, the occupying item needs to be unequipped first.
I could, theoretically, unequip the current item, the try and equip the new item, and then, if that fails, reequip the old item, but the downsides to that option are that 1) the old item would still suffer the effects on unequipping (such as a torch being put out) and 2) it is unclear how to handle the old item refusing to reequip (such as would be the case with bloated leeches).
Part of the equipment "protocol" is checking whether all prerequisites for equipping an item are satisfied, which includes checking that the slot(s) the item might need is free. If there is already an item equipped there, the check will, therefore, fail. Thus, in order to equip an item in an occupied slot, the occupying item needs to be unequipped first.
I could, theoretically, unequip the current item, the try and equip the new item, and then, if that fails, reequip the old item, but the downsides to that option are that 1) the old item would still suffer the effects on unequipping (such as a torch being put out) and 2) it is unclear how to handle the old item refusing to reequip (such as would be the case with bloated leeches).
"Object-oriented design is the roman numerals of computing." -- Rob Pike
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: Drop Item to Equipped Slot/Lift worn item off
could you make the old item go to a free space in inventory, and failing that, drop on the ground?
-
Swordmage
- Posts: 124
- Joined: Fri Mar 26, 2010 3:48 am
Re: Drop Item to Equipped Slot/Lift worn item off
Drop that nice shiny new hi-Q axe that is being swapped for a fishing pole (while sitting in a boat)?sabinati wrote:could you make the old item go to a free space in inventory, and failing that, drop on the ground?
-
Lothaudus
- Posts: 641
- Joined: Fri Oct 23, 2009 12:32 pm
- Location: Adelaide, Australia
Re: Drop Item to Equipped Slot/Lift worn item off
If an item is on the cursor and you click an inventory slot, call the check to see if that item can be equipped but pass a flag to that function so that it ignores the "is the slot free" check.loftar wrote:I could, theoretically, unequip the current item, the try and equip the new item, and then, if that fails, reequip the old item, but the downsides to that option are that 1) the old item would still suffer the effects on unequipping (such as a torch being put out) and 2) it is unclear how to handle the old item refusing to reequip (such as would be the case with bloated leeches).
If that is successful (so the item CAN be equipped), then item A is unequipped (and placed in some kind of temp program storage), item B is equipped and then item A is put on the cursor.
Issue: What if you're equipping a two-handed item (pickaxe) and have both hands already equipped (an axe and saw)? Well...
... refuse to do the swap.sabinati wrote:could you make the old item go to a free space in inventory, and failing that...
Barry Fletcher Norwin
Lawspeaker of Crossroads - Leader of Codexia - Keeper of the Cheese
http://www.rpgcodex.net
Lawspeaker of Crossroads - Leader of Codexia - Keeper of the Cheese
http://www.rpgcodex.net
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: Drop Item to Equipped Slot/Lift worn item off
yeah that's probably betterLothaudus wrote:... refuse to do the swap.sabinati wrote:could you make the old item go to a free space in inventory, and failing that...