try operations

Users who are viewing this thread

svaucher

Veteran
I've been playing around with the try operations, but I haven't understood the parameter especially with else_try operations. Is it an identifier?:

I've done something like this

Code:
(try_begin, 0),
    (party_is_active, CURRENT_MESSENGER_VAR),
    (val_add, "$messengers_used", 1),
(else_try, 0),
    (eq, CURRENT_MESSENGER_VAR, NO_MESSENGER),
    (val_add, "$messengers_available", 1),
(else_try, 0),
    (call_script, "script_messenger_killed"),
    (val_add, "$messengers_killed", 1),
(end_try, 0)

I don't understand why both the first statements ($messengers_used incremented) and the last are executed ($messengers_killed).
 
I've had enormous problems with the try operations.

And I've found the party_is_active operation is very treacherous. At least that what is seems in my completely amateristic opinion. I've found that if a party was "never created", then it tends to conclude that "party_is_active" to be true.
 
Just a suggestion (haven't tested it myself), what about:

Code:
(try_begin, 0),
    (party_is_active, CURRENT_MESSENGER_VAR),
    (val_add, "$messengers_used", 1),
(else_try, 0),
  (try_begin, 0),
    (eq, CURRENT_MESSENGER_VAR, NO_MESSENGER),
    (val_add, "$messengers_available", 1),
  (else_try, 0),
    (call_script, "script_messenger_killed"),
    (val_add, "$messengers_killed", 1),
  (end_try, 0)
(end_try, 0)

Reasoning being that else_try might not be usable twice. Does this work?
 
I'm betting Fisheye has the right idea.
I've used simple try_begin and end_try, but haven't had reason to use else_try in the mix myself. For my purposes, multiple try_begin and end_try work exactly as they should; therefore the problem seems to be with else_try.
If Fisheye's idea is correct, it's still something Armagan would do well to improve at some point.
 
Try operations are hosed. They dont work right and Armagan advised me not to use else_try until the next version fixes them. I think his words were, "badly bugged".
 
Well, must just be the else_try (possibly try_for_range as well, haven't used it) that's got problems. Try_begin and end_try seem to work well for a script to execute multiple commands instead of cutting off the whole script as soon as it reaches something that evaluates false.
 
Thanks you all for the heads' up for the else_try. I guess I'll hack at it some more :roll: :D

Khalid, thanks for the info for party_is_active, I thought it was acting a bit weird.
 
Back
Top Bottom