Bug SMOOCH appearance rates sometimes starts off wrong

phreddrickk

Active member
I've noticed something a little odd.

At the beginning of the day, after rollover, I see these results from appearance_rates:

Code:
> js appearanceRates(Location.get("The SMOOCH Army HQ"))

Returned: aggregate int [string]
Deuce Freshly => 0
Geve Smimmons => 0
Pener Crisp => 0
Raul Stamley => 0
SMOOCH general => 33.333333333333336
SMOOCH private => 33.333333333333336
SMOOCH sergeant => 33.333333333333336
none => 0

> get _smoochArmyHQCombats

0

This seems inconsistent with the logic from gausie's PR about this.

It corrects itself when my location is set to smooch, and remains fixed thereafter:


Code:
> js setLocation(Location.get("The SMOOCH Army HQ"))

Preference nextAdventure changed from Barf Mountain to The SMOOCH Army HQ
Returned: null

> js appearanceRates(Location.get("The SMOOCH Army HQ"))

Returned: aggregate int [string]
Deuce Freshly => 0
Geve Smimmons => 0
Pener Crisp => 0
Raul Stamley => 0
SMOOCH general => 0
SMOOCH private => 100
SMOOCH sergeant => 0
none => 0

> js setLocation(Location.none)

Preference nextAdventure changed from The SMOOCH Army HQ to None
Returned: null

> js appearanceRates(Location.get("The SMOOCH Army HQ"))

Returned: aggregate int [string]
Deuce Freshly => 0
Geve Smimmons => 0
Pener Crisp => 0
Raul Stamley => 0
SMOOCH general => 0
SMOOCH private => 100
SMOOCH sergeant => 0
none => 0
 
Seems like that doesn't work for me
Code:
> js setLocation(Location.get("The SMOOCH Army HQ"))

Preference nextAdventure changed from The Dire Warren to The SMOOCH Army HQ
Returned: null

> js appearanceRates(Location.get("The SMOOCH Army HQ"))

Returned: aggregate int [string]
Deuce Freshly => 0
Geve Smimmons => 0
Pener Crisp => 0
Raul Stamley => 0
SMOOCH general => 33.333333333333336
SMOOCH private => 33.333333333333336
SMOOCH sergeant => 33.333333333333336
none => 0

> prefref smooch

Name    Value    Default    Scope

_smoochArmyHQCombats    0    0    user

Preference lastAdventure changed from The Dire Warren to The SMOOCH Army HQ

[83] The SMOOCH Army HQ
Preference lastEncounter changed from Have a Boxing Daydream to An Introductory SMOOCH
Encounter: An Introductory SMOOCH

> js appearanceRates(Location.get("The SMOOCH Army HQ"))

Returned: aggregate int [string]
Deuce Freshly => 0
Geve Smimmons => 0
Pener Crisp => 0
Raul Stamley => 0
SMOOCH general => 33.333333333333336
SMOOCH private => 33.333333333333336
SMOOCH sergeant => 33.333333333333336
none => 0

> version

KoLmafia r28564

then i adventured once to see if it would make a difference

Code:
> prefref smooch

Name    Value    Default    Scope

_smoochArmyHQCombats    1    0    user

> js appearanceRates(Location.get("The SMOOCH Army HQ"))

Returned: aggregate int [string]
Deuce Freshly => 0
Geve Smimmons => 0
Pener Crisp => 0
Raul Stamley => 0
SMOOCH general => 33.333333333333336
SMOOCH private => 33.333333333333336
SMOOCH sergeant => 33.333333333333336
none => 0
 
appearance_rates has a two-parameter version. if you want stateful results, specify `true` as the second argument.

This forces Mafia to call AreaCombatData.recalculate(), which in turn calls the code in adjustConditionalWeighting in the linked PR. Once recalculate() is called (one way or another), then the conditional appearances will be updated (note that it won't necessarily be refreshed regularly!).

Regarding the discrepancy between Rinn's and phreddrickk's experience with set_location: one of the things that runs AreaCombatData.recalculate() is the location details panel in the GUI. I have verified that running set_location causes the update when running with the GUI, and does not when running in CLI mode.
 
Back
Top