I have the weather scripts done which was simple as ever. Oddly, the music was set from these scripts so I moved that to both rules.js files. Each of the three files use a setCampaignNumber(num) though I have not checked if it is useful anymore.

Because skirmish does not include the fog/weather scripts, the music has likely been incorrectly using the frontend music for some time now. Also implies weather particles do not show up for urban and rocky maps.

Now what to do with fog code (daynight files in here)? Maybe salvage NoQ's fog patch? In any case this marks the end of WZScript dependence.

Mod idea for weather:

Spoiler:

Lightning, similar to the LasSat weapon, could strike random parts of urban maps and causes an EMP effect within the affected area by using fireWeaponAtLoc().

Here is a patch for the weather (campaign only right now). Like what I did with the tech levels, I could include it along with rule.js if that is preferred. There is one problem where savegames are not loading because it says scriptstate.es is corrupted... not sure what is up with that.

Added setCampaignNumber(num) as it does have a couple of uses and I also saw no difference with the absence of the fog stuff with this patch.

Berserk Cyborg wrote:Here is a patch for the weather (campaign only right now). Like what I did with the tech levels, I could include it along with rule.js if that is preferred. There is one problem where savegames are not loading because it says scriptstate.es is corrupted... not sure what is up with that.

Added setCampaignNumber(num) as it does have a couple of uses and I also saw no difference with the absence of the fog stuff with this patch.

0001-Move-weather-scripts-to-JS.patch

IIRC, if you remove globals from wzscript, old savegames will no longer load.

I should say that the patch creates broken saves. Claims no script contexts were found with scriptState.es and then goes back to the main menu. Or maybe that file is now obsoleted without any wzscripts around?

Berserk Cyborg wrote:I should say that the patch creates broken saves. Claims no script contexts were found with scriptState.es and then goes back to the main menu. Or maybe that file is now obsoleted without any wzscripts around?

Pushed b016f609d704ce4df022e3a89f4f70f6eaabbee7. I enabled weather for multiplay; Hopefully that does not cause problems. As for old saves, we can just delete the scriptState.es file and they will load.