super-truite Posted December 11, 2020 Posted December 11, 2020 (edited) Here is a small tool allowing to change the weather + time randomly for a server with a mission rotation. After the ending of a mission, the script will create a new mission file with different weather parameters automatically. Source code with instructions: https://github.com/Super-truite/il2_random_weather_script Executable: https://github.com/Super-truite/il2_random_weather_script/releases/download/1.0/random_weather.zip Installation: Allow log files in il2: Make sure gamelog=1 in your startup.cfg file Mission files organization The Dogfight folder should not contain the .Mission file as it would be downloaded by players by default which is not optimal (slower download speed). Instead the raw mission files should be in another folder. In my case: "C:\Program Files (x86)\1C Game Studios\IL-2 Sturmovik Great Battles\data\Multiplayer\raw_missions" You have an example of working Multiplayer folder in the project on github. To test the system, you can copy paste it in your data folder and run the script. Configuring the script Change the paths to your il2 installation and to your dogfight and raw mission folder in the config.ini file that is present in the dist folder. (for developers, use the config.ini at the root of the project source code directory) Launch the script In the dist folder, click on random_weather.exe. A command prompt will appear, then right click on the header of the command prompt and click on properties, then uncheck 'Quick Edit Mode', otherwise the process might pause. I might add some options to have more control on the randomness of the weather for the user. Edited December 28, 2020 by super-truite 2 2
=AD=uumembwa Posted December 23, 2020 Posted December 23, 2020 Quote 'Haze': str(random.random())[0:3] @super-truite this mean Haze parameter will be from 0.0 to 0.3?
super-truite Posted December 23, 2020 Author Posted December 23, 2020 no, 0 to 1. the str()[0:3] is just used for some formating of the number. If I find time I will make the weather parameters more easy to change.
=AD=uumembwa Posted December 23, 2020 Posted December 23, 2020 3 minutes ago, super-truite said: no, 0 to 1. the str()[0:3] is just used for some formating of the number. If I find time I will make the weather parameters more easy to change. Thx! Another question, I have installed python with il2stats from Vaal (not anaconda) how to use you script with it?
super-truite Posted December 23, 2020 Author Posted December 23, 2020 you just have to install the packages needed. The best way would be in a virtual environment but if you do not use python for other stuff than il2, you can just open a terminal and do: pip install regex numpy then you can launch the script in the same terminal : python random_weather.py
=AD=uumembwa Posted December 23, 2020 Posted December 23, 2020 terminal said "invalid syntax" (i have installed python 3.5.2)
super-truite Posted December 28, 2020 Author Posted December 28, 2020 I fixed some issues thanks to @NHK295M testing. I finally managed to make a .exe so people do not have to install python. First post updated. I also simplified the code thanks to a nice tool that allows to easily modify the elements of the .Mission files: https://forum.il2sturmovik.com/topic/65469-pyl2-gb-mimec-could-make-your-life-easier/
=AD=uumembwa Posted December 9, 2021 Posted December 9, 2021 In mission file appear new parameter LayerFog = 0; possible script now not correct?
=AD=uumembwa Posted September 28, 2022 Posted September 28, 2022 Problem with new map: Quote randomization done for: blacksea_s.Mission current mission: diep_s.Mission MISSION END: random weather script launched Traceback (most recent call last): File "random_weather.py", line 207, in <module> randomize_weather(current_mission) File "random_weather.py", line 172, in randomize_weather readMissionFromFile(newMission, os.path.join(path_raw_missions, mission)) File "C:\ProgramData\Anaconda3\lib\site-packages\pylgbmimec\basic_functions\mission_class.py", line 182, in readMissionFromFile mission.addObject(newObject) File "C:\ProgramData\Anaconda3\lib\site-packages\pylgbmimec\basic_functions\mission_class.py", line 119, in addObject criticalError(MAP_NOT_FOUND.format(mapName)) File "C:\ProgramData\Anaconda3\lib\site-packages\pylgbmimec\basic_functions\error_handling.py", line 23, in criticalError raise Exception(message) Exception: Error : Map not declared : ""normandy-summer-early" Map must be added in map_size.py file? With this name "normandy-summer-early" (and "normandy-summer-late")? How to find parameters for new maps? Or not only this file must be changed?
=AD=uumembwa Posted October 1, 2022 Posted October 1, 2022 I try edit map_size.py to this: ''' define here map size to be used to indexing (speedup object searching) and default coord. for object creation''' map_size=dict() map_size['lapino']={'XMin':0.0, 'ZMin':0.0, 'XMax':51200.0, 'ZMax':51200.0} map_size['stalingrad']={'XMin':0.0, 'ZMin':0.0, 'XMax':230400.0, 'ZMax':358400.0} map_size['moscow']={'XMin':0.0, 'ZMin':0.0, 'XMax':281600.0, 'ZMax':281600.0} map_size['novosokolniki']={'XMin':0.0, 'ZMin':0.0, 'XMax':51200.0, 'ZMax':51200.0} map_size['vluki']={'XMin':0.0, 'ZMin':0.0, 'XMax':102400.0, 'ZMax':166400.0} map_size['kuban']={'XMin':0.0, 'ZMin':0.0, 'XMax':358395.0, 'ZMax':460800.0} map_size['prokhorovka']={'XMin':0.0, 'ZMin':0.0, 'XMax':166400.0, 'ZMax':166400.0} map_size['rheinland']={'XMin':0.0, 'ZMin':0.0, 'XMax':384000.0, 'ZMax':460800.0} map_size['arras']={'XMin':0.0, 'ZMin':0.0, 'XMax':166400.0, 'ZMax':166400.0} map_size['normandy-summer']={'XMin':0.0, 'ZMin':0.0, 'XMax':396800.0, 'ZMax':396800.0} map_size['normandy-summer-early']={'XMin':0.0, 'ZMin':0.0, 'XMax':396800.0, 'ZMax':396800.0} ''' number of lines and row for the x/Z indexing''' SPLIT_MAP = 3 Will see how it works...
super-truite Posted October 1, 2022 Author Posted October 1, 2022 sorry did not have time to respond. I cannot fix this at the moment. It is a bug of this tool it seems : but what you try could work!
C6_lefuneste Posted October 1, 2022 Posted October 1, 2022 On 9/28/2022 at 7:40 PM, NHK295M said: Problem with new map: Map must be added in map_size.py file? With this name "normandy-summer-early" (and "normandy-summer-late")? How to find parameters for new maps? Or not only this file must be changed? Wow, I was not aware someone was using this ! I'll have a look, but I need to install python again, as I reformat my PC. Map size should ve put only in map_size.py, name should be the same as in mission file. I do not remind now how I measure map size, I think I used the coordinate in mission editor, by moving at X and Y end of the map, 1
=AD=uumembwa Posted October 1, 2022 Posted October 1, 2022 Yes i found max coordinates in mission editor, via ikon on the edge of map. But i away from home, can't say help it or not, atm
=AD=uumembwa Posted October 2, 2022 Posted October 2, 2022 No it still not work with same error message. Maybe must be a some "update" action after files edit? Or maps can be in some another file(s)?
C6_lefuneste Posted October 3, 2022 Posted October 3, 2022 21 hours ago, NHK295M said: No it still not work with same error message. Maybe must be a some "update" action after files edit? Or maps can be in some another file(s)? I'll have a look, but as I said I need to re install my python env....So maybe next WE...
C6_lefuneste Posted October 14, 2022 Posted October 14, 2022 I just added normandy maps in map_size.py and it seems to work. If not please upload your misson here. 1
super-truite Posted October 14, 2022 Author Posted October 14, 2022 Thanks a lot @C6_lefuneste ! @NHK295M, in theory you just have to upgrade the package in your python environment: pip install --upgrade git+https://github.com/lefufu/PylGBMiMec I will check when I can
=AD=uumembwa Posted October 14, 2022 Posted October 14, 2022 this happend after install: (base) PS C:\Users\pimpochka96> cd random_weather (base) PS C:\Users\pimpochka96\random_weather> python random_weather.py Traceback (most recent call last): File "random_weather.py", line 10, in <module> from pylgbmimec.basic_functions.mission_class import * File "C:\ProgramData\Anaconda3\lib\site-packages\pylgbmimec\basic_functions\mission_class.py", line 2, in <module> from .file_functions import getBegining, readGroupFromFile, readObjectFromFile File "C:\ProgramData\Anaconda3\lib\site-packages\pylgbmimec\basic_functions\file_functions.py", line 4, in <module> from basic_functions.error_handling import * ModuleNotFoundError: No module named 'basic_functions' (base) PS C:\Users\pimpochka96\random_weather>
super-truite Posted October 14, 2022 Author Posted October 14, 2022 looks like you do not have the good version of PylGBMimec in your python environment, I do not have this error. Do you use Anaconda ? If so you need first to launch the anaconda console, then activate your environment (in my case: activate il2) then you need to do the update: pip install --upgrade git+https://github.com/lefufu/PylGBMiMec
=AD=uumembwa Posted October 14, 2022 Posted October 14, 2022 2 minutes ago, super-truite said: then activate your environment I don't remember what environment was when i intall random weather activate il2 - not change situation, still same error
=AD=uumembwa Posted October 14, 2022 Posted October 14, 2022 (edited) 14 hours ago, super-truite said: how do you launch the script ? Edited October 15, 2022 by NHK295M delete attach for free space
=AD=uumembwa Posted October 15, 2022 Posted October 15, 2022 How to back to previos version? Now it not work complete, not only error with Normandy
=AD=uumembwa Posted October 22, 2022 Posted October 22, 2022 exe version work but only with old missions, i put in the library.zip new map_size and it not work(program closed without any messages) and i dunno how to change parameters in exe version
=AD=uumembwa Posted October 23, 2022 Posted October 23, 2022 Oh no, exe not work correctly, it delete mission briefing(localisation files are gone) and leave only mission file
=AD=uumembwa Posted November 9, 2022 Posted November 9, 2022 Well i try to search about this error and found this, in original file code without points i try to change it and... Spoiler Before Spoiler 'basic_functions' and 'declarations' was like a files in code, not as directories
super-truite Posted November 27, 2022 Author Posted November 27, 2022 (edited) yes this is indeed that file that causes some problems. I made an update to PylGBMiMec. you can install the new version using pip install --upgrade git+https://github.com/lefufu/PylGBMiMec The changes : I will try to make a new executable, but for some reasons I cannot build it anymore Edited November 27, 2022 by super-truite 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now