• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Global weather effects not working at all.

Status
Not open for further replies.
Level 12
Joined
Jan 30, 2020
Messages
875
Hi everyone !

I am currently in the process of fixing the last inexplicable bugs in my map before releasing a new version.

One of the 2 bugs that makes me pull my hair out because I have no idea why it does not work is the fact that whatever I do, I can't get any weather effect to work in my map.

I first try to setup a global effect for testing in World Editor, I chose Northend light snow.
The weather effect shows in World Editor, but when I test the map, the effect is simply not there at all.

Also, I had Weather change options in my Host Controls triggers, and it does not work any better. Fun thing I used the same code in my old map back in 2004, and it used to work in Frozen Throne :

JASS:
function HostControls_Actions takes nothing returns nothing
.............................
    local integer weatherEffect=0
    local string typedOrder=GetEventPlayerChatString()

.............................
    if (typedOrder=="+rain") then
        set weatherEffect='RAhr'
    endif
    if (typedOrder=="+snow") then
        set weatherEffect='SNhs'
    endif
    if (typedOrder=="+fog") then
        set weatherEffect='FDwh'
    endif
    if (typedOrder=="+sunshine") then
        set weatherEffect='LRaa'
    endif
    if (typedOrder=="+moonlight") then
        set weatherEffect='LRma'
    endif
    if (typedOrder=="+calm") then
        set weatherEffect=1
    endif
    if (weatherEffect>0) then
        call PlayGlobalSound(WeatherSnd, WeatherSndDur)
        call RemoveWeatherEffect(WeatherEffect)
        if (weatherEffect>1) then
            set WeatherEffect=AddWeatherEffect(bj_mapInitialPlayableArea, weatherEffect)
            call EnableWeatherEffect(WeatherEffect, true)
        endif
    endif
...........................
endfunction

Note : WeatherEffect is just a global weathereffect variable.

While I am at it, my old map does not show weather effects anymore in Reforged.
Anyone has any idea about what has changed about weather effects with Reforged ?
Does anyone know how to get them to work ?

Note : I checked all my game options so far, and none was related to weather effects.
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
Well they work in reforged. Just opened an old map.
Unfortunately I don't know how to write vJASS, but here is my code in GUI.

  • Ini Effects
    • Events
      • Time - Every (60.00 x 3.00) seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Environment - Remove WeatherEffects[(Integer A)]
      • Set VariableSet WeatherEffect_Cycle = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 1
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Ashenvale Rain (Heavy)
          • Set VariableSet WeatherEffects[1] = (Last created weather effect)
          • Environment - Turn WeatherEffects[1] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 2
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Ashenvale Rain (Light)
          • Set VariableSet WeatherEffects[2] = (Last created weather effect)
          • Environment - Turn WeatherEffects[2] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 3
        • Then - Actions
          • Game - Set the time of day to 12.00
          • Environment - Create at (Entire map) the weather effect Rays Of Light
          • Set VariableSet WeatherEffects[3] = (Last created weather effect)
          • Environment - Turn WeatherEffects[3] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 4
        • Then - Actions
          • Game - Set the time of day to 0.00
          • Environment - Create at (Entire map) the weather effect Rays Of Moonlight
          • Set VariableSet WeatherEffects[4] = (Last created weather effect)
          • Environment - Turn WeatherEffects[4] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 5
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Wind (Heavy)
          • Set VariableSet WeatherEffects[5] = (Last created weather effect)
          • Environment - Turn WeatherEffects[5] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 6
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Outland Wind (Heavy)
          • Set VariableSet WeatherEffects[6] = (Last created weather effect)
          • Environment - Turn WeatherEffects[6] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 7
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Outland Wind (Heavy)
          • Set VariableSet WeatherEffects[7] = (Last created weather effect)
          • Environment - Turn WeatherEffects[7] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 8
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Northrend Blizzard
          • Set VariableSet WeatherEffects[8] = (Last created weather effect)
          • Environment - Turn WeatherEffects[8] On
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeatherEffect_Cycle Equal to 9
        • Then - Actions
          • Environment - Create at (Entire map) the weather effect Dungeon White Fog (Light)
          • Set VariableSet WeatherEffects[9] = (Last created weather effect)
          • Environment - Turn WeatherEffects[9] On
        • Else - Actions
 
Level 12
Joined
Jan 30, 2020
Messages
875
I am puzzled as you code is basically a GUI version of mine.

Maybe the weather integer IDs have changed, that would not affect your GUI triggers but those with the codes used directly, will check this out.

thanks for your reply !!
 
Level 12
Joined
Jan 30, 2020
Messages
875
Maybe because in your code you only have this.
Code:
set weatherEffect=1

And your conditions is this.
Code:
if (weatherEffect>1) then

You are not setting your weatherEffect higher than 1 based on your code.


No you misread the code. weatherEfect is initially set to 0 when declared as a local variable.
It only changes to 1 there when the player types "+calm". The idea is then to stop the weather effect with that command.

JASS:
    if (typedOrder=="+calm") then
        set weatherEffect=1
    endif

Note the other values all work to change the value of weatherEffect as we can clearly hear the sound played when the different commands are typed


Anyways, the problem is worse than I though. I added this trigger in GUI to my map :

Code:
Weather test
    Events
        Map initialization
    Conditions
    Actions
        Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)

edit : what tag should I use for properly pasting GUI by the way ?

And the weather effect does not work :(
Will now try on a blank mep, maybe something is wrong with my Warcraft 3 reforged install...

EDIT :
This is indeed a major problem.
I used a blank map, put 2 base start locations, aded a few trees and 2 gold mines to make a real basic melee map.

Pasted the same GUI trigger to set Ashenvale's heavy rain at map initialization and...
and the weather does not work. I don't understand as I recently reinstalled Reforged to fix a problem with buildings missing ground textures, and the problem with weather effects have been there since my first install of Reforged.

I also tried to set map to SD only in the options, but even with classic graphics I don't get any rain at all...

Am I the only one with the same issue ?

EDIT 2 : Ok, I knew this could not be right.
Of course, I am not used to GUI triggers anymore and I forgot to enable the created weather effect in my GUI trigger.

It finally works on the basic melee map, so time to do more tests on my main map...

EDIT 3:
The trigger works in the base melee map but not in mine.
There is probably a non-obvious setting preventing weather effects to work, but I fail to find anything relevant.
I suppose I should probably give up using weather effects, after all it is nothing but fancy cosmetics...
 
Last edited:
Status
Not open for further replies.
Top