- Joined
- May 21, 2014
- Messages
- 580
Greetings Hive!
This is not much of a problem, but I recently noticed something weird about random (both integer and real) number function. This also only happens when you use TEST MAP on world editor. Restarting the world editor AND my laptop doesn't change this fact. Here is a list of triggers that I used to generate random numbers:
1. Music Selection
I have 3 musics in my map, and when a mode is chosen (created via triggers as well) a random song is played from the musics I have.
2. Random Point Usage
I have a trigger that spawns a number of Trees at a random point in a
specified region.
3. Random Integer for Variation Selection
Notice that in the trigger above (Tree Spawn Trigger), I also used a random integer function to randomly select each tree's variation. It is a funny thing that their variation always stay the same when I TEST MAP using world editor. It can't be a coincidence to have the trees spawning on the same place with the same variation even if I used random number generation functions with it!
What's the deal with this? Playing the map without using TEST MAP works fine though, but why is it acting like this? There must be some explanation behind this. I don't know if the problem is in my map itself or... I don't know...
This is not much of a problem, but I recently noticed something weird about random (both integer and real) number function. This also only happens when you use TEST MAP on world editor. Restarting the world editor AND my laptop doesn't change this fact. Here is a list of triggers that I used to generate random numbers:
1. Music Selection
I have 3 musics in my map, and when a mode is chosen (created via triggers as well) a random song is played from the musics I have.
-
Start Music
-
Events
- Dialog - A dialog button is clicked for ChooseMode
- Conditions
-
Actions
- Sound - Stop music Immediately
- Set MusicListCustom = (Random integer number between 0 and 2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MusicListCustom Equal to 0
-
Then - Actions
- Sound - Play Song1
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MusicListCustom Equal to 1
-
Then - Actions
- Sound - Play Song2
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MusicListCustom Equal to 2
-
Then - Actions
- Sound - Play Song3
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Events
2. Random Point Usage
I have a trigger that spawns a number of Trees at a random point in a
specified region.
-
Start Here
-
Events
- Map initialization
- Conditions
-
Actions
-
For each (Integer A) from 1 to 125, do (Actions)
-
Loop - Actions
- Set TreeSpawnPoint = (Random point in Limiter <gen>)
- Destructible - Create a Ashenvale Tree Wall at TreeSpawnPoint facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 4)
- Custom script: call RemoveLocation(udg_TreeSpawnPoint)
- Custom script: set udg_TreeSpawnPoint = null
-
Loop - Actions
-
For each (Integer A) from 1 to 25, do (Actions)
-
Loop - Actions
- Set TreeSpawnPoint = (Random point in Limiter <gen>)
- Destructible - Create a Ashenvale Canopy Tree at TreeSpawnPoint facing (Random angle) with scale 2.00 and variation (Random integer number between 0 and 2)
- Custom script: call RemoveLocation(udg_TreeSpawnPoint)
- Custom script: set udg_TreeSpawnPoint = null
-
Loop - Actions
-
For each (Integer A) from 1 to 125, do (Actions)
-
Events
3. Random Integer for Variation Selection
Notice that in the trigger above (Tree Spawn Trigger), I also used a random integer function to randomly select each tree's variation. It is a funny thing that their variation always stay the same when I TEST MAP using world editor. It can't be a coincidence to have the trees spawning on the same place with the same variation even if I used random number generation functions with it!
What's the deal with this? Playing the map without using TEST MAP works fine though, but why is it acting like this? There must be some explanation behind this. I don't know if the problem is in my map itself or... I don't know...