Hello guys! I’m working on my book and I was wondering how people make those systems where you can select an option to “reroll” names?
Do you mean there’s a large list of names and they’re presented with some random options from that list, with the ability to ask for some new random options?
1 Like
If you’re asking what I think you’re asking then try this.
[In startup]
*create name1 ""
*create name2 ""
*create name3 ""
*create names 0
[In a text file]
You're running for the bus, you're going to be late if you don't hurry up.
*rand names 1 3
*page_break Get on!
*if (names = 1)
*set name1 "Bill"
*set name2 "Ben"
*set name3 "Bob"
*goto friends
*elseif (names = 2)
*set name1 "Jack"
*set name2 "Jill"
*set name3 "Jane"
*goto friends
*else
*set name1 "Pooh"
*set name2 "Piglet"
*set name3 "Christopher"
*goto friends
*label friends
You climb on board only to find most seats have been taken and you're forced to sit next to ${name1} and opposite ${name2} and ${name3}.
EDIT: just an FYI the *rand command is always best to go before you need it and before a page_break as the way it works if its on the same page it will reroll everytime you hit the page from the stat screen.
3 Likes
Yes!
The person above has outlined a very effective method of doing this, but I’ll add a link to a very helpful post about randomizing arrays.
It’s from before the current way arrays work, but the principles are still functional.
I am using something similar. I’ll post an example when I’m back at my computer, with my files.
1 Like