PDA

View Full Version : Conditions change request



senseihitokiri
10-07-2006, 07:39 PM
Would it be possible to have condition modified to not break a script once it's reached?* If you try to do, say the artist quest in one script. you could add conditions for each of the items in turn say...* *incoming pseudo code*


if item_amount palette < 1
* *add condition 1 palette
adventure * pantry

if item_amount paintbrush < 1
add condition 1 paintbrush
adventure * alley


as an example. I'm sure locations are not 100% accurate, they're just a quick example. Now once that first condition is hit the script breaks ( not like crash, but returns ) and stops execution. I'm left with defining my adventuring like this



while item_amount palette < 1
adventure 1 location


but I would really like to use the condition logic because I think it's "teh sex" :) Could this maybe be changed, or atleast add the functionality to do so on demand?

macman104
10-08-2006, 12:24 AM
Add all of your conditions at the beginning, and then adventure.
if itemcheck
add item condiiton
if item2check
add item2 condition
if item3check
add item3 condition
adventure * location_of_choice

efilnikufecin
10-08-2006, 04:03 AM
Add all of your conditions at the beginning, and then adventure.
if itemcheck
add item condiiton
if item2check
add item2 condition
if item3check
add item3 condition
adventure * location_of_choice


Ah but when you add conditions for 2 different areas as in the first post, then hit the first adventure * location_of_choice it will blow all of your adventures in that area trying to get the item you want from the other area.

senseihitokiri
10-08-2006, 04:27 AM
Ah but when you add conditions for 2 different areas as in the first post, then hit the first adventure * location_of_choice it will blow all of your adventures in that area trying to get the item you want from the other area.


Yea that's the problem there. The logic will never leave the first location because all conditions are not met there. It only leaves a location when the condition is hit, which is when the scripting system breaks the chain of execution.

holatuwol
10-08-2006, 05:18 AM
I'm not seeing what you're discussing here.




add_item_condition( 1, $item[goat cheese] );
adventure( my_adventures(), $location[Goatlet] );
add_item_condition( 1, $item[goat cheese] );
adventure( my_adventures(), $location[Goatlet] );



A CLI script which did the same thing also succeeded.

senseihitokiri
10-08-2006, 06:51 AM
I'm not seeing what you're discussing here.




add_item_condition( 1, $item[goat cheese] );
adventure( my_adventures(), $location[Goatlet] );
add_item_condition( 1, $item[goat cheese] );
adventure( my_adventures(), $location[Goatlet] );



A CLI script which did the same thing also succeeded.


When I did that, the CLI returned script succeeded right after the first location and did not proceed. I've rewritten them already to not use conditions, but I will try to recreate the problem again in the morning. I just logged 13 hours or so writting a library file and I'm about to pass out.