Bug - Fixed Having some issues with saving and equipping a custom outfit

Rinn

Developer
This is something I noticed recently (not sure when it started I noticed it after the fire event ended, however still occurring with r11303) and I've found some steps to reproduce on my machine:
  1. Equip some gear: 'maximize 2.0 meat, 1.0 items, +equip camp scout backpack'
  2. Save the custom outfit: 'outfit save Automation'
  3. Equip a new item in the third accessory slot: 'equip acc3 mayfly bait necklace'
  4. Restore the previously saved custom outfit: 'outfit Automation'

When ever this happens, mafia is expecting increasingly more of the item in the third accessory slot (in my case a Hodgman's lucky sock) then I have, and if the inventory is refreshed the problem is compounded. There may be other repos, but this is the one I'm able to consistently get to happen.

Here's some cli outfit to show what I'm encountering, if there's anything I can do aside from opening up the debugger to get more information I'd be happy to do so.

Code:
[COLOR=olive]> outfit birthday suit[/COLOR]

Taking off     everything...
Everything removed.

[COLOR=olive]> familiar     none[/COLOR]

[COLOR=olive]> refresh all[/COLOR]

Refreshing     session data...
Synchronizing moon data...
Loading character     status...
Retrieving character data...
Refreshing closet...
Examining     consumables in closet...
Examining equipment in closet...
Examining     miscellaneous items in closet...
Updating inventory...
Retrieving     quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving     campground data...
Session data refreshed.

[COLOR=olive]>     maximize 2.0 meat, 1.0 item, +equip camp scout backpack[/COLOR]

Maximizing...
69984     combinations checked, best score 975.00
Putting on Hodgman's porkpie     hat...
Equipment changed.
Wielding bottle-rocket crossbow...
Equipment     changed.
Holding Hodgman's imaginary hamster...
Equipment changed.
Putting     on Camp Scout backpack...
Equipment changed.
Putting on origami     pasties...
Equipment changed.
Putting on Hodgman's lobsterskin     pants...
Equipment changed.
Putting on Uncle Hobo's belt...
Equipment     changed.
Putting on Hodgman's bow tie...
Equipment changed.
Putting     on Hodgman's lucky sock...
Equipment changed.

[COLOR=olive]>     outfit save Automation[/COLOR]

Saving outfit: Automation
Outfit     saved

[COLOR=olive]> equip acc3 mayfly bait necklace[/COLOR]

Putting     on mayfly bait necklace...
Equipment changed.

[COLOR=olive]>     outfit Automation[/COLOR]

[COLOR=red]You need 4 more     Hodgman's lucky sock to continue.[/COLOR]
[COLOR=red]You need 4     more Hodgman's lucky sock to continue.[/COLOR]

[COLOR=olive]>     maximize 2.0 meat, 1.0 item, +equip camp scout backpack[/COLOR]

Maximizing...
86564     combinations checked, best score 975.00
Putting on Hodgman's lucky     sock...
Equipment changed.

[COLOR=olive]> outfit save     Automation[/COLOR]

Saving outfit: Automation
Outfit saved

[COLOR=olive]>     equip acc3 mayfly bait necklace[/COLOR]

Putting on mayfly bait     necklace...
Equipment changed.

[COLOR=olive]> outfit     Automation[/COLOR]

[COLOR=red]You need 4 more Hodgman's lucky     sock to continue.[/COLOR]
[COLOR=red]You need 4 more Hodgman's     lucky sock to continue.[/COLOR]

[COLOR=olive]> outfit     birthday suit[/COLOR]

Taking off everything...
Everything removed.

[COLOR=olive]>     refresh all[/COLOR]

Refreshing session data...
Synchronizing moon     data...
Loading character status...
Retrieving character data...
Refreshing     closet...
Examining consumables in closet...
Examining equipment in     closet...
Examining miscellaneous items in closet...
Updating     inventory...
Retrieving quest data...
Retrieving familiar data...
Familiar     data retrieved.
Retrieving campground data...
Session data refreshed.

[COLOR=olive]>     maximize 2.0 meat, 1.0 item, +equip camp scout backpack[/COLOR]

Maximizing...
69984     combinations checked, best score 975.00
Putting on Hodgman's porkpie     hat...
Equipment changed.
Wielding bottle-rocket crossbow...
Equipment     changed.
Holding Hodgman's imaginary hamster...
Equipment changed.
Putting     on Camp Scout backpack...
Equipment changed.
Putting on origami     pasties...
Equipment changed.
Putting on Hodgman's lobsterskin     pants...
Equipment changed.
Putting on Uncle Hobo's belt...
Equipment     changed.
Putting on Hodgman's bow tie...
Equipment changed.
Putting     on Hodgman's lucky sock...
Equipment changed.

[COLOR=olive]>     outfit save Automation[/COLOR]

Saving outfit: Automation
Outfit     saved

[COLOR=olive]> equip acc3 mayfly bait necklace[/COLOR]

Putting     on mayfly bait necklace...
Equipment changed.

[COLOR=olive]>     outfit Automation[/COLOR]

[COLOR=red]You need 5 more     Hodgman's lucky sock to continue.[/COLOR]
[COLOR=red]You need 5     more Hodgman's lucky sock to continue.
[/COLOR]

 

Veracity

Developer
Staff member
When you create a custom outfit, KoLmafia notices what you have equipped and saves a copy of it for you. It does it like this:

Code:
			AdventureResult[] equipment = EquipmentManager.currentEquipment();
			// Add our current equipment to it
			for ( int slot = 0; slot < EquipmentManager.FAMILIAR; ++slot )
			{
				AdventureResult piece = equipment[ slot ];
				outfit.addPiece( piece );
			}

			// Add this outfit to the list of custom outfits.
			EquipmentManager.addCustomOutfit( outfit );
I am suspicious about what EquipmentManager.currentEquipment() returns. In particular, it does funky things with the accessory slots, since it keeps a single list of all the accessories you own, for use by the Gear Changer. That is why the Gear Changer will show that you have 2 of a particular accessory, say.

When saving a custom outfit, we should clone the AdventureResult for each slot, rather than point to whatever the EquipmentManger has on its list currently.
 

slyz

Developer
It's nice that you found a way to reproduce it.

I don't have time (as usual) to look at this right now. I think this is the root of the problem that motivated Veracity to add a retrieve_item before each custom outfit change. If this is fixed, could that change be reconsidered?
 

Veracity

Developer
Staff member
I think this is the root of the problem that motivated Veracity to add a retrieve_item before each custom outfit change. If this is fixed, could that change be reconsidered?
Uh, no. The reason I added retrieve_item() was so that I could keep outfit pieces in my closet (to protect against PVP, say), and have KoLmafia pull them out before putting on the outfit (if autoBasement wants to use a saved outfit, say).

I am quite happy with how it works.

Revision 11306 clones the AdventureResults we use for saving away Custom Outfits you create within a session, rather than re-using whatever EquipmentManager has saved for the item in a given slot. Tell me how it works for you.
 

Rinn

Developer
Looks like it's resolved, thanks.

This was probably causing some issues with autoBasement now that I think about it, I seem to recall having some similar issues.
 
Last edited:
Top