Non-threaded

Forums » Newbie Central » Read Thread

Introduce yourself and get to know the community.

Random Variable definition

18 years ago
I need some help. I was trying to put in a random variable, but have no idea how to randomise it The reset function doesn't hold the key, so how?

Random Variable definition

18 years ago
And is it possible to tinker with items in the mix?

Random Variable definition

18 years ago

what do you mean "the reset function doesn't hold the key"? 

Okay, make a variable, we'll call it RANDOM.   In the variables screen, you can't make the starting value a random number, or at least, I can't, so leave it blank.

On the very first link of your game, Reset RANDOM 1D6.  Now RANDOM equals a random number between 1 and 6 . Obviously, Reset Random 1D100 would give you a random number between 1 and 100.

What exactly are you having trouble with? (Or what are you trying to do?)

 

Random Variable definition

18 years ago
Oh, so '1d100' is what you type into the variable change?

Random Variable definition

18 years ago

In my game, there's gonna be a swamp you have to cross. You'll stumble over things like fallen logs, dead moose, stones, but also, a silver medallion.

so I need to be able to tinker with items so you don't get a medallion when you fall over a moose.

Random Variable definition

18 years ago

Y'know, there's an article on random variables.

Okay, for a concrete example, say I have a forest.  The forest is, we'll say, a square forest, five by five.  So the total forest is 25 pages.  I'm calling the pages 1-25 while I work for simplicity. (In an actual game, I'd probably rename them all "Forest" just before publishing.)

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

I want there to be one silver medallion in this forest somewhere.  So I create the item "Silver Medallion" and I say it is found on the page called "You find a silver medallion."

Now,  I create a variable SILVER and on the very first link of the game I make sure to Reset SILVER 1D25.

Now I make my pages 1-25 however I want them- and on each page I add a link to the page "You find a silver medallion."

On "Page 1" I make the link restriction SILVER=1.  On "Page 2" I make the restriction SILVER=2, and so on.  Whichever number 1-25 SILVER was reset to, on that page alone, the link to "You find a silver medallion" will appear. 

On the page "You find a silver medallion" I set the link to Return to the Previous Page.  Also, Reset SILVER 0,  assuming I only want one silver medallion to be findable in the forest.

If I wanted the player to be able to collect a lot of silver medallions, I could just Reset SILVER 1D25 again.

 

(There's probably an easier way to do this, but this works for me.)

Random Variable definition

18 years ago
did u not read my article, primates?? listen to seths advice and read the article...

Random Variable definition

18 years ago
Yes, I did read your article, I just didn't understand it.

Random Variable definition

18 years ago

ah, well that is not good then eh? lol

Addition 1D5

will get you a random number between 1 and 5

Random Variable definition

18 years ago
Yeah, I get it now. You can use links to pages with items via variable restrictions.

Random Variable definition

18 years ago
Ooh! How do you show a variable on a single page?

Random Variable definition

18 years ago

if the variables name is "Money" then this:

%%MONEY%%

if its name is "HEALTH" then:

%%HEALTH%%

get the idea?

Random Variable definition

18 years ago
Okay.

Random Variable definition

18 years ago
I am pretty sure this is in my articles...

Random Variable definition

18 years ago
Meh.