Feature - Implemented Gear Changer should list Your Previous Outfit

I had posted a request/query about previous outfit in another thread but it seems more appropriate as it's own request. In the other thread Veracity said:

Veracity said:
Previous Outfit was never reliable, since the outfit id changes every time you equip a different outfit. You could have seen a failure by opening the Gear changer and then using a chat command to put on an outfit. Since that used Ajax to put on the outfit, we didn't refresh the outfit id from the equipment page, and an attempt to put on Previous Outfit from the gear changer would fail.

When I added reading custom outfits at login and added recognition of creating new outfits via Ajax, I removed reading the current outfits off of the equipment page.

It turns out, you can switch to your Previous Outfit without having to know the outfit id: "whichoutfit=last" will work. We should add a new dummy outfit with special handling, just like Birthday Suit, for Previous Outfit which would invoke it like that.

I would really appreciate it if this could be implemented when you got a chance. I'm not sure who else used it before, but it was something I used quite a bit.

Thanks!
 

Terion

Member
I do use the "/outfit last" command in chat a fair bit, when I want to switch into a specialized outfit for a few turns and then go back to whatever I happened to be doing previously.
 

Theraze

Active member
Veracity was actually going to implement using KoL's previous outfit system instead of the current "Backup" outfit system for checkpoints, but people (well, one person) complained and she decided against it.

Here's something interesting... if you manually equip the outfit once, it works properly as a mafia outfit, for that session, at least.
 

Veracity

Developer
Staff member
The issue is that the actual outfit number of "Your previous outfit" changes every time you change outfits. Back when we used to switch outfits NOT using ajax, we'd get the whole Equipment page and would parse the outfit list off of it and all would be well. We now switch outfits using ajax and do no learn the new outfit ID and the old one becomes invalid.

We need a built-in outfit named "Your previous outfit" which uses outfit id of "last". That will get you exactly what KoL itself thinks is your previous outfit.

I find myself going to chat and typing "/outfit last" a lot after switching outfits in the Gear Changer. I sure would like "Your Previous Outfit" in the Gear Changer.
 

Veracity

Developer
Staff member
OK, I coded up a special "Your Previous Outfit" submitting "outfitid=last" - which CDM told me worked. Sometimes yes, sometimes no. I am submitting the following bug report to KoL. Until they fix it, I can't use "outfitid=last". (Note that /outfit last actually turns into outfitid=-xxxx, where the xxxx is the actual KoL-generated outfit id for Your Previous Outfit).

I submit the following URL:

inv_equip.php?which=2&action=outfit&whichoutfit=33&ajax=1

and get:

You put on an Outfit: Frat Warrior Fatigues

I then submit the following URL:

inv_equip.php?which=2&action=outfit&whichoutfit=last&ajax=1

and sometimes I get this:

You put on an Outfit: Your Previous Outfit

and sometimes I get this:

Outfit "Your Previous Outfit" is very strange -- more accessories defined than slots available.

In the latter case, it replaces "Your Previous Outfit" with my (unchanged) current outfit - Frat Warrior Fatigues + whatever else I am wearing.
 

slyz

Developer
Until they fix it, I can't use "outfitid=last". (Note that /outfit last actually turns into outfitid=-xxxx, where the xxxx is the actual KoL-generated outfit id for Your Previous Outfit).
Could we maybe use ChatSender.executeMacro( "/outfit last" ) instead of submitting something to inv_equip.php?
 

Nappa

Member
Sorry to necro this thread -- but did something ever come from this bug report? Would this still have a chance of being implemented? I think I'd find it very convenient.

Aside from the 'Your previous outfit' feature, something else I'm missing from the Gear changer tab is a way to 'reset' the outfit to what my character is actually wearing after I have played with the comboboxes somewhat (but without actually confirming this with 'Change gear' button). Or is there already a way to do this?
 

Veracity

Developer
Staff member
Sorry to necro this thread -- but did something ever come from this bug report? Would this still have a chance of being implemented? I think I'd find it very convenient.
I would too. Perhaps, as slyz suggested, we could put in special code for (Your Last Outfit) which submits "/outfit last" to chat.

Aside from the 'Your previous outfit' feature, something else I'm missing from the Gear changer tab is a way to 'reset' the outfit to what my character is actually wearing after I have played with the comboboxes somewhat (but without actually confirming this with 'Change gear' button). Or is there already a way to do this?
On the green side pane, click on the little "Refresh" button. That submits api.php, which includes your current equipment, which will make the Gear Changer revert all its dropdowns to what you are currently wearing.
 

Veracity

Developer
Staff member
Well, I just coded up a change to submit an outfit change with "whichoutfit=last" - which is what CDM told me to use 3 years ago, but which failed. I reported the bug 3 years ago and got no response, but, on the off chance that they fixed the bug, I tried it again.

Same KoL bug.

So, I submitted a new bug report.

In the mean time, I'm considering coding up a hack to make that particular outfit use ChatSender to request "/outfit last", as slyz suggested. I expect that that will not work for characters who are not chat literate. Perhaps I can disable that entry in the dropdown in the Gear Changer.
 

Veracity

Developer
Staff member
Yes, that is why I specifically mentioned that.

Such characters will be out of luck; there is nothing we can do to let them do "outfit last" until/unless KoL fixes the bug I reported 3 years ago and again yesterday.
 

Nappa

Member
I would too. Perhaps, as slyz suggested, we could put in special code for (Your Last Outfit) which submits "/outfit last" to chat.

On the green side pane, click on the little "Refresh" button. That submits api.php, which includes your current equipment, which will make the Gear Changer revert all its dropdowns to what you are currently wearing.

Oh! I always thought the refresh button was meant for 'Refresh session', which seemed to me a bit overkill to use for just resetting my equipment to current. Thanks!
 

Veracity

Developer
Staff member
OK, another possibility:

Until KoL fixes the "whichoutfit=last" bug, every time we request Your Previous Outfit, we could request account_manageoutfits.php and look up what the current value of the outfit id is for that KoL-generated outfit.
 

Veracity

Developer
Staff member
Actually, that is the same number of requests as doing it via chat macro.

/closet 5-ball:

Requesting: http://www.kingdomofloathing.com/submitnewchat.php?pwd&playerid=121572&graf=%2Fcloset+5-ball
Retrieving server reply
ResponseText has 165 characters.
<font color=green>Closeting 1 5-ball.<!--js(dojax('inventory.php?whichitem=1904&pwd=b75864409da5242f03070b375670ec4d&action=closetpush&qty=1&ajax=1'); )--></font><br>

Requesting: http://www.kingdomofloathing.com/inventory.php?whichitem=1904&pwd&action=closetpush&qty=1&ajax=1
Retrieved: http://www.kingdomofloathing.com/inventory.php?whichitem=1904&pwd&action=closetpush&qty=1&ajax=1
ResponseText has 541 characters.
One 5-ball placed in your closet.

When you submit a chat macro, KoL responds with a JavaScript ajax call to the URL which will do what you want.
The browser (or KoLmafia) then submits the real request.

So, rather than making a chat request, we look at the custom outfit page and derive the required URL on our own, which we then submit.

I think I'll do that tomorrow. If KoL decides to fix its whichoutfit=last bug, we can eliminate one request. Otherwise, it's no worse than someone doing "/outfit last".
 

Ensiferum

Member
Erm... These changes seem to have removed an extremely useful previous feature, unless I'm missing something.

Up until r14865 trying to switch to an outfit you were missing pieces off resulted in this:
Code:
> outfit frat war

You need 1 more beer helmet to continue.
You need 1 more distressed denim pants to continue.
Unable to wear outfit Frat Warrior Fatigues.
This was an easy way to see if any parts or a full outfit is missing, then allow me to pull or farm whatever was needed without further investigation.

Now, if any piece or the entire outfit is missing, we see this:
Code:
> outfit frat war

No outfit found matching: frat war
 

Veracity

Developer
Staff member
I assume that was a bug introduced in all the "generics" refactoring I did to EquipmentManager.
I'll take a look.
 

Veracity

Developer
Staff member
A-yup. I converted a loop from a for to a foreach and switched from EquipmentDatabase.normalOutfits (which contains all KoL outfits) to EquipmentManager.normalOutfits (which contains those outfits we have all the pieces of).

Revision 14876
 
Top