Random Number Function?

Moderator: Pocus

Post Reply
kronenblatt
General - Elite King Tiger
General - Elite King Tiger
Posts: 4362
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Random Number Function?

Post by kronenblatt »

Is there any function that generates a random number, ideally uniform between 0 and 1 (or 1 and 100)?

EDIT: would the Dice() function fulfil that purpose? Is then Dice(100) a 100-sided die, i.e., random integer number between 1 and 100?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
pipfromslitherine
Site Admin
Site Admin
Posts: 9707
Joined: Wed Mar 23, 2005 10:35 pm

Re: Random Number Function?

Post by pipfromslitherine »

Rand should do the trick. You can see a list of all commands in Documents/My Games/FieldOfGloryEmpires/AUTODOCS/Battlescript.txt

Cheers

Pip
follow me on Twitter here
kronenblatt
General - Elite King Tiger
General - Elite King Tiger
Posts: 4362
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Random Number Function?

Post by kronenblatt »

pipfromslitherine wrote: Tue Jul 21, 2020 3:56 pm Rand should do the trick. You can see a list of all commands in Documents/My Games/FieldOfGloryEmpires/AUTODOCS/Battlescript.txt

Cheers

Pip
Thanks Pip: appreciated! You wouldn't happen to know the answer to my question in a separate thread too; on creating and calling upon a new function?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Pocus
Ageod
Ageod
Posts: 5669
Joined: Tue Oct 02, 2012 3:05 pm

Re: Random Number Function?

Post by Pocus »

I use Dice for everything I think.
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
kronenblatt
General - Elite King Tiger
General - Elite King Tiger
Posts: 4362
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Random Number Function?

Post by kronenblatt »

Pocus wrote: Thu Jul 23, 2020 1:39 pm I use Dice for everything I think.
Thanks Pocus! And is then Dice(100) a 100-sided die, i.e., random integer number from uniform distribution between 1 and 100?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Pocus
Ageod
Ageod
Posts: 5669
Joined: Tue Oct 02, 2012 3:05 pm

Re: Random Number Function?

Post by Pocus »

yes
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
Post Reply

Return to “MOD”