Feature - Rejected Return Item(s) needed for Making

bumcheekcity

Active member
If I type "make bartender-in" into the CLI, and I don't have the stuff, it might print something like "You need a smart skull". Is there any way we could get an ASH script items_needed_to_make($item[whatever]) to RETURN $item[smart skull] or something?

It doesn't have to be amazingly intelligent behaviour, just emulating the CLI where it only tells you one of the item(s) you need would be fine.
 

heeheehee

Developer
Staff member
Hmm. I'd imagine that something with comparing get_ingredients() to items in inventory would be the only way we can do this at the moment?
 

StDoodle

Minion
PHP:
int [item] reqd = get_ingredients($item[SOMETHING]);
foreach i in reqd {
  if (item_amount(i) < reqd[i]) print("You don't have enough: " + i.to_string());
}
Of course, you'll need to assign each "hit" from above to another map to get the recursive requirments... and careful of things like "wad of dough".... didn't this get covered somewhere? (No really, I could swear it did, but can't remember where...)
 

Winterbay

Active member
I think the recursiveness of wad of dough was handled in either the bat man thread or another thread regarding one of Zarqon's combat helping scripts.
 

heeheehee

Developer
Staff member
The recursiveness was in ZLib's new form of has_goal(). Here, I tried to explain it, and as you can see, a lot more objects are affected. I'm pretty sure this was related to the custom datafile, use_for_items, though (and how ZLib was interpreting it), but it might be present in get_ingredients(), as well.
 
Top