Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Proper way of setting variables with click macros?

So I am trying to set a variable with a click command. I am using this:
<<click $LinkString>><<replace "#miniscene">><<display "Combat1">><</replace>><<set $acombattarget to 1>><</click>>

However this isn't setting the variable properly. Any idea's? I'm using Sugarcube 2.

Comments

  • If you want to use the changed value of $acombattarget within the "Combat1" passage then you need to move the <<set>> macro to before the <<display>> macro.
    <<click $LinkString>><<set $acombattarget to 1>><<replace "#miniscene">><<display "Combat1">><</replace>><</click>>
    
  • greyelf wrote: »
    If you want to use the changed value of $acombattarget within the "Combat1" passage then you need to move the <<set>> macro to before the <<display>> macro.
    <<click $LinkString>><<set $acombattarget to 1>><<replace "#miniscene">><<display "Combat1">><</replace>><</click>>
    

    Well now I feel like an idiot lol. Thank you kindly.
Sign In or Register to comment.