Jump to content

Real time weather (METAR) on your server missions HOW TO


Johnny_Rico

Recommended Posts

It should still work in principle.

 

 

Sent from my iPhone using Tapatalk

 

Yea after some trial and error i found it.

 

Changed:

start /D%DCS_PATH% /B dcs.exe

 

into:

start /D%DCS_PATH% /B dcs.exe --server --norender

 

And it worked!

 

Follow up question.

The time is now working as intended, sort of. Havent been able to test if it chooses the random times, will do that tonight after 1800.

 

But the date.

When selecting REAL time, is it possible to skip the date then?

So i can pick wich date i want to play on, but the time is real?

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

  • 2 weeks later...

Any of you guys that runs METAR run it with some kind of automation?

 

eg the server restarts every 6 hours and picks new weather info and new time?

 

I have a scheduled reboot on the computer at 0500 every morning and then the mission restarts every 6 hours.

Thinking on how i could incorporate the METAR system into that in a clever way.

 

One way, is to have it be started every morning at 0500, then that weather info will stay all day along with real time...

 

Any ideas?

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

You mean have a batch file kill the dcs.exe process and then start again?

 

I rather not do that since im running two servers so killing dcs.exe would kill them both.

And i dont know of any way for scripting to know the computers real time so it could warn the players for an upcoming restart if they were to be synced to the computer clock.

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

  • 2 weeks later...

In the Mission Editor we have an option sayin "Dust Smoke Enable".

 

Cant see that option in the METAR script. Any way to disable that weather addition?

Im suspecting that its giving the server a weird results.. Weird colors and dark when it should be light. Anyway i would like to see if i can turn it off somehow?

 

Fog_enabled is set to False at least.

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

def is_sandstorm_terrain(l_mission):

s_persian_gulf = '["theatre"] = "PersianGulf"'

if find_item_index_from_start(l_mission, s_persian_gulf):

return True

else:

return False

 

change to

 

def is_sandstorm_terrain(l_mission):

s_persian_gulf = '["theatre"] = "PersianGulf"'

if find_item_index_from_start(l_mission, s_persian_gulf):

return False

else:

return False

Click here for tutorials for using Virpil Hardware and Software

 

Click here for Virpil Flight equipment dimensions and pictures.

.

Link to comment
Share on other sites

Forgot to mention im running the server on Caucasus.... :music_whistling:

 

So that change wouldnt affect the dust option i guess?

Will try it anyway..

 

EDIT:

This is the effect im talking about:

 

https://cdn.discordapp.com/attachments/560756151864786954/566977882409140245/2019-04-12_09_16_37-Window.png

https://cdn.discordapp.com/attachments/560756151864786954/566977862398115850/2019-04-12_09_16_17-Window.png


Edited by Frosties

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

Did some testing this morning, checked my settings in ME, and both Fog and Dust is unchecked.

Still seeing the weird fog at the horizon.

 

Then i checked the mission file, and around line 202 i see:

 

["enable_dust"] = false,

["dust_density"] = 2999,

 

Changed the dust_density to 0:

 

["enable_dust"] = false,

["dust_density"] = 0,

 

And then the weird horizon-fog disappeared.

Is this just for me that this is happening?

 

See pictures for comparison. ONLY changes between them is that the density has been set to 0 instead of 2999.

 

Density 2999:

https://www.dropbox.com/s/mg5eve1i725fxkz/TEST1.png?dl=0

 

Density 0 (Zero):

https://www.dropbox.com/s/zr5fzmbr8zuf1hl/TEST2.png?dl=0

 

And looking in the script:

 

s_sand_enable = 'false'

s_sand_density_m = '0'

 

wich is used with:

s_sand_enable = '["enable_dust"] = '

s_sand_density = '["dust_density"] = '

 

So not really sure where the 2999 comes from...


Edited by Frosties

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

Uhm, I have this error:

eV8ZQfvnOTwT5JLcO7hSHZjK9dDost.png

Someone has some idea about it?

 

Thanks!


Edited by Maverick87Shaka

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

ahh, I guess the API change that was scheduled for April has happened, will get someone to look at this later

 

Thanks for reply, with the latest version BTW seems is not happening this error, sorry, I was on the old V1.2.2 2018.SEP.14_19:10, with the new 1.3.2 is fine ;)

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

Any plans on adding random presets as an option to the system?

 

So that everytime the server start up, it gets the weather and then pick a date/time from a table of presets. Much like the fixed preset, but it chooses between all of them randomly.

 

Instead of just real, random, fixed preset i mean.

 

ADD:

Im getting this error now, and for my own sanity im asking for some help..

https://www.dropbox.com/s/5k542ntu2goa2bw/2019-04-21%2013_10_44-Spelserver.png?dl=0

 

Ive been over the code to look for any kinds of error, misspelled path or whatever but cant find anything. What is the cause of that error?

 

its working with 1.3.0 but as soon as i switch to 1.3.2 it gives the above error.

Same settings in the BAT file in both instances...

 

Ive seen this error before but cant for the love of whats holy remember what i did...


Edited by Frosties

[sIGPIC][/sIGPIC]

 

Vincere Est Totum

Link to comment
Share on other sites

  • 5 months later...
Uhm, I have this error:

eV8ZQfvnOTwT5JLcO7hSHZjK9dDost.png

Someone has some idea about it?

 

Thanks!

After many month I realized that the website don't provide anymore METAR for the reference airport that I'm trying to use, the API return an empty array ( 0 results )

I'm now switched to a bigger airport in the respective area and it's working.


Edited by Maverick87Shaka
My FAULT

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Hi all!

 

