HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random weather

04-22-2004, 10:38 PM#1
IronGauntlet
how can u make random weather?
04-22-2004, 11:25 PM#2
ThyFlame
Every X seconds

stop last weather
IntegerVariable = math - random number between x and y
if
-IntegerVariable = 1
then
-create weather at region
else
if
-IntegerVariable = 2
then
-create weather at region
else
04-23-2004, 01:09 AM#3
IronGauntlet
sry but i not good with variables. whast is the exact action for the integervariable=math-random number

is there a variable tutorial somewhere?
04-23-2004, 01:44 AM#4
johnfn
You can check over in the tutorial system: linkmaster23's tutorial is as close as you'll get, and I do a briefover (is that a word) on them, but not much else. A variable basically just holds some data. Perhaps you would have an integer to hold how many units are in a region, and then add and subtract from the variable when units enter/exit the region. integervariable is a variable, not a function like i think you thought it was. Ctrl+b and the green x to make a variable.


I'd tell you more but i gotta sleep. Hopefully thats enough.
04-23-2004, 02:10 AM#5
IronGauntlet
EVENTS-
time elapsed is 600 seconds
CONDITIONS-
ACTIONS-
remove last created weather affect
Set INTEGER(array/10) random integer between 1 and 10 = integer A
If integer A is equal to 1 then create weather effect else do nothing


maybe you could take a look at that and help me out while i try and figure out how to use variables.
04-23-2004, 04:45 AM#6
ThyFlame
Code:
EVENTS-
          every 600 seconds
CONDITIONS-
ACTIONS-
          remove WeatherVariable
          Set tempValue = math - random integer between 1 and 10
          If 
                 tempValue is equal to 1 
          then 
                 create [some weather effect] 
                 set WeatherVariable = (last created weather effect)
          else 
                 do nothing

First off, you can right click a trigger and click copy as text to paste on here.

Secondly, the above trigger is what you want.
04-23-2004, 11:19 AM#7
johnfn
Unless, of course, you want more then one weather effect. In that case you could simply add more if statements (if tempValue = 2 then create northrend - blizzard, ect, ect)