[Update] PTWS - Persistent Time and Weather System

21 posts in this topic

PTWS is a script that I made for my Exile server that I host for some friends that allows time and weather to persist through server restarts. It also has seasons defined by months that will change the temperature.

A script error occurs after every restart when PTWS is checking for the database entry, not sure why.

Future:

Spoiler

Welp the script is mostly done now, there are few more things that I want to do like make the seasons affect the weather in some way. I'm not sure how I want to do that yet, I'm leaning towards setting configurable min and max values for some of the weather parameters.

Initial Release

I already have a few ideas on how to make the weather persist through restarts, I'm just not sure how I want to do it yet.

There are a few scripts out there already that manipulate weather and I'm wondering whether or not I should contact the authors to incorporate their work into this script or to make one from scratch. That's the main reason why I chose to release this before adding weather to it.

Once I make or use another script to control the weather, I'm going to define configurable seasons in the config and make the script check the month and choose the weather patterns that are defined for that season.

So this script is only 25% done but I wanted the community's opinion on how I should proceed.

Afterword:

Spoiler

This is my first topic and, for the most part, my first original script. It may not seem like much but this is one of my first shots at Arma scripting so go easy on me . Any tips regarding this script or Arma coding in general would be appreciated.

I had a hard time figuring out which object/namespace to use for the variables in this script, for every other item in the database has some player or object that it derives its ID from, this script doesn't have such an object so I went with missionNamespace. If I chose this in error, please enlighten me.

Credits:

@second_coming - I used his occupation mod as an example for some of the settings and debug. I also used his config settings for the time acceleration.

@WolfkillArcadia - Thanks for the helpful tips, I was able to clean the code a good amount thanks to that.

@code34 - The creator of Real Weather, I'm using his script for the dynamic weather.

This is untested code, but I don't see why it wouldn't work. Let me know if you have issues.

Just as an FYI since you said you are a bit new at this:

missionNameSpace setVariable ["BLAH",1];

is the same as

BLAH = 1;

Also, I would avoid using "ExileDatabaseID" as the variable name in the missionNamespace as that this could accidentally overridden by another script. Use "PTWS_DatabaseID" or something so it's unique.

About Exile Arma 3 Mod

It is the year 2039. After the resource depleting conflict in Greece, Europe suffers from a new deflation crisis, leading the crime rate to a new peak in history. Members of the North Atlantic Treaty Organization Security Council are forced to react. Being a desperate alternative to overcrowded and prohibitive prisons, offenders are now being sent to EXILE.