zen-mod / ZEN

Zeus enhancement mod for Arma 3
https://zen-mod.github.io/ZEN
GNU General Public License v3.0
108 stars 47 forks source link

Add snow option to Change Weather module #682

Closed johnb432 closed 1 year ago

johnb432 commented 1 year ago

When merged this pull request will:

Notes:

Kexanone commented 1 year ago

Works fine in MP so far.

mharis001 commented 1 year ago

I have not looked into it yet but would using BIS_fnc_setRain be better here? The wiki implies that it helps with rainParams synchronization in MP. I agree with changing the wording to "precipitation".

I am unsure if there is much value in making all rainParams options available via a module. Maybe just providing a small set of curated "precipitation types" (with values that work well together) would be more useful. Does not need to be a part of this PR of course and can be done later.

Kexanone commented 1 year ago

We gonna need to have a look on what BIS_fnc_setRain actually does. I tested changes with a second client and also with JIP and both worked.

johnb432 commented 1 year ago

We gonna need to have a look on what BIS_fnc_setRain actually does. I tested changes with a second client and also with JIP and both worked.

Looking at the code of the function, it should be MP and JIP compatible. I have only tested it the latest commit (c4f7531) in SP though.

Kexanone commented 1 year ago

Maybe my previous comment was confusing. What I meant is that I tested your initial PR and it worked fine on dedicated with a second client and JIP as well.

On a different note, we first need to know what BIS_fnc_setRain actually does before using it. Biki says you should execute it on the server, but at the moment you are executing it everywhere and on JIPs as well.

Kexanone commented 1 year ago

Just checked out BIS_fnc_setRain. The function is meant to be executed on the server only and basically just remote executes setRain with JIP. Hence, I suggest we revert to the original approach with directly using setRain.

johnb432 commented 1 year ago

Maybe my previous comment was confusing. What I meant is that I tested your initial PR and it worked fine on dedicated with a second client and JIP as well.

No, no, I understood what you meant the first time. My communication abilities are poor, so I assume I didn't express myself well enough: I have tested both options in SP only (by options I mean either CBA Events or BIS_fnc_setRain).

On a different note, we first need to know what BIS_fnc_setRain actually does before using it. Biki says you should execute it on the server, but at the moment you are executing it everywhere and on JIPs as well.

I had looked into BIS_fnc_setRain (as in looked its code) before I used it and I know you need to execute on the server to get MP and JIP compatibility. At the moment, BIS_fnc_setRain is only executed on the server as can be seen here.

Just checked out BIS_fnc_setRain. The function is meant to be executed on the server only and basically just remote executes setRain with JIP. Hence, I suggest we revert to the original approach with directly using setRain.

Ultimately, I don't care, as both options work (well, in theory, I still haven't tested the option with BIS_fnc_setRain). Maybe the option using BIS_fnc_setRain is a bit more elegant, as requires less code written in ZEN, but on the other hand, there will be something with the JIP ID "BIS_fnc_setRain" in the JIP queue, as it's never cleared, only overwritten (at least as far as I could tell). I guess it's down to personal taste.

Kexanone commented 1 year ago

I had looked into BIS_fnc_setRain (as in looked its code) before I used it and I know you need to execute on the server to get MP and JIP compatibility. At the moment, BIS_fnc_setRain is only executed on the server as can be seen here.

Nvm, I somehow missed that you put it in the isServer part. We can leave it as it is then.

johnb432 commented 1 year ago

I have tested it with 2 clients, one acting as the server, and by the looks of it it seems to work (MP and JIP compatible).

On a different note: The particle arguments require some tweaking. For example: Wind doesn't seem to affect snow much, even if you set the windCoeff argument of the particles higher. I'm not sure what parameters would be best, so I appreciate any feedback/ideas.