parameters with mzscript -> %{\1} Thread last updated on 2004-05-06 16:13:26

Posted by member 12798 on 2004-05-04 18:17:12

can anybody tell me why this does not work? the parameters definitely contain values, i can see their content via !alert...
works when called manually. i have absolutely no clue...?!

*Script exec !LabelMove Fish %{\2} %{\3}


mzscript 0.9beta12 btw.

Posted by member 99 on 2004-05-04 22:49:57 link

If you call another (nested) mzscript bang before that, it will wipe out the parameters for the current one. Only thing I can think of... Unless you've got a !VarSet \2 in there someplace, but that'd be too strange and obvious.

Did you try an !alert in exactly the same place in the script? Or better yet, use !alert '!LabelMove Fish %{\2} %{\3}' ?

Posted by member 12798 on 2004-05-05 03:08:20 link

in fact, it's like this:
*Script bang !SetFishSize
*Script exec !SetFishSetting vFishSize %{\1}
*Script exec !ifeval ("%{%#FishMinimumSize%#}" > "%{\1}") {!SetFishSetting vFishSize "%{%#FishMinimumsize%#}"}
*Script exec !SetupModules %{vFishSize}
*Script exec !LabelRefresh Fish FishImage fish%{vFishSize}.png
*Script ~bang

; !SetupFish
*Script bang !SetupFish
*Script exec !SetFishSize %{\1}
*Script exec !LabelMove Fish %{tx} %{\3}
*Script ~bang

*Script start !SetupFish $FishStartSize$ $FishStartX$ $FishStartY$

i've many bangs calling other bangs with parameters... thought it would work like programming languages do.

is the any way of getting around this elegantly? the only one i can think of is to set a lot of mzscript vars, yet in a way based on structural depth, so it is kind of dynamic (if you know what i mean... hm... :D).

Posted by member 7 on 2004-05-06 15:34:36 link

Afaict you can only use temporary variables with the 0.9 betas.

Posted by member 12798 on 2004-05-06 16:13:26 link

thanks, but RabidCow has already helped me out (potentially :D ) (see http://www.litestep.net/index.php?section=4&action=view&catId=7&id=3459)