So I've been having strange and intermittent problems (I usually only notice it on the L11 quest, since most of the rest of the scripts I use are home-grown and don't use zilb) with the obtain() function.
It seems to me that occasionally obtain() fails to recognize when it successfully pulls an item from storage.
I have modified my obtain() function with a whole mess of print statements thusly:
Observe the 'Stone Rose/Drum Machine' portion of the Macguffin quest:
Perhaps it is a problem with mafia's pull code itself?
It seems to me that occasionally obtain() fails to recognize when it successfully pulls an item from storage.
I have modified my obtain() function with a whole mess of print statements thusly:
Code:
// gets n (-existing) of cond, either by purchasing, pulling from Hangk's, or
// adventuring at the given location. also works with choiceadvs
boolean obtain(int n, string cond, location locale) {
vprint("Function obtain() ... Int: " + n + " condition: " + cond + " Locale: " + locale, "green", 2);
if (cond == "choiceadv") cli_execute("conditions clear; conditions add "+n+" choiceadv");
else {
if (retrieve_item(n, to_item(cond))) return vprint("You have " +n+ " " +cond+ ", no adventuring necessary.", "green", 2);
if (!in_hardcore() && storage_amount(to_item(cond)) > 0 && take_storage(n-have_item(cond),to_item(cond)))
return vprint("You have taken your needed items from storage.", "green", 2);
cli_execute("conditions clear");
add_item_condition(n - have_item(cond), to_item(cond));
}
set_location(locale);
vprint("Adventuring in " + locale + " now, in search of " + (n - have_item(cond)) + " " + cond, "green", 2);
if (adventure(my_adventures(), locale)) return vprint("Out of adventures.",-1);
if (cond == "choiceadv") return (my_adventures() > 0);
return (have_item(cond) >= n);
}
Code:
Request 3 of 148 (Beach: Desert (Ultrahydrated)) in progress...
[558] Desert (Ultrahydrated)
Encounter: A Sietch in Time
A Sietch in Time
Now finding a stone rose.
Function obtain() ... Int: 1 condition: stone rose Locale: Oasis in the Desert
You need 1 more stone rose to continue.
Conditions list cleared.
Condition added: stone rose
stone rose
Adventuring in Oasis in the Desert now, in search of 1 stone rose
Request 1 of 144 (Beach: Oasis in the Desert) in progress...
[559] Oasis in the Desert
Encounter: All Across the Sands
You acquire an item: stone rose
Conditions satisfied after 1 adventures.
Now fetching a drum machine.
Function obtain() ... Int: 1 condition: drum machine Locale: Oasis in the Desert
You need 1 more drum machine to continue.
Pulling items from storage...
14 pulls remaining,0 budgeted for automatic use.
Conditions list cleared.
Adventuring in Oasis in the Desert now, in search of 0 drum machine
Request 1 of 143 (Beach: Oasis in the Desert) in progress...
[560] Oasis in the Desert
Encounter: oasis monster
Strategy: kain.ccs [default]
>>combat<<
You gain 15 Beefiness
You gain 25 Wizardliness
You gain a Mysticality point!
You gain 11 Sarcasm
You're on your own, partner.
Perhaps it is a problem with mafia's pull code itself?
Last edited: