Getting Random Numbers.

Anonynn
13 Jun 2018, 20:14I can't quite remember the code for this.
GetRandomInt (0, 10)
msg ("The outcome is + GetRandomInt + ")
or something like that xD?
Anonynn.
hegemonkhan
13 Jun 2018, 23:05// generic syntax example:
// 'Variable' VARIABLE:
NAME_OF_Variable = GetRandomInt (MIN_VALUE, MAX_VALUE)
// 'Attribute' VARIABLE:
NAME_OF_OBJECT.NAME_OF_ATTRIBUTE = GetRandomInt (MIN_VALUE, MAX_VALUE)
// -------
// an example (from 1 to 10: 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10):
// 'Variable' VARIABLE:
random_integer_variable = GetRandomInt (1, 10)
// or:
// 'Attribute' VARIABLE:
// create ("example_object")
// example_object.random_integer_attribute = GetRandomInt (1, 10)
// 'Variable' VARIABLE:
msg ("The outcome is " + random_integer_variable + ".")
// or:
// msg ("The outcome is {random_integer_variable}.")
// or:
// 'Attribute' VARIABLE:
// msg ("The outcome is " + example_object.random_integer_attribute + ".")
// or:
// msg ("The outcome is {example_object.random_integer_attribute}.")

Anonynn
14 Jun 2018, 01:27Thanks HK! I appreciate it :D
Anonynn.
JenniferCampbell
14 Jun 2018, 11:21For the gamebook aficionados, it looks like this in the text processor:
{eval:GetRandomInt(0,10)}
Or
{=GetRandomInt(0,10)}