I have many problem with that script: i have made many debug but don't work

 

C:\Users\Administrator\Desktop>SET DCS_PATH="C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin"

 

C:\Users\Administrator\Desktop>SET PRIMARY_AIRPORT=UGKO

 

C:\Users\Administrator\Desktop>SET BACKUP_AIRPORT=EGAA

 

C:\Users\Administrator\Desktop>SET TIME_CONTROL=real

 

C:\Users\Administrator\Desktop>SET zip="C:\DCS_Scripts\7-Zip\7z.exe"

 

C:\Users\Administrator\Desktop>SET MISSION_PATH=D:\dcsmissioni\

 

C:\Users\Administrator\Desktop>SET MISSION_NAME=Warhammer

 

C:\Users\Administrator\Desktop>SET MISSION="D:\dcsmissioni\Warhammer.miz"

 

C:\Users\Administrator\Desktop>SET PYTHON_SCRIPT="D:\dcsmissioni\dcs_weather.py"

 

C:\Users\Administrator\Desktop>SET TEST=1

 

C:\Users\Administrator\Desktop>SET HOUR=14

 

C:\Users\Administrator\Desktop>IF "1" == " " SET HOUR=4

real

 

C:\Users\Administrator\Desktop>cd /D D:\dcsmissioni\

 

D:\dcsmissioni>"D:\dcsmissioni\dcs_weather.py" "D:\dcsmissioni\Warhammer.miz" UGKO EGAA real

 

D:\dcsmissioni>ren Warhammer.miz Warhammer.zip

 

D:\dcsmissioni>"C:\DCS_Scripts\7-Zip\7z.exe" a -tzip Warhammer.zip mission -mx9

Impossibile trovare il percorso specificato.

 

D:\dcsmissioni>ren Warhammer.zip Warhammer.miz

 

D:\dcsmissioni>cd /D "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin"

 

C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin>start /D"C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin" /B DCS_updater.exe

 

C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin>pause

Premere un tasto per continuare . . .

 

 

The .bat report that message.

 

I have phyton 3.8 installed, pip ext installed, i have try to change folder...please help me.

 

The file .bat

 

: example launch file for DCS used with dcs_weather.py

: by havoc-company.com

: you need python 3 (and requests module for python - pip install requests in dos to install)

: and 7z installed on server hosting PC

: you will need to edit this file to change parameters to match your install

: contact Johnny Rico in ED forums for any queries

: V 1.0.2

: try NOT to use paths with spaces in them, it is a fecking ballache

 

 

SET DCS_PATH="C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin"

 

 

: settings for dcs_weather.py - airports weather to query

SET PRIMARY_AIRPORT=UGKO

SET BACKUP_AIRPORT=EGAA

: you want to use current realtime on server ?

SET TIME_CONTROL=real

 

: set this to where your 7z.exe is installed

SET zip="C:\Program Files\7-Zip\7z.exe"

 

: where you store your mission miz files

SET MISSION_PATH=D:\dcsmissioni\

 

: mission name minus the file extension

SET MISSION_NAME=Warhammer

 

SET MISSION="%MISSION_PATH%%MISSION_NAME%.miz"

 

: path and name of weather python script

SET PYTHON_SCRIPT="D:\dcsmissioni\dcs_weather.py"

 

 

SET TEST=%time:~0,1%

SET HOUR=%time:~0,2%

IF "%TEST%" == " " SET HOUR=%time:~1,1%

 

 

: this override was added so that if it is too late in the year (dark a lot in evenings) then people would get some time were it is light for a bit

: IF %HOUR% GEQ 18 SET TIME_CONTROL=6

@echo %TIME_CONTROL%

 

 

cd /D %MISSION_PATH%

%PYTHON_SCRIPT% %MISSION% %PRIMARY_AIRPORT% %BACKUP_AIRPORT% %TIME_CONTROL%

 

: rename .miz to .zip because 7z don't like miz file extension

ren %MISSION_NAME%.miz %MISSION_NAME%.zip

 

: add the updated mission to the zip file

%zip% a -tzip %MISSION_NAME%.zip mission -mx9

 

: rename it back to miz

ren %MISSION_NAME%.zip %MISSION_NAME%.miz

 

 

cd /D %DCS_PATH%

start /D%DCS_PATH% /B DCS_updater.exe

 

 

pause

 

 

I have try to launch like administrator the bat...

101^Squadrone Multiruolo Ariete 

by SimItaliaGames.com | WebSite FaceBook Forum Discord

Visit: AF Allied Forces

Joint Operations, Joint Communities

Un progetto per promuovere la collaborazione tra gruppi volo virtuali!

Link to comment
Share on other sites

  • 2 weeks later...
looks like 7z is failing, also install DCS server to a none program files folder to make it easier to launch (no need admin)

I try to help webber getting their METER working, and we found a strange behaviour ( MS Windows I think )

Even the Windows Environment Variable "PATH" are setup correctly for python, if Windows is set to open .py file with an editor by default ( for example notepad++ ) during the execution of the .bat file it's going to open script with editor instead execute it. Don't know why exactly it's happening on Webber server, I didn't see an error like this before on my servers, but finally we just put full path of python instead only the binary name and solve the problem for that specific server.

 

So we changed the line:

python %PYTHON_SCRIPT% %MISSION% %PRIMARY_AIRPORT% %BACKUP_AIRPORT% %TIME_CONTROL%

to:

"C:\Program Files (x86)\Python38-32\python.exe" %PYTHON_SCRIPT% %MISSION% %PRIMARY_AIRPORT% %BACKUP_AIRPORT% %TIME_CONTROL%

 

And now it's working ;)

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...