Bug - Cannot Reproduce r20764 creatable_amount counts available amount

taltamir

Member
This appears to be a recent-ish change as I know it used to work correctly some time ago
but now creatable_amount returns item_amount + cretable_amount not just how many we can create.

for example
Code:
> ash creatable_amount($item[gimlet])

Returned:    2

> ash create(1, $item[gimlet]);
...
Successfully created gimlet (1)
Returned: true

> ash creatable_amount($item[gimlet])

Returned:    2

> ash create(1, $item[gimlet]);
...
Successfully created gimlet (1)
Returned: true

> ash create(1, $item[gimlet]);

Verifying ingredients for gimlet (1)...
You need 1 more little    paper umbrella to continue.
Returned: false

> ash creatable_amount($item[gimlet])

Returned:    2
as you can see regardless of whether cretable amount is 0, 1, or 2 it always returns 2 because it adds item amount to createable amount.

This change throws off various code that was designed with the two being seperate. such as counting the number of white pixels or healing potions for the shadow by adding the inventory amount plus the creatable amount. Now any such code will be counting the inventory amount twice

It also throws off cases where we try to create quest items like the complete mcclusky file if it is cretable, but now it says it is cretable even if it is already created which causes it to error out when trying to craft it. such code would have to be changed to checking if it is creatable but also not currently in inventory.
 
Last edited:

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
No idea what would have changed this
 

taltamir

Member
I will try some more testing to see if I can isolate a specific commit as the cause.
Also just in case, so far I encountered it while I was in QT path, I will do further testing to try to isolate it further
 

taltamir

Member
ok this is getting weirder. creatable_amount does not seem to recognize that the nash crosby still has been used up for the day. so it is showing creatables even when there are none. And I am having harder time figuring out what is going on with it. ill drop the log of my latest experiment and return to this tomorrow when i am rested

Code:
> ash creatable_amount($item[gimlet])

Returned:    0

> ash create(1, $item[gimlet]);

Verifying    ingredients for gimlet (1)...
You need 1 more little    paper umbrella to continue.
Returned: false

>    ash creatable_amount($item[mon tiki])

Returned: 2

>    ash create(1, $item[mon tiki]);

Verifying ingredients for    Mon Tiki (1)...
Verifying ingredients for caipifruta (1)...
Verifying    ingredients for kiwi (1)...
Creating 1 kiwi...
Still    upgrading was unsuccessful.
Returned: false

>    ash creatable_amount($item[mon tiki])

Returned: 2

>    ash create(1, $item[mon tiki]);

Verifying ingredients for    Mon Tiki (1)...
Verifying ingredients for caipifruta (1)...
Verifying    ingredients for kiwi (1)...
Creating 1 kiwi...
Still    upgrading was unsuccessful.
Returned: false

>    pull mon tiki

Pulling items from storage...
11 pulls    remaining, 0 budgeted for automatic use.

> ash    creatable_amount($item[mon tiki])

Returned: 2

>    ash create(1, $item[mon tiki]);

Verifying ingredients for    Mon Tiki (1)...
Verifying ingredients for caipifruta (1)...
Verifying    ingredients for kiwi (1)...
Creating 1 kiwi...
Still    upgrading was unsuccessful.
Returned: false

>    inv kiwi

> pull kiwi

Pulling    items from storage...
10 pulls remaining, 0 budgeted for automatic use.

>    ash creatable_amount($item[mon tiki])

Returned: 2

>    ash create(1, $item[mon tiki]);

Verifying ingredients for    Mon Tiki (1)...
Verifying ingredients for caipifruta (1)...
Creating    caipifruta (1)...
You acquire an item: caipifruta
Successfully    created caipifruta (1)
Creating Mon Tiki (1)...
You acquire an item:    Mon Tiki
Successfully created Mon Tiki (1)
Returned: true

>    ash creatable_amount($item[mon tiki])

Returned: 2

>    refresh all

Loading character status...
Refreshing    session data...
Synchronizing moon data...
Retrieving character    data...
Updating inventory...
Examining Meat in closet...
Updating    closet...
Retrieving quest data...
Preference relayCounters changed    from 634:Fortune Cookie:fortune.gif:518:Quantum Familiar    loc=*:minihipster.gif to 634:Fortune Cookie:fortune.gif
Preference    relayCounters changed from 634:Fortune Cookie:fortune.gif to 634:Fortune    Cookie:fortune.gif:518:Quantum Familiar loc=*:minihipster.gif
Preference    _nextQuantumAlignment changed from 613501 to 613503
Retrieving    campground data...
Examining Meat and pulls in storage...
Updating    storage...
You are currently a member of Ferengi Commerce Authority
Seeing    what's still unrestricted today...
Done checking allowed items.
Session    data refreshed.

> ash    creatable_amount($item[mon tiki])

Returned: 2
 

fronobulax

Developer
Staff member
I can't reproduce.

I can't think of things that have changed in the code.

But some of the drinks do require Advanced Cocktail crafting and there have been issues where the available skills are not recognized.

Similarly there are always little edge cases where the inventory seems to get out of synch.

Can it be reproduced with an item that does not require the Still?
 

taltamir

Member
I can't reproduce.

I can't think of things that have changed in the code.

But some of the drinks do require Advanced Cocktail crafting and there have been issues where the available skills are not recognized.

Similarly there are always little edge cases where the inventory seems to get out of synch.

Can it be reproduced with an item that does not require the Still?
I initially had this bug with
create(1, $item[McClusky file (complete)]);
suddenly failing to create because creatable amount was counting inventory amount.

I gave still examples because they were easier to do the quest item of the mcluskly file.
I will try to find a superior item to act as an example
 
Last edited:

fronobulax

Developer
Staff member
I gave still examples because they were easier to do the quest item of the mcluskly file.
I will try to find a superior item to act as an example

OK.

I ask because there are skills issues when leaving ronin or when entering aftercore that could contribute. There are sometimes special handling for creation of quest items - automatically create the Talisman and the McClusky file (complete) when all the ingredients are present and so on - that could be a factor. Maybe the inventory is out of synch?

Basically since the "obvious" code hasn't been changed in several years we need to look somewhere less obvious.
 

taltamir

Member
Alright. Trying to reproduce it in aftercore with white pixel does not work. I am starting to think that maybe what happened was:
1. I had an inv desync issue with the mcclusky file
2. when testing to confirm the issue is as I chose to test gimlet and mon tiki, both easy to craft mid run, but both are also still dependent which seems to have its own set of issues with createable amount.
 
Top