Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Moox on Wed 31/03/2004 02:47:23

Title: I Cant find it anywhere, but is there a random number generator script ?
Post by: Moox on Wed 31/03/2004 02:47:23
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
Title: Re:I Cant find it anywhere, but is there a random number generator script ?
Post by: Gilbert on Wed 31/03/2004 02:51:09
There's a Random() function in AGS already, look for it in the manual.
Title: Re:I Cant find it anywhere, but is there a random number generator script ?
Post by: Akumayo on Fri 02/04/2004 01:47:59
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
Title: Re:I Cant find it anywhere, but is there a random number generator script ?
Post by: TerranRich on Fri 02/04/2004 14:51:26
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.
Title: Re:I Cant find it anywhere, but is there a random number generator script ?
Post by: Gfunkera on Sat 03/04/2004 22:00:32
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??
Title: Re:I Cant find it anywhere, but is there a random number generator script ?
Post by: Moox on Sun 04/04/2004 02:55:00
I dont believe so, but if you hear otherwise pm me
Title: Re:I Cant find it anywhere, but is there a random number generator script ?
Post by: Gfunkera on Sun 04/04/2004 08:50:46
Did you ever port your RPG engine to AGS?? If so can I try?? pm me....