question about familiar/familiar equip functionality

it seems mafia has a "blind spot" when it comes to managing familiar equipment on familiars in the terrarium.

true or false: if I try to "equip mayflower bouquet" either from CLI or ash equivalent, and the mayflower bouquet is in use by another familiar in the terrarium, assuming that is the only bouquet I own, the request will fail.

"true" is the behavior I have observed, unless some other factor is munging things up.

with that in mind, I'd like to make a script to retrieve a piece of equipment off of a familiar in the terrarium. which seems it would require scanning all my familiars to see which, if any, has the equipment.

I don't see a "my_familiars()" function, so I thought I'd just start with a master list of familiars, compile a list of mine via have_familiar(), and then start scanning through them looking for the equipment.

What is the easiest way to get a master list of all familiars in kol in one's script?

I tried loading familiars.txt into a map but that wasn't working too hot. Before I spend hours debugging that / inventing a wheel, I just want to make sure there isn't some simpler way of doing this that I don't know about.
 

jasonharper

Developer
Equipment on a familiar in your terrarium should be available to satisfy requests; if "equip mayflower bouquet" is not working for you, please report that as a bug.

Loading familiars.txt into a map should have worked - what was the problem you saw? The alternative would be to loop over integers from 1 to 150 or so, using to_familiar() to get the corresponding familiar (hopefully numbers that don't correspond to an actual familiar will produce a value equal to $familiar[none] so that they can be ignored).
 

Camber

Member
Where does one find the familiars.txt file?

I've been doing the looping, but then i have to keep upping the number of familiars. Using a map of a file that mafia/KOL updates would be much better i think.
 

Bale

Minion
Where does one find the familiars.txt file?

It is inside kolmafia. Just file_to_map(mapfile, "familiars.txt") and the data will magically appear. Its data is in this format:
Code:
101	Sugar Fruit Fairy	stat0,item0	3578	tiny ballet slippers	0	3	3	2
102	Imitation Crab	combat	3598	imitation whetstone	3	1	2	2
103	Pair of Ragged Claws	combat	3628	radioactive chew toy	1	1	1	1
104	Magic Dragonfish	none	3648	fin-bit wax	1	1	2	0
105	Frumious Bandersnatch	none	3799	aquaviolet jub-jub bird	3	2	2	0
 
Equipment on a familiar in your terrarium should be available to satisfy requests; if "equip mayflower bouquet" is not working for you, please report that as a bug.

Loading familiars.txt into a map should have worked - what was the problem you saw? The alternative would be to loop over integers from 1 to 150 or so, using to_familiar() to get the corresponding familiar (hopefully numbers that don't correspond to an actual familiar will produce a value equal to $familiar[none] so that they can be ignored).

I guess it does work, in the best of circumstances. At times it has failed for me, though. Not exactly sure why. If I find something reproducible I'll report.
 

dj_d

Member
If you'd like to see the actual familiars.txt file format, rename a KOLMafia .jar to .zip and look inside. This is also a handy way to come up with ideas for scripts that you don't have time to write. :)
 
About that confusing/buggy functionality...

Given: my current familiar is wearing das boot.

I switch familiars from CLI or ASH, and mafia says: "das boot is better than (none). Switching items..."*

Then I run code like:
Code:
if ( familiar_equipment( my_familiar() ) != $item[ little bitty bathysphere ] &&
familiar_equipment( my_familiar() ) != $item[ das boot ] ) {
//equip the bathysphere
}
and the "if" evaluates to true and it equips the bathysphere.

This is with KoL's inbuilt familiar equipment locking disabled.

Not exactly sure if this is behavior is at the root of my previous issues but it seems worth a look. This is KM 13.1 public release.

*(On a tangent: das boot is certainly worse than nothing in non-underwater situations, so unless mafia has some truly reliable prescience about where I'm going to adventure, it shouldn't auto-transfer/auto-equip familiar diving equipment. Probably been reported and fixed by now anyway...)
 

jasonharper

Developer
familiar_equipment() returns the equipment item that's specific to that type of familiar; it has nothing to do with what that familiar has equipped at the moment, and doesn't even imply that you actually HAVE the item. It's not very useful anymore, now that we've got several familiars with multiple pieces of specific equipment.

familiar_equipped_equipment() is what you want to use here.
 
Top