Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SCRIPT]Change to specific random map
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#9
RE: [SCRIPT]Change to specific random map

(11-19-2012, 07:00 PM)The chaser Wrote:
(11-19-2012, 06:04 PM)Kreekakon Wrote: SetGlobalVarInt("maper", RandInt(1,3));
While (GetGlobalVarInt("maper")==2)
{
SetGlobalVarInt("maper", RandInt(1,3));
}
That would still have a chance to choose two.
No, it wouldn't. This is how the script would go:

1. Randomly pick from 1 to 3

2(a). If you get something besides a 2, everything keeps going normally.
or
2(b). If you get a 2 you will enter the "while" script, because "maper" being equal to 2 fulfills the conditions under which the while will run.

3. The script inside the while will pick a new number for maper at random, also from 1 to 3. It will keep repeating this process until "maper" is no longer 2, because as long as it is, the while script will never end, and keep repeating itself.

[Image: Tv0YgQb.gif]
Image by BandyGrass
(This post was last modified: 11-19-2012, 07:26 PM by Kreekakon.)
11-19-2012, 07:09 PM
Find


Messages In This Thread
RE: [SCRIPT]Change to specific random map - by Kreekakon - 11-19-2012, 07:09 PM



Users browsing this thread: 2 Guest(s)