Feature Item desc ids for pseudo-foods and pseudo-boozes

Veracity

Developer
Staff member
There is a variety of food and booze items that you can buy from a Cafe which you consume immediately. Since they never go into your inventory, they are pseudo items and do not have an itemid. They do, however, have a negative item identifier which can be used to look at an item description. KoLmafia does not store that anywhere. The pseudo items are in fullness.txt and inebriety.txt, so they show up on the Food and Booze panels, but if you right click and ask to see the Game Description, we can't find it, since we try to open whichitem=null.

I would like KoLmafia to have the descid for all the pseudo-item foods and booze. It would be nice to have a Food and Booze panel in the Internal Database to look at them. It would be nice if those that are still available (and still show up on the Food or Booze panels of the Item Manager) could show you the description when you right click.

(And I think that perhaps CafeRequest - especially CrimboCafeRequest - might be able to use the "pseudo item numbers".)

Here are all the currently assigned pseudo item foods and boozes

Food:

Peche a la Frog: desc_item.php?whichitem=-1_food
As Jus Gezund Heit: desc_item.php?whichitem=-2_food
Bouillabaise Coucher Avec Moi: desc_item.php?whichitem=-3_food

gumdrop chow mein: desc_item.php?whichitem=-7_food
candy cane pizza: desc_item.php?whichitem=-8_food
gingerbread stir-fry: desc_item.php?whichitem=-9_food

twigs and gravel: desc_item.php?whichitem=-10_food
shoots and leaves: desc_item.php?whichitem=-11_food
bowl of unidentifiable goo: desc_item.php?whichitem=-12_food

gingerbread massacre: desc_item.php?whichitem=-13_food
It Came From Beyond Dessert: desc_item.php?whichitem=-14_food
vampire cake: desc_item.php?whichitem=-15_food

Soylent Red and Green: desc_item.php?whichitem=-52_food
Disc-Shaped Nutrition Unit: desc_item.php?whichitem=-53_food
Gingerborg Hive: desc_item.php?whichitem=-54_food

Candy Cane Surprise: desc_item.php?whichitem=-61_food
Grimdrop Chow Mein: desc_item.php?whichitem=-62_food
Grimgerbread House: desc_item.php?whichitem=-63_food

Caviar Carbonara: desc_item.php?whichitem=-67_food
Halibut Alfredo: desc_item.php?whichitem=-68_food
Red Herring Velvet Cake: desc_item.php?whichitem=-69_food

CRIMBCO Reconstituted Gruel: desc_item.php?whichitem=-73_food
New and Improved CRIMBCO Reconstituted Gruel: desc_item.php?whichitem=-74_food
CRIMBCO Deluxe Reconstituted Gruel with Simulated Raisins: desc_item.php?whichitem=-75_food

Brussels Sprout Stir-Fry: desc_item.php?whichitem=-79_food
Carrot, Cabbage, and Kale Pizza: desc_item.php?whichitem=-80_food
Turnip and Rutabaga Pie: desc_item.php?whichitem=-81_food

Rainbow Spider Fun Roll: desc_item.php?whichitem=-85_food
Vegas Volcano Lava Roll: desc_item.php?whichitem=-86_food
Crazy Dragon Shogun Buddha Roll: desc_item.php?whichitem=-87_food

basic hot dog: desc_item.php?whichitem=-92_food
savage macho dog: desc_item.php?whichitem=-93_food
one with everything: desc_item.php?whichitem=-94_food
sly dog: desc_item.php?whichitem=-95_food
devil dog: desc_item.php?whichitem=-96_food
chilly dog: desc_item.php?whichitem=-97_food
ghost dog: desc_item.php?whichitem=-98_food
junkyard dog: desc_item.php?whichitem=-99_food
wet dog: desc_item.php?whichitem=-100_food
sleeping dog: desc_item.php?whichitem=-101_food
optimal dog: desc_item.php?whichitem=-102_food
video games hot dog: desc_item.php?whichitem=-103_food

Booze:

Petite Porter: desc_item.php?whichitem=-1_booze
Scrawny Stout: desc_item.php?whichitem=-2_booze
Infinitesimal IPA: desc_item.php?whichitem=-3_booze

eggnogtini: desc_item.php?whichitem=-4_booze
candycaine: desc_item.php?whichitem=-5_booze
braincracker sweet: desc_item.php?whichitem=-6_booze

fermented honey: desc_item.php?whichitem=-16_booze
moons-shine: desc_item.php?whichitem=-17_booze
gin: desc_item.php?whichitem=-18_booze

ecto-nog: desc_item.php?whichitem=-19_booze
hot toady: desc_item.php?whichitem=-20_booze
hot choculate: desc_item.php?whichitem=-21_booze

Cyder: desc_item.php?whichitem=-49_booze
Oil Nog: desc_item.php?whichitem=-50_booze
Hi-Octane Peppermint Jet Fuel: desc_item.php?whichitem=-51_booze

Grimacider: desc_item.php?whichitem=-58_booze
Isotope Nog: desc_item.php?whichitem=-59_booze
Mutagin 'n' Tonic: desc_item.php?whichitem=-60_booze

Gin and Herring: desc_item.php?whichitem=-70_booze
Black and Tan and Red All Over: desc_item.php?whichitem=-71_booze
Antarctic Ice Tea: desc_item.php?whichitem=-72_booze

CRIMBCO Ribbon Candy Schnapps: desc_item.php?whichitem=-76_booze
CRIMBCO Egg Substitute Nog Substitute: desc_item.php?whichitem=-77_booze
CRIMBCO Extreme Braincracker Sour: desc_item.php?whichitem=-78_booze

Horseradish-infused Vodka: desc_item.php?whichitem=-82_booze
Jerkitini: desc_item.php?whichitem=-83_booze
Desert Island Iced Tea: desc_item.php?whichitem=-84_booze

Crimbo Saketini: desc_item.php?whichitem=-88_booze
Crimboku Drop: desc_item.php?whichitem=-89_booze
Flaming Crimbo Log: desc_item.php?whichitem=-90_booze
 

Fluxxdog

Active member
This Feature Request might interest you. I'm not sure if it will eventually lead to negative items being available in ASH, but it does point out a hitch in that idea:

Peche a la Frog: desc_item.php?whichitem=-1_food
As Jus Gezund Heit: desc_item.php?whichitem=-2_food
Bouillabaise Coucher Avec Moi: desc_item.php?whichitem=-3_food

Petite Porter: desc_item.php?whichitem=-1_booze
Scrawny Stout: desc_item.php?whichitem=-2_booze
Infinitesimal IPA: desc_item.php?whichitem=-3_booze

So, which ones are items -1, -2, and -3, respectively?
That makes excellent sense. I'm looking at Items by number (negative) for reference. Those two sets of items are the only ones that overlap AND they're mutually exclusive in any single ascension. Could exceptions be programmed for that?

Maybe the issue shouldn't be using mock item numbers, but a different item type, like $fakeitem. It would be handled like an $item except for to_int($item). Though somehow I think that's a lot more work. Just conjecture. I may not be able to fully code, but I can at least give ideas.
 

Darzil

Developer
It'd also be nice if when available they could be considered as available as items so they could be used by Maximizer. Would be great to see "eat Ghost Dog" when you haven't eaten a Hot Dog, have 3 fullness spare and maximize "-combat"
 
Last edited:

Darzil

Developer
Actually I might look at whether when the action is eat or drink we look at whether it's in the same list of things we can consume from Food/Booze on the item manager, rather than whether we have the item, and then look at whether we can obtain the item afterwards. If that is possible (and reasonable) it should be a general handler for weird food/booze stuff.
 

ckb

Minion
Staff member
make virtual items as $items[]

There are a number of items in the game that can never be in inventory. VIP Hot Dogs and Speakeasy drinks are what come to mind immediately, but there are others.
This mostly applies to consumables that are consumed immediately on purchase.

It would be nice if Mafia had these as real $item[] entries. This would really help with scripting and relay scripts that handle these.
This way, they could be handled as other $item[] entries and manipulated without the need for special exceptions for specific NPC stores. Also, being able to access item.proxy info for each would be nice.

The strange thing about these items is they have no know item ID #. Maybe Mafia could create special numbers for these... negative numbers if it can handle that, or a very high number to separate them from standard items.

Thanks,
ckb
 

ckb

Minion
Staff member
YES! Pretty much exactly that. Thanks Darzil (and Veracity). Maybe we should merge these threads.

Thinking about this more:
buy(item) should return false for these items, as it will auto-consume as well.
 

ckb

Minion
Staff member
Bumping this as it seems that the Speakeasy drinks are now $items[].
However, the hotdogs are not.


Also - I have been in the woods for a week and a half and have not caught up with all the latest Mafia updates. Is there a plan to add the other "virtual" items?
 

Veracity

Developer
Staff member
As I understand it, Speakeasy drinks really ARE items - like the various maps you can buy from Big Brother - that you can't actually put in to inventory. Hot dogs and Cafe items (Chez Snootee, Micromicrobrewery, Crimbo Cafe ... ) are also virtual items, but don't have "positive" item numbers.

The "plan" is "eventual do this - but probably wait until the new 'official' point release, so as not to delay it by inserting instability". :)
 

Veracity

Developer
Staff member
Now that items have the itemId in the description text, I wrote a little ASH program to look them up:

Code:
record pseudo
{
    string descid;
    string name;
};

boolean [string] ids;

if ( !file_to_map( "pseudoin.txt", ids ) ) {
    abort( "bad input file" );
}

pseudo [int] pseudos;

foreach desc in ids {
    // print( "processing " + desc );
    string page = visit_url( "desc_item.php?whichitem=" + desc );
    matcher nmatcher = create_matcher( "<b>(.*?)</b>", page );
    if ( !nmatcher.find() ) {
	print( "descid '" + desc + "' has no name" );
	continue;
    }
    string name = nmatcher.group( 1 );
    matcher imatcher = create_matcher( "<!-- itemid: ([-0123456789]*) -->", page );
    if ( !imatcher.find() ) {
	print( "descid '" + desc + "' has no item id" );
	continue;
    }
    int itemId = imatcher.group( 1 ).to_int();

    if ( pseudos contains itemId ) {
	pseudo p = pseudos[ itemId ];
	print( "-> " + name + " (" + itemId + "), but " + p.name + " (" + itemId + ") already in map" );
    }
    pseudos[ itemId ] = new pseudo( desc, name );
}

map_to_file( pseudos, "pseudoout.txt" );
Given this input:

Code:
-1_food	true
-2_food	true
-3_food	true
-7_food	true
-8_food	true
-9_food	true
-10_food	true
-11_food	true
-12_food	true
-13_food	true
-14_food	true
-15_food	true
-52_food	true
-53_food	true
-54_food	true
-61_food	true
-62_food	true
-63_food	true
-67_food	true
-68_food	true
-69_food	true
-73_food	true
-74_food	true
-75_food	true
-79_food	true
-80_food	true
-81_food	true
-85_food	true
-86_food	true
-87_food	true
-92_food	true
-93_food	true
-94_food	true
-95_food	true
-96_food	true
-97_food	true
-98_food	true
-99_food	true
-100_food	true
-101_food	true
-102_food	true
-103_food	true
-1_booze	true
-2_booze	true
-3_booze	true
-4_booze	true
-5_booze	true
-6_booze	true
-16_booze	true
-17_booze	true
-18_booze	true
-19_booze	true
-20_booze	true
-21_booze	true
-49_booze	true
-50_booze	true
-51_booze	true
-58_booze	true
-59_booze	true
-60_booze	true
-70_booze	true
-71_booze	true
-72_booze	true
-76_booze	true
-77_booze	true
-78_booze	true
-82_booze	true
-83_booze	true
-84_booze	true
-88_booze	true
-89_booze	true
-90_booze	true
this was the gCLI output:

> pseudo.ash

-> Peche a la Frog (-1), but Petite Porter (-1) already in map
-> As Jus Gezund Heit (-2), but Scrawny Stout (-2) already in map
-> Bouillabaise Coucher Avec Moi (-3), but Infinitesimal IPA (-3) already in map
and this was the output file:

Code:
-103	-103_food	video games hot dog
-102	-102_food	optimal dog
-101	-101_food	sleeping dog
-100	-100_food	wet dog
-99	-99_food	junkyard dog
-98	-98_food	ghost dog
-97	-97_food	chilly dog
-96	-96_food	devil dog
-95	-95_food	sly dog
-94	-94_food	one with everything
-93	-93_food	savage macho dog
-92	-92_food	basic hot dog
-90	-90_booze	Flaming Crimbo Log
-89	-89_booze	Crimboku Drop
-88	-88_booze	Crimbo Saketini
-87	-87_food	Crazy Dragon Shogun Buddha Roll
-86	-86_food	Vegas Volcano Lava Roll
-85	-85_food	Rainbow Spider Fun Roll
-84	-84_booze	Desert Island Iced Tea
-83	-83_booze	Jerkitini
-82	-82_booze	Horseradish-infused Vodka 
-81	-81_food	Turnip and Rutabaga Pie
-80	-80_food	Carrot, Cabbage, and Kale Pizza 
-79	-79_food	Brussels Sprout Stir-Fry
-78	-78_booze	CRIMBCO Extreme Braincracker Sour
-77	-77_booze	CRIMBCO Egg Substitute Nog Substitute
-76	-76_booze	CRIMBCO Ribbon Candy Schnapps
-75	-75_food	CRIMBCO Deluxe Reconstituted Gruel with Simulated Raisins
-74	-74_food	New and Improved CRIMBCO Reconstituted Gruel
-73	-73_food	CRIMBCO Reconstituted Gruel
-72	-72_booze	Antarctic Ice Tea
-71	-71_booze	Black and Tan and Red All Over
-70	-70_booze	Gin and Herring
-69	-69_food	Red Herring Velvet Cake
-68	-68_food	Halibut Alfredo
-67	-67_food	Caviar Carbonara
-63	-63_food	Grimgerbread House
-62	-62_food	Grimdrop Chow Mein
-61	-61_food	Candy Cane Surprise
-60	-60_booze	Mutagin 'n' Tonic
-59	-59_booze	Isotope Nog
-58	-58_booze	Grimacider
-54	-54_food	Gingerborg Hive
-53	-53_food	Disc-Shaped Nutrition Unit
-52	-52_food	Soylent Red and Green
-51	-51_booze	Hi-Octane Peppermint Jet Fuel
-50	-50_booze	Oil Nog
-49	-49_booze	Cyder
-21	-21_booze	hot choculate
-20	-20_booze	hot toady
-19	-19_booze	ecto-nog
-18	-18_booze	gin
-17	-17_booze	moons-shine
-16	-16_booze	fermented honey
-15	-15_food	vampire cake
-14	-14_food	It Came From Beyond Dessert
-13	-13_food	gingerbread massacre
-12	-12_food	bowl of unidentifiable goo
-11	-11_food	shoots and leaves
-10	-10_food	twigs and gravel
-9	-9_food	gingerbread stir-fry
-8	-8_food	candy cane pizza
-7	-7_food	gumdrop chow mein
-6	-6_booze	braincracker sweet
-5	-5_booze	candycaine
-4	-4_booze	eggnogtini
-3	-3_food	Bouillabaise Coucher Avec Moi
-2	-2_food	As Jus Gezund Heit
-1	-1_food	Peche a la Frog
Observations:

1) Unsurprisingly, if the descId is "-X_food" or "-X_booze", the itemId is -X.
2) Unfortunately, there are both food and booze with itemId -1, -2, and -3
3) Almost as unfortunately, KoLmafia uses itemId -1 as the generic "not a real item".

Now, I suppose we could use id 0 to mean "no id", positive id for real (or virtual, in some cases) items, and negative id to refer to these pseudo items, but observation 2 says that is still insufficient, since there are multiple items with the same item ID.

So, confirming that KoL's negative itemId is what we actually see in the descid to look at pseudo items doesn't really help much.
 

Theraze

Active member
Since it appears they only duplicated on the first 3 cafe items, and you can only have either Canadia or the beach unlocked, might this be something where mafia considers the 'appropriate' item to be a valid pseudo-item and ignores the other as invalid? Or is that simply a lot of busy-work for not enough benefit?
 

xKiv

Active member
That's confusing (the same ID doesn't refer to the same thing, which may not look like a problem until you consider that the id can be stored in a file, printed in a log, used in a script to refer to a particular item, ...), future-prone (you can't guarantee that these 3 will be the only 3 to ever overlap) and doesn't solve the problem that -1 mean "none" to mafia.
I also don't particularly like the idea of copying kol's numeric IDs for everything except 0 (who knows when kol will use 0, and for what).
 

lostcalpolydude

Developer
Staff member
I think Jick actually prefers using real items for stuff in shops now even if you can't actually get the items, so I don't think future-proofing this for later items is an issue.
 

Darzil

Developer
I'm tempted to revisit this rather than write a load of code to return proper types of pseudo items so that filters work. Given a choice I'd prefer to try to make this work than to add more kludges.

I see no particular reason to keep the KoL number for these numbers. Some possible approaches :
Add -1000 for food, -2000 for booze, -3000 for Mafia decided (eg Potion of Detection) - should mean unique numbers. Could be an issue if we anywhere use a test if itemId < 0 for detecting non-items, but I guess most such checks will fail anyway.
Add 0 for food, -1000 for booze, -2000 for Mafia decided, and use 0 rather than -1 for no match - probably not, too much code to find and resolve.
Add 100000 for food, 101000 for booze, 102000 for Mafia decided, and never worry about whether existing code checks for ItemId < 0 or = -1.
Assign a number 100 and above for each restaurant and multiply by 1000 before adding the id. Lets us identify the source clearly. Probably start Mafia assigned at 200000. Not sure this is really needed.

Thoughts ?
 
Top