I Cant find it anywhere, but is there a random number generator script ?

Started by Moox, Wed 31/03/2004 02:47:23

Previous topic - Next topic

Moox

Is there a random integer script, I wrote a rpg engine in basic and I was thinking about porting it to ags, but I cant find anything like randint(1,10)->X

Gilbert

There's a Random() function in AGS already, look for it in the manual.

Akumayo

Yeah, use the random command.  In your room messages, say you want ten numbers to be randomely generated.  Make messages 0-9 look like this.

0: 1
1: 2
2: 3
etc.  

Then, in the interation for the number generater machine or whatever, script this

DisplayMessage(random,9);

I think that should work
"Power is not a means - it is an end."

TerranRich

Erm, no ,that should be...

DisplayMessage(Random(9));

:)


Remember that:

1. The DisplayMessage() command can only have one parameter, and...
2. Random() is a command, not a variable, and needs a parameter of its own. The above will create a random number between 0 and 9 (inclusive, meaning it includes 0 and 9 in the results) and then pass that random number over to the DisplayMessage command, so that it will display a random message between 0 and 9.
Status: Trying to come up with some ideas...

Gfunkera

Is there a RPG engine template for use with AGS I have a realy great story and would like very much to beable to use AGS to make my rpg, The game would play a  lot along the lines of final fantasy 5 or 6, Is this possible??

Moox


Gfunkera

Did you ever port your RPG engine to AGS?? If so can I try?? pm me....

SMF spam blocked by CleanTalk