*rand help, or randomness in general

I ended up figuring out how to get this working correctly. Rather than having them all being in the same *scene file, I split them in two and pretty much had to manhandle it a bit haha. This is how it ended up turning out:

scene = random_cards
*label startofreading
*comment Są to pierwsze możliwe z 26 kart. Dla drugiej i trzeciej opcji będzie również 26 do wyboru./ / /

*temp tarotcard

*if have_made_random_roll1 = false
 *rand tarotcard 1 10
 *set have_made_random_roll1 true

*if (tarotcard=1)
 *set t_fool true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=2)
 *set t_empress true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=3)
 *set t_lovers true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=4)
 *set t_hermit true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=5)
 *set t_hanged_man true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=6)
 *set t_devil true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=7)
 *set t_moon true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=8)
 *set t_world true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=9)
 *set ace_of_c true
 *gosub_scene cardsandmeaning
*elseif (tarotcard=10)
 *set a4_of_c true
 *gosub_scene cardsandmeaning
scene = cardsandmeaning
*if t_fool = true
	*goto t_fool
*elseif t_empress = true
	*goto t_empress
*elseif t_lovers = true
	*goto t_lovers
*elseif t_hermit
	*goto t_hermit
*elseif t_hanged_man
	*goto t_hanged_man
*elseif t_devil
	*goto t_devil
*elseif t_moon
	*goto t_moon
*elseif t_world
	*goto t_world
*elseif ace_of_c
	*goto ace_of_c
*elseif a4_of_c
 *goto a4_of_c

and then pretty much the *labels :slight_smile:

Thanks both of you for the help! I guess sometimes things have to be pushed and slapped around to work.

2 Likes