Caches weather when saving and restores weather when reloading a save, to avoid random, awkward weather transitions.
Adapted from my gunslinger modpack
Not guaranteed to work with existing saves. From my testing though didn't seem to break anything. Keep in mind I do not play anomaly so I don't have a super old save to test it out on. Weather caching will not take effect until your next save/reload.
Users upgrading from v1.2 and below, please delete the old "level_weathers.script" located in gamedata\scripts\
Install instructions:
Regular:
Drag the gamedata folder from the archive, place in main anomaly directory.
MO2 / GAMMA users:
Install like regular MO2 package.
changelog:
1.3.1: New header image- thank you to the talented Cr3pis for making it!
1.3: Script is now monkey-patched (ty bvcx for the initial idea and to ravenascendant and TheMrDemonized for help creating the monkey-patch). We no longer overwrite the original level_weathers.script, making the script logic more readable and giving more flexibility in the future. Please delete the old level_weathers.script that came with versions 1.2 and below.
1.2: Fix bug with underground weathers again. Moving to and from underground level now caches correctly. After 10 minutes realtime of being underground, cached weather can now transition to a new weather. Moddb calls it 1.2.3 for some reason, it is the same as 1.2. Also added a couple debug logs that I will take out once things seem more stable.
Example here: Streamable.com
TLDW: If it's rainy and you go underground for 5 minutes and go back up, it will remain rainy. If it is rainy and you are underground for an hour, the cached weather can transition to a new one.
1.1: Fix bug with underground weathers - caching is now only executed if user is not underground. This fucked up ambients when going underground though, will look into better solution.
1.0: Initial release
- yohjimane
Never liked the weather blending not saving during reloads and just going straight into new preset. Very helpful, thanks ;]
OMG?!!?!?!??!?!?!
I thought this was some sort of unfixable engine problem. This has been plaguing the stalker games and its mods since (well, afaik) FOREVER.
WOW! Good job man!
PS: at first when i saw this addon's title and image i thought it was a weather mod. I basically clicked it out of pure curiosity, without knowing its true purpose.
So i suggest adding to your title and picture "after loading a game"
Does it also keep weathers the same between level transitions? There was a mod that did that long ago. But I never found it again.
I'm wondering the same here. There was one for Lost Alpha and Ive been hopefully waiting for an Anomaly version!
I think this should, since on level transition there is an auto save which would call the caching function. If that doesn't seem to work, let me know and I can look into updating this :)
edit: just tested this, and weather does seem to persist when moving between levels :D
Thank you so much, yohjimane!!!
love you
It was the TRX weather mod for Call of Chernobyl. That was one of the selling points, that weather carried over as you roamed the zone.
How could I forget! I used it for the DrX spinoff, Call of the Zone.
I barely remembered myself honestly, and even then only because I still see a TRX start menu mod on Anaomlys addon page.
I installed their stuff a looot back when I played Call of Chernobyl. Might hit it again here soon so I can enjoy a Stalker sandbox with some top notch frames instead of just good enough.
OMG FINALLY! Thx! This is one of the most annoying things in Stalker
Very nice fix. Bravo :D
Hey, man I tried your mod on a saved file. I've noticed that when you leave an underground or laboratory area, the "underground weather" still goes on when outside. I don't if what I just wrote make sense, but anyways, cheers!
I think this can be corrected in the script by using "if (not bLevelUnderground) then". Should be an easy fix.
If you're seeing this, yohjimane, thanks so much! :D
Good catch- I will update this shortly!
Alright I fixed this, also added some logic in to force the cache weather to transition if you are underground for a while.
Streamable.com
Please dl the newest version!
Well that was fast anyway 10/10
Oi mama, this is fantastic!
Hello, thank you for your mod.
It is compatible and does the same with snowfall for this mod:
YET ANOTHER WINTER MOD
VERY nice ! a long time awaited feature gj :)
This mod works with MICHIKO'S WEATHER REVAMP.
Nothing gets replaced so it should be fine.
I played for an hour last night and had no issues but that was just in the swamp.
Ill have to do further testing on other levels etc.
Can't wait for the final fix for this mod cause you mentioned the ambient sounds are messed up right now :(
This issue with ambients should now be fixed in newest version. And yeah i also use michiko's weather, works great together (ty michiko for the great mod!)
awesome thank you so much this just amazing :).
Now This. ! is A Proper One !
Hello, all! 1.3 update is here, which fixes ambients for underground levels and adds some more functionality when transitioning to/from underground areas.
The script is now monkey-patched, so BEFORE INSTALLING 1.3, please delete the old "level_weathers.script" that came with version 1.2 and below from "gamedata\scripts\" folder. This should allow a little more flexibility in the future.
Huge thanks to ravenascendant and TheMrDemonized for helping me adapt this to a monkeypatch.
I think such essential bugfixes should be incorporated in the next Anomaly 1.6 from the box.
btw I asked this already in Anomaly discord
Discord.com
and the reply from Jacek "Tede" Graniecki stated it's vanilla issues)
Discord.com
But you found a way, marvellous!
I will give this a try with EFP v2.2
A annoying longtime problem resolved with a simple yet effective solution, 10/10 rated. Great work man!.
I think I just confront with a little bug in yantar level
I going Lab X-16 and finish my mission after get back to yantar level weather preset still at indoor_underground instead last preset before going in underground level or random any preset not indoor_undergound. the weather cycle system not broke it cycle normal after wait a few hours but it just look weid in normal level with underground weather preset. Any way thank for your good addon it was a good idea to keep weather setting after level transition
Hello, are you using the latest 1.3 update? This sort of issue should be fixed with that update.
Oh I just know it new version there thank bro
I don't understand what the developers are doing there, if this obvious bug has existed since ancient times? Was it really that hard to fix before? The same bugs were with blowouts, when they could be canceled simply by saving and loading during the blowout, but they fixed the same!
The mod stopped working for some reason. At first I played with the first version and everything was fine, then I installed 1.3 while deleting the old version, and immediately noticed that the weather was no longer saved. I decided to go back to the old version and noticed that on the old version the weather had already ceased to persist.
I am not sure what to do here as this version is still working for me. Can you check this for me please?
1. Open up anomaly in debug mode
2. Load into game
3. After successfully loading, quit the game
4. Open appdata\logs\xray_[your_username].log
5. ctrl f for "restore weather from cache"
If that line does not exist, then the script is installed incorrectly, double check that inside of gamedata\scripts these things:
1. level_weathers.script is deleted OR is vanilla verison. You can check this by opening the file and ctrl+f for "cachedWeather" - if there are >0 results - this is the MODDED version of the file.
2. yohji_persistent_weather.script exists.
If that line does exist then it should technically be working.. let me know what that line says and we can go from there.
Thank you, and sorry for the issues
Hello! I tried the above too and the line 'restore weather from cache' indeed appears. Although I too occasionally get some strange weather changes.
And I think I understand what probably happens, let me explain with an example.
Let's say in the weathers config .ltx we have the below 'schedule'
10:00 cloudy
11:00 rain
12:00 rain
We make a save at 11:01, your script will cache the rain weather as it should. BUT, the actual, visual weather transition ingame in realtime, doesn't really happen until its 11:05 or something like that, hence the discrepancy. Please let me know your input on this.
I installed your mod again to test what you asked, but before I decided to play with it again. I noticed that the weather began to persist, but not always. Rain has become rare. In 10 hours of play, rain started 1 time, and then immediately after loading the save. After playing for 5 minutes with the rain, I made a save / load and after loading the save there was no rain anymore. In general, the weather does not always persist, but it is more stable compared to vanilla, when the weather changes at every step, after loading the save.
As for the log - the line "restore weather from cache" is present.
There is no line "cachedWeather".
If it helps, here's a link to my log:
Files.catbox.moe
"cachedWeather" is supposed to be in the script file, not the log.
I'm having exactly the same problem. I tested this a lot when it first came out, and it worked perfectly. By the time I updated to 1.3, it suddenly stopped working entirely. I can't seem to get it working again even by switching back to older versions.
Edit: On second thought, it's probably just that this only works most of the time on any version. It just took me a long time to notice, so this seems like a new problem.
Do you think it's possible to do the same with radio songs?
I am getting some weir behavior with the emissions, if you save and load during an emission the weather get all funky, some times it get stuck in emission weather afterward and some timer the emissions occur with no blowout weather.
It seems that some times it get funky without saving too.
I have the same problem with the Psy storm
For the test, I started a new game in debug mode. I changed the weather preset, made a save, restarted the game, loaded the save and see that the preset I chose was saved. In vanilla, the preset was saved in the memory of the current session of the game, that is, if you load the save with the manually selected preset without leaving the game immediately, then the preset will be the one you chose, and if you restart the game and load the save, the preset will be the one that was selected the game itself when starting a new game. Hence the conclusion: the mod works. I don't know, maybe you need to start a new game for the mod to work properly?
I found that trying exactly the same thing multiple times can have different results. I have a test save from right before a weather change hour. I've tried loading it, waiting until a little past the hour change, saving, restarting the game, and then loading again. I did this over and over to try and figure this out. Most of the time, the weather stayed the same. Some of the time, it abruptly changed like it does in vanilla. I gave up on testing because I can't get consistent results.
Edit: Forgot to mention, this test save is from a new game started with this addon.
Did you test with the first version? Same results?
The fact is that when I loaded the save and the weather was different from what it was when saving, I checked the time and it was far from 10:00, 11:00, 12:00, 13:00, 14:00. The last time I remember was 15:38.
P.S. I wonder if there is any way to defeat this bug?
I just switched back to the original 1.0 version and tried my test again. This time, the weather abruptly changed on the first attempt. This definitely isn't a new bug.
If it helps, my test save is at 11:57. My weather transition always begins at 12:00. I've been loading the 11:57 save, waiting until 12:03, saving, and then loading again. Sometimes the weather stays the same, sometimes it doesn't.
I'm sorry, but the addon does not work correctly and the weather after saving and loading everything also changes. I also apologize for my English.
Same
Сonfirm
Same, works sometimes for me seems random
does it work fine with jsgme??
Hey, thanks for your work!
does it work with MICHIKO'S WEATHER REVAMP ?