Forum rules - please read before posting.

Avoid Repetition in Variable - Check Random Number?

edited August 2017 in Technical Q&A
Hi! I'm making an adventure game with multiple generic dialogue responses to standard interactions like trying to open a locked door or pick up an object that can't be moved. I'm using Variable - Run Sequence elsewhere (for interactions where I want the responses in a specific order), but I'd rather avoid making extra variables for the generic stuff. I would, however, like to ensure that Variable - Check Random Number not choose the same random number (and therefore the same generic response) multiple times in a row. Is there a way to accomplish this?

I'm using Adventure Creator 1.57b and Unity 2017.


  • edited August 2017
    Welcome to the community, @Cranberry.

    Making variables for each Variable: Run sequence is necessary to ensure that the sequence order is stored in save game files.

    Though it could get quite complex if you had many options, you could feasible do this by using an Integer variable to record the last-picked random number, and then check against new random numbers to see if you should re-pick another one.

    However, I think having an option to not repeat the last-picked number in the Variable: Check random number Action would be a good addition to AC - and I'll see if it can be included officially.
  • I'd love to see this in a future version. For now I may just put up with the repetition (which is, after all, only on the generic stuff -- and one would hope a player won't try to pick up a tree over and over, for example), unless I find time to make and add more variables and run sequences. Thanks for the quick response!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.