Space Engineers

Space Engineers

评价数不足
Official Modding Guide: Automatic Weather System
由 Jakaria 和其他 2 人合作完成
This is the official guide for modding the automatic weather system in Space Engineers.
   
奖励
收藏
已收藏
取消收藏
1. Software
Creating weather systems requires a text editor to edit the definitions. I recommend Notepad++.
Get Notepad++ [notepad-plus-plus.org]
2. Example Mod
You can download an example mod here, open the Triton.sbc and use the find function (Ctrl-F) to find "Weather"
You should see this:
3. Weather Frequency
Each planet has its own frequency of weather. It is determined by the <WeatherFrequencyMin> and <WeatherFrequencyMax> variables. Every time the planets "weather counter" reaches a random range selected, the counter will reset and create at all players on said planet. There is also a <GlobalWeather> variable, this determines if the weather created will encompass the entire planet instead of localized weather. It's a good alternative for small moons that all use a single biome, they do not use voxels.
<WeatherFrequencyMin>20</WeatherFrequencyMin> <WeatherFrequencyMax>180</WeatherFrequencyMax> <GlobalWeather>false</GlobalWeather>
All counting values are in time spans of seconds, in the example above this means a weather will be created every 20-180 seconds if there is not one already existing at the player's position.
4. Weather Generators
In each planet definition, there is a list called "WeatherGenerators", this is where you will define which voxel will create what weather effect. A WeatherGenerator contains a Voxel's MaterialTypeName and a list of possible weathers for that voxel.
<WeatherGenerators> <WeatherGenerator> abc </WeatherGenerator> <WeatherGenerator> xyz </WeatherGenerator> <WeatherGenerators>
4.1 Inside the Generator
A weather generator needs a voxel's MaterialTypeName to function, the MaterialTypeName is used instead of the voxel's SubTypeId to help prevent excessively long text files. You can think of MaterialTypeName's as a "group" for the voxel.
<WeatherGenerator> <Voxel>Snow</Voxel> <Weathers> <Weather> abc </Weather> <Weather> xyz </Weather> </Weathers> </WeatherGenerator>
4.2 Inside the Generator 2
Now that we've established what voxel we want to create weather, we need to define what weathers it will make! Each WeatherGenerator contains a list of what voxels it wants to create. It contains the Name, Weight, MinLength, MaxLength, and Offset.

The Name variable is used to create the weather, give it the name of a weather you want to make such as FogLight, or RainHeavy. You can enter the game and run /weatherlist to see all possible ones in that world.
The Weight variable is what it sounds like, it is a weight for the weather when it is being selected with RNG. A weather effect with a larger weight will be picked more often than ones with less.
The MinLength and MaxLength variables are for telling how long you want the weather to last, in seconds. It similarly selects a random range when the weather is being created.
The Offset variable is used when the weather's position is being generated, if this value is 2000, it will generate (2000 + radius) meters away from the player.
<WeatherFrequencyMin>20</WeatherFrequencyMin> <WeatherFrequencyMax>180</WeatherFrequencyMax> <WeatherGenerators> <WeatherGenerator> <Voxel>Snow</Voxel> <Weathers> <Weather> <Name>SnowLight</Name> <Weight>3</Weight> <MinLength>300</MinLength> <MaxLength>1200</MaxLength> <SpawnOffset>1000</SpawnOffset> </Weather> <Weather> <Name>SnowHeavy</Name> <Weight>1</Weight> <MinLength>300</MinLength> <MaxLength>2400</MaxLength> <SpawnOffset>1000</SpawnOffset> </Weather> </Weathers> </WeatherGenerator> <WeatherGenerator> <Voxel>Ice</Voxel> <Weathers> <Weather> <Name>FogLight</Name> <Weight>1</Weight> <MinLength>300</MinLength> <MaxLength>900</MaxLength> <SpawnOffset>1000</SpawnOffset> </Weather> <Weather> <Name>FogHeavy</Name> <Weight>1</Weight> <MinLength>300</MinLength> <MaxLength>900</MaxLength> <SpawnOffset>1000</SpawnOffset> </Weather> <Weather> <Name>SnowHeavy</Name> <Weight>1</Weight> <MinLength>300</MinLength> <MaxLength>2400</MaxLength> <SpawnOffset>1000</SpawnOffset> </Weather> </Weathers> </WeatherGenerator> </WeatherGenerators>
This is what a complete weather system may look like for a planet with only snow and ice on the surface.
5. Closure
Thanks for reading this guide, I hope it helps you create a good weather system for your custom planet. If you'd like to create custom weather effects, see the guide linked below.
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2130397635
23 条留言
Maverick 3 月 18 日 下午 8:41 
This guide was really great, but I still had many issues and questions, specifically for section 4.1 regarding voxels, MaterialTypeName, and SubTypeId. I made a clarification guide for those still having issues trying to get their weather working. I couldn't fit it here in the comments.
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3447506508
Wildust 2023 年 8 月 26 日 上午 9:56 
Well, i'm probably stupid, but i can't even find the right file in my case.
I'd like to add an automatic weather system for a custom planet that has none. I can see every vanilla planet files (i.e : pertham.sbc) but in my mod's folder, i can't find it. The closest thing would be SpicePlanetGeneratorDefinitions.sbc, but there's no line inside about weather. And i'm really not sure i should paste something in there...
Can someone tell me how to get the proper file, please ?
Cthulhu 2023 年 6 月 25 日 上午 2:46 
the fastest guide in the west
ARK7 2021 年 3 月 18 日 上午 6:51 
2 questions, (modding)

1. Is it possible to change a planet’s weather on a different sbc file then the planet’s data file?

2. Is it possible to have a planet that it would default to when a different one is not in the area? (Instead of a ‘clear’ weather being on the planet, you could have light rain that would occasionally become heavy rain.)
Look_around_cutie ^^ 2021 年 2 月 23 日 上午 11:23 
can i spawn weather globally somehow?
Jakaria  [作者] 2020 年 12 月 3 日 下午 6:48 
there is also now ElectricStorm
Mike Dude 2020 年 8 月 9 日 下午 4:46 
I saw the new snow, I like it! Can you explain more on the offset and radius? The weather appears to follow some sort of path, is this true?
Jakaria  [作者] 2020 年 8 月 7 日 下午 12:19 
there is a new MarSnow for y'all to mess about with. :)
Galeocerdo7 2020 年 7 月 8 日 上午 10:18 
Any guidance on using weather conditions for programmable block functions? Such as turning on decoys during thunderstorms
t2hk 2020 年 7 月 2 日 上午 9:16 
And yes, I do have automatic weather on.