Random scene

Hi so I’m trying to make a scene where you go on a journey for 7 days and on each day there is a random option that occurs. For instance nothing happened today, or you found something on the side of the road. Now I know that’s possible,but along with that I want to disable that thing after it occurs so instead of 7 thing that could occur, there would be 6. If I need to word this different please me know thanks.

1 Like

When you say disable, what do you mean? That it can happen only once in a week?

Yeah kinda. So there’s 7 days and 7 different things that could happen throughout the week and once you exhaust one of the options you only get 6 the next day and the 5 and so on

I would say, and I’m no master of choicescript. have a true/false variable for each scene lets use this for example (SceneOneUsed). whenever you get that scene, after your choices it sets it to true. and whenever you get a scene picked it checks to see if its been use, if it has then it rerolls.

to roll/randomize stuff you should use the *rand. to learn more about it heres the choicescript wiki page for it https://choicescriptdev.fandom.com/wiki/Rand

have each scene corresponds to a number so SceneOne = 1.

This is how I would do the code

*temp scene 0
(This variable  is used to check what scene is picked)
*label sceneroll
*rand scene 7
(it gets 1)
*if scene = 1
 *goto scene1

*label scene1
*if scene1used = true
 *goto sceneroll
 (whatever the scene is)
  #(whatever the Choice is)
    (effects of choice)
    *set scene1used true
    *goto sceneroll

I hope that makes sense

1 Like

Ok I’ll give it a try thank you


Its like This? :point_left:t5:

If yes. Here Is The Code Its pretty tricky to
shuffle an array of nonrepeatable keys. but it can be done with the help of strings.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.