This is weird. Both of the following should work exactly the same:
There's no actual advantage to using the first form in this scenario (at least in theory, its main advantage would be when the variable is a container variable, though I seem to recall it not working at all for that case). But in principal there is no significant difference in what's happening between the two cases:
Here the
Code:
[set_variable]name=extra_fog_xformula="$this_item.x + $fog_range + 2"[/set_variable][set_variable]name=extra_fog_xvalue = "$($this_item.x + $fog_range + 2)"[/set_variable]
- First, substitute in the
$fog_range
variable. If the variable is not defined, that means deleting it to produce$this_item.x + + 2
. - Next, substitute in
$this_item.x
. If$this_item
is not defined, that means deleting it to produce+ + 2
. - Finally, evaluating the formula, which will give an error if it discovers invalid syntax.
Code:
[set_variable]name=extra_fog_xvalue = $($this_item.x + $fog_range + 2)[/set_variable]
+
means WML concatenation, so if it's working when you do it like that, that probably means that both $this_item
and fog_range
are undefined and the resulting value is always 2.Statistics: Posted by Celtic_Minstrel — Yesterday, 1:25 pm