Quantcast
Channel: The Battle for Wesnoth Forums
Viewing all articles
Browse latest Browse all 1980

WML Workshop • Re: WFL formula error FIXED

$
0
0
This is weird...
I agree.

Just tested the following code:

Code:

# Test formula alternatives  [event]    name=side 1 turn 1    {VARIABLE v1 1}    {VARIABLE v2 2}{DEBUG_MSG (_"v1=$v1 and v2=$v2, about to compare formulas for v1+v2+2")}    [set_variable]      name=fa      formula="$v1 + $v2 + 2"    [/set_variable]{DEBUG_MSG (_"Formula ""v1+v2+2"" produced ""$fa""")}    [set_variable]      name=fb      formula="$($v1 + $v2 + 2)"    [/set_variable]{DEBUG_MSG (_"Formula with dollarsign and brackets produced ""$fb""")}    [if]      {VARIABLE_CONDITIONAL fa equals $fb}      {VARIABLE_CONDITIONAL fa numerical_equals $fb}    [then]{DEBUG_MSG (_"Match")}    [/then]    [else]{DEBUG_MSG (_"Ooops")}    [/else]    [/if]  [/event]
$fa=$fb=5 and "Match" reported so there was something about my code in the original setting that was different/broken.

The scenario code is inside a macro and executes several nested events deep.
It's also inside a foreach loop and $this_item is, I guess, a container variable?


I could try the old format again in the "live" code and see if I still get the same issue, but I can't do it right now as I'm busy making a mess of writing another scenario that uses the same logic and I'm not in a position to quickly playtest this right now. Will be much easier when this scenario is completed and thoroughly playtested (so hopefully before Christmas :) ).

Thanks for your post, much appreciated.

Cheers!
-- Spannerbag

Statistics: Posted by Spannerbag — Today, 10:20 am



Viewing all articles
Browse latest Browse all 1980

Trending Articles