Bug - Fixed Bang potions in mood get confused when ascending

Crowther

Active member
Sometime between ascending and identifying my bang potions again, my mood switches to the potion's KoL name. However, that doesn't always match the right potion, so when I use the mood later a potion is used every combat. Once it was potions of inebriation. (Thank Jick for synthetic dog hair)

lose_effect izchak's blessing => use 1 potion of blessing
lose_effect izchak's blessing => use 1 dark potion
lose_effect izchak's blessing => use 1 smoky potion

I tried to pin down exactly when this happens and failed. After ascending, my mood still said, "potion of blessing", but later in the day it switched to "smoky potion". The only think I can think of is it changed when I logged out and back in. The above "dark potion" probably got switched in a previous ascension. If I had to guess, this started happening a few weeks ago. It used to work just fine.
 

lostcalpolydude

Developer
Staff member
It wouldn't surprise me if the GUI doesn't update as soon as other stuff changes. I seem to remember there being a thread about this long ago, and maybe something was done to try to address that thread, or maybe not.
 

Crowther

Active member
It wouldn't surprise me if the GUI doesn't update as soon as other stuff changes. I seem to remember there being a thread about this long ago, and maybe something was done to try to address that thread, or maybe not.
I figured the same thing, but it wasn't just the GUI. Typing "mood" into the CLI still listed potion of blessed after I ascended. I'd cut and paste it all here, but it didn't go into my sessions file.
 
Mood commands can use the wrong bang potions across ascensions

I had "When I run low on Object Detection, use 1 potion of detection" set in one of my moods.

I guess my potion of detection had coincidentally remained the same the last few ascensions, because I hadn't noticed any trouble with this before. But today I accidentally overdrank because I didn't realize that Mafia changed my command to "When I run low on Object Detection, use 1 potion of inebriety" during this ascension.

Admittedly, this is a bit of a risky command to set, but it'd be really awesome if we could make it work - or at least avoid this problem by warning the user when potions change.

So I think there are two options: (1) Make Mafia change the backend of the command so it's actually using the right potion, even when that potion changes. I'm not sure how moods are actually handled, so maybe this is prohibitively complicated. Or (2) give some sort of warning, or remove the command from the mood, or etc, at ascension, so at least users will be protected from using the wrong potion accidentally.
 

Bale

Minion
Just though I'd mention, I use something like

  • When effect is lost
  • Check for: Izchak's Blessing
  • Command: ashq use(1, to_item("potion of blessing"))

That setting works fine after ascending any number of times. If this bug proves too intractable, you can make that the default command to increase turns of the various bang potions.
 
Last edited:
Very weird, Bale, but hopefully pretty helpful in diagnosing the actual problem, too.

Why could it be that ashq use() works, but regular use doesn't?
 

Theraze

Active member
As I said back in post 4 (and last July), this looks like the bug reported in 2011 which had been fixed by r10161 came back. If the same bug is indeed being reported as live again, then the r10161 fix should probably be re-examined and robustified. Ha. I made a word.

But to specifically talk to your question, before r10161, the item moods wouldn't clear when you ascended. They're supposed to.
 

Bale

Minion
Why could it be that ashq use() works, but regular use doesn't?

The trick isn't use(). The trick is using to_item("potion of blessing") to describe the necessary item. It translates as whatever is the correct potion in the current ascension.
 

Crowther

Active member
I feel like Bale's solution is cheating a bit, but if that's what mafia put in when I used the GUI to set up a buff, I'd be happy with that.
 
FYI for anyone using Bale's solution: if you haven't identified the Detection bang potion yet, Mafia will abort with an Unknown item ID -1 message. I thought the new build I'd just downloaded was bad, until this occurred to me.
 

Veracity

Developer
Staff member
Now that I just looked at mood triggers, I have some ideas about this, so I am bumping it.
 

Grabuge

Member
Is there a way to bypass the Unknown item ID-1. I don't want to erase that line every time I ascend and forget to add it again when I identify the potions. Even if I had to add a line to check if I know that potion recipe to my between battle script.
 

Veracity

Developer
Staff member
Note that this is a case where we, essentially, convert a name - an alias - into an ascension-specific item number. We don't want to do that: if your mood says "use 1 potion of blessing", we do NOT want to convert that into "use 1 smoky potion of blessing" or "use 1 smoky potion". Yes, we do want to make that conversion when we try to execute it, but we do not want to make that conversion at any other time. In particular, not when we save the mood to your mood configuration file.

This is a case where the ongoing "use item numbers internally" refactoring project needs to take care not to be applied too early. :)
 

Darzil

Developer
This is a case where the ongoing "use item numbers internally" refactoring project needs to take care not to be applied too early. :)

I hear you! Now we just have to hope I also remember to test and verify this when I get to that bit!
 

Veracity

Developer
Staff member
Here's the plan:

- When you select "Object Detection", for example, the default action is "use 1 potion of detection". Therefore, we want to keep that in the mood file.
- However, since the user can type in any action they desire, we normalize items by doing fuzzy matching, which will convert "pot of det" to "swirly potion of detection", for example. We need to convert that back to the normalized alias - "potion of detection"
- For that matter, existing mood files will have "use 1 swirly potion of detection" stored in them. When we read such a mood, we need to convert back to the alias - which will then be written correctly when we write the mood file. Perhaps we should automatically write the file if we did such a conversion when reading.
- When it is time to execute the mood, if you have not identified the "potion of detection" yet, we need to not fail on that. Perhaps the "use" command should have special knowledge of those aliases and not give a hard error when it cannot resolve them - although an error message would still be appropriate.
 
Top