Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Random Variables

11 years ago

So, what I'm wondering is if it's possible to make sure that once a random event occurs, it won't occur a second time. Let's say I have a 40-sided dice, and it rolls a 12. Is there a way to make absolutely sure that 12 cannot and will not be rolled again? Or maybe a system to force it to exhaust all possible outcomes before it can be re-rolled?

Random Variables

11 years ago

Nope.

But if you explain what you want a bit more, we might be able to come up with another way of doing it.

Random Variables

11 years ago

I'm trying to make it so that there are a certain amount of random events in each visitable area of my story. They're going to be decently uncommon, so they won't exactly occur every other visit. However, I don't want the events to loop or anything. That would get boring and repetitive, and the whole point is to spice things up a little. And the events can't just be scripted and placed normally; I'm trying to make it so that it's a different experience every time a 'new game' is started.

Random Variables

11 years ago

Yeah, unfortunately there's no way to exclude a number, but you can make it so if the number is rolled, you treat it as if it wasn't.

For example:

%SEVEN := 7 <---Do this where you declare variables

%ROLL := 1D10
IF %ROLL = %SEVEN THEN
BEGIN
%SEVEN := 0
END

So now if the event ever happens, it gets set to 0, so it can't happen again.
 

Random Variables

11 years ago

Yes, it can be done.

Let's say the random events occur from page 1 to 40.

%PAGE := 1D40

IF %PAGE = 1 THEN

IF %NOTPAGE != 1THEN

BEGIN

$DEST := @P1

%NOTPAGE := 1

END

 

 

IF %PAGE = 1 THEN

IF %NOTPAGE = 1 THEN

BEGIN

%PAGE := 1D40

END

 

 

IF %PAGE = 2 THEN

IF %NOTPAGE != 2 THEN

BEGIN

$DEST := @P2

%NOTPAGE := 2

END

 

 

IF %PAGE = 2 THEN

IF %NOTPAGE = 2 THEN

BEGIN

%PAGE := 1D40

END

 

And so on, until you hit 40. You just have to copy and paste the codes on the page you want to random encounter to happen, and retype all the differing variables up to 40. 

 

Random Variables

11 years ago
40 different outcomes and each outcome can only occur once... Tricky, but it might be able to be done. I have a few ideas on what might work, I'll try some scripts and if I get something that works I'll tell you :)