use variables within set (1 Viewer)

Rudgar

Content Creator
Joined
Nov 18, 2016
Ahoy!

I working on a dialogue in which the user should be able to switch through some (in this case 3) different groups with different backgrounds in different subfolders. It starts with an initiating "group 0" and switches to the next until it reached the last one, from which it switches to "group 1" (not "group 0")

This is the code as far I got it yet.
Code:
start:"[BUTTON1_ON][grp]" {"set":{"grp":0, "da.button1.name":"Next"}}
button1:"[grp]" {"set":{"grp":"+1"}}
grp:"[HIDE_HER][HIDE_HAIR][grp*grp*]" 
grp0:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp0/BG.png"}}
grp1:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp1/BG.png"}}
grp2:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp2/BG.png"}}
grp3:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp3/BG.png"}}
grp4:"[grp]" {"set":{"grp":1}}
Nice, but ... I'd rather have it like this:
Code:
start:"[BUTTON1_ON][grp]" {"set":{"grp":0, "da.button1.name":"Next"}}
button1:"[grp*( grp > 3 )*]" {"set":{"grp":"+1"}}
grp1:"[grp*( grp > 3 )*]" {"set":{"grp":1}} 
grp0:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp*grp*/BG.png"}}
Is there a way to get this work somehow?

Thanks in advance and kind regards,
Me
 

Slingerbult

Content Creator
Joined
Sep 15, 2012
Yes there is, see the Dialogue Actions documentation, Operators.txt. You want the trigger [grp*grp >= 3*] which will return grp0 or grp1.
 

Rudgar

Content Creator
Joined
Nov 18, 2016
Ahoy, Slingerbult Slingerbult !
Yes there is, see the Dialogue Actions documentation, Operators.txt. You want the trigger [grp*grp >= 3*] which will return grp0 or grp1.
Ah, err, umm, no ... I think you misunderstood maybe. I wanted to replace this:
Code:
grp0:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp0/BG.png"}}
grp1:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp1/BG.png"}}
grp2:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp2/BG.png"}}
grp3:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp3/BG.png"}}
with this:
Code:
grp0:"[CHANGE_BACKGROUND][set_menu*grp*]" {"set":{"da.background.load":"Grp*grp*/BG.png"}}
You know what I mean?
Regards, Me
 

Rudgar

Content Creator
Joined
Nov 18, 2016
And the [CHANGE_BACKGROUND] is not even necessary anymore with this method. :wink:
It took me some time :oops::rolleyes: to really test it, but you're right actually: it works even without "[CHANGE_BACKGROUND]" now.
Thanks for sharing this information. :smile:
 

Rudgar

Content Creator
Joined
Nov 18, 2016
It took me some time :oops::rolleyes: to really test it, but you're right actually: it works even without "[CHANGE_BACKGROUND]" now.
Thanks for sharing this information. :smile:
Ummmm, :oops: I think I have to correct this statement.
it works even without "[CHANGE_BACKGROUND]" ONCE and ONLY ONCE.

After having set the variable this way it changes the background without the Trigger "[CHANGE_BACKGROUND]". After having used this that way, it does NOT work any more WITHOUT "[CHANGE_BACKGROUND]". Tough luck. :frown:

Respectfully, Rudgar
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.