unfulfilled conditions

tebee

Member
If I set a condition and adventure for "x" turns in a location , if the condition is not satisfied at the end of those turns a script will stop. Is there a way of getting it to continue on regardless? - it would be nice if I could tell if it had been successful or not, but this is not vital.

In case anybody wonders what I am doing that might cause me to need this, I'm looking for semi-rares based on the turn count from finding the last one and it's possible I may have missed it already.

Tom
 

zarqon

Well-known member
Capture the result of the adventure() function, like this:

PHP:
add_item_condition(X, something);
if (adventure(Y, someplace)) {
  print("You didn't satisfy the conditions.");
}

adventure() returns true if it completes Y adventures. That means if it stops due to satisfied conditions it will return false.

Regardless of how you handle the return value, as long as your script checks the return value (probably using if or while) the auto-abort will not be triggered, and your script will keep going.
 

tebee

Member
Thanks that's solved my little problem - one other thing I discovered was it's advisable to do a cli_execute("conditions clear"); as well as the print statement as otherwise it will still be looking for whatever you have not found when you next adventure somewhere else and the probability is it doesn't drop there!

Tom
 
Top