may i ask, i’m new with these, but i wanna know if there is any code like these in choice script?
switch (case_var): case 1: Boy, kill yourself break; case2: Girl, GO GET EM! break;
or something
to shorten the goto and if or something like that?
if there is one, how do you implement it on the script?
do i do this?
*create case_var ""
*switch (case_var): case 1: Boy, kill yourself ; case2: Girl, GO GET EM! break
*if (case 1)
death
*go to a
*else
running away
*goto b
*finish
No. I mean, I remember playing around with it and got an error: “can’t use variable in *goto”, or something. At that time, I thought indirect label is no longer supported.
But it appears still does supported.
Wonder what happened last time.
*create index 0
*create branch ""
man i'm hungry…
*fake_choice
#Eat
*set index 1
#Maybe later...
*set index 2
#i guess i'll buy something along the way
*set index 3
*rand index 1 3
*set branch "@{index label_a|label_b|label_c}"
*goto {branch}
*label label_a
Option A
*finish
*label label_b
Option B
*finish
*label label_c
Option C
*finish
this is not how it work right? because i try it and choose the same ans but i get random index because the index already set to random… right?
btw the *if condition is working perfectly (without the implict control flow)
if i used *create implicit_control_flow
man i'm hungry…
*fake_choice
#Eat
*set condition1
#Maybe later...
*set condition2
#i guess i'll buy something along the way
*set condition3
*if (condition1)
i full now
*elseif (condition2)
i'm starving
*else
i have to eat these soon
*rand
Randomizes a number variable.
The 1 3 behind it tells the code what kind of die it shall roll, so to speak.
So 1 3 means a 3 sided die with 1 2 3
30 40 would mean 30 31 32 etc to 40.
If you use a choice you don’t need random.
(Ill add an example once im not on mobile)
the dice will be ten-sided, with the numbers between 30 and 40
*rand 1 30
would go from 1 to 30
as for your bit before:
if you want the bit to be random:
*create index 0
*create branch
*rand index 1 3
*set branch "@{index label_a|label_b|label_c}"
Man, I'm hungry.
*goto {branch}
*label label_a
I'll eat something
*page_break
*goto next
*label label_b
I'll eat something later
*page_break
*goto next
etc
if you want to let the player pick, you don’t need to the random bit:
Man I'm hungry.
*choice
#Eat something
*goto label_a
#Eat something later
*goto label_b
etc
and if it’s just a bit of text that then continues to the same bit:
Man I'm hungry
*fake_choice
#Eat something
You eat something.
#Eat something later
You decide to eat later.
#Buy something on the way
You know you'll need to buy something on the way.
Then you leave.
The above will result in the text going, for example