Dest
New Member
- Reaction score
- 26
Is there a way I can make a random weather to happen and how do you detect the current weather so I can make actions?
You create all weather effects and set them to a variable, then disable them all on map initialization.
Trigger:
- Untitled Trigger 003
- Events
- Time - Elapsed game time is 0.01 seconds
- Conditions
- Actions
- Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
- Set weathereffectVariableArray[1] = (Last created weather effect)
- Environment - Turn (Last created weather effect) Off
- Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
- Set weathereffectVariableArray[2] = (Last created weather effect)
- Environment - Turn (Last created weather effect) Off
- Environment - Create at (Playable map area) the weather effect Wind (Heavy)
- Set weathereffectVariableArray[3] = (Last created weather effect)
- Environment - Turn (Last created weather effect) Off
- Set weatherSTRING[1] = Rain
- Set weatherSTRING[2] = Snow
- Set weatherSTRING[3] = Wind
Trigger:
- Untitled Trigger 004
- Events
- Time - Every 4.00 seconds of game time
- Conditions
- Actions
- Environment - Turn weathereffectVariableArray[weatherINDEX] Off
- Set weatherINDEX = (Random integer number between 1 and 3)
- Environment - Turn weathereffectVariableArray[weatherINDEX] On
- Game - Display to (All players) the text: weatherSTRING[weatherINDEX]
What the variables mean.
Variable number 1
weathereffectVariableArray
that is your main variable, it is called weather variable found at the end of your variable list.
when you make that variable there is something called array, set that to 3
now when you set the variable just follow his code and put a number [1] in ur first weather [2] in ur 2nd weather and [3] in your third weather
Variable number 2
weatherINDEX
This is a integre variable, used to called random weather effects.
As for your 2nd part of the question, u detect weathers by seening the effect on map xD
if you meant how do you show it as a text to other players?
well if you look at the trigger, u have already set it with ur strings
string [1] = rain.
and when your 2nd variable WeatherIndex, picks a number say [1], ur triggers would show rain.
hope this helped.