Do we have worm signs?
We do, in the weather selection of this menu:
witch are in this program:
OpenRails_Unstable_WeatherExt3.zip (59.86MB)
Number of downloads: 42
-----------------------------------------------------
Clear in back to being clear, Rain and Snow also have the same parameters as normal just with other dome/cloud textures.
I've added 3 new weather types Few, cloudy and Desert, and made 2K/4K prof of concept textures.
Only tested in exploration mod. Sound files still point to clear.sms
Weather type extension code.
MainForm.cs
public MainForm()
{
var Weathers = new[] {
new KeyedComboBoxItem(0, catalog.GetString("Clear")),
new KeyedComboBoxItem(1, catalog.GetString("Snow")),
new KeyedComboBoxItem(2, catalog.GetString("Rain")),
new KeyedComboBoxItem(3, catalog.GetString("Few")),
new KeyedComboBoxItem(4, catalog.GetString("Cloudy")),
new KeyedComboBoxItem(5, catalog.GetString("Desert")),
};
#######################################################################################
ActivityFile.cs
public enum WeatherType { Clear = 0, Snow, Rain, Few, Cloudy, Desert }
#######################################################################################
Sky.cs
public SkyMaterial(Viewer viewer)
// ExRail: Weather texture selector
switch (Viewer.Simulator.WeatherType)
{
case Orts.Formats.Msts.WeatherType.Clear:
SkyTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "SkyDomeClear.png"));
CloudTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "CloudsClear.png"));
break;
case Orts.Formats.Msts.WeatherType.Rain:
SkyTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "SkyDomeRain.png"));
CloudTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "CloudsRain.png"));
break;
case Orts.Formats.Msts.WeatherType.Snow:
SkyTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "SkyDomeSnow.png"));
CloudTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "CloudsSnow.png"));
break;
case Orts.Formats.Msts.WeatherType.Few:
SkyTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "SkyDomeFew.png"));
CloudTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "CloudsFew.png"));
break;
case Orts.Formats.Msts.WeatherType.Cloudy:
SkyTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "SkyDomeCloudy.png"));
CloudTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "CloudsCloudy.png"));
break;
case Orts.Formats.Msts.WeatherType.Desert:
SkyTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "SkyDomeDesert.png"));
CloudTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "CloudsDesert.png"));
break;
}
#######################################################################################
Weather.cs
public WeatherControl(Viewer viewer)
{
Viewer = viewer;
Weather = Viewer.Simulator.Weather;
var pathArray = new[] {
Program.Simulator.RoutePath + @"\SOUND",
Program.Simulator.BasePath + @"\SOUND",
};
ClearSound = new List<SoundSourceBase> {
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_in.sms"), false),
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_ex.sms"), false),
};
RainSound = new List<SoundSourceBase> {
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "rain_in.sms"), false),
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "rain_ex.sms"), false),
};
SnowSound = new List<SoundSourceBase> {
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "snow_in.sms"), false),
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "snow_ex.sms"), false),
};
FewSound = new List<SoundSourceBase> {
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_in.sms"), false),
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_ex.sms"), false),
};
CloudySound = new List<SoundSourceBase> {
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_in.sms"), false),
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_ex.sms"), false),
};
DesertSound = new List<SoundSourceBase> {
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_in.sms"), false),
new SoundSource(viewer, Events.Source.MSTSInGame, ORTSPaths.GetFileFromFolders(pathArray, "clear_ex.sms"), false),
};
WeatherSounds.AddRange(ClearSound);
WeatherSounds.AddRange(RainSound);
WeatherSounds.AddRange(SnowSound);
WeatherSounds.AddRange(FewSound);
WeatherSounds.AddRange(CloudySound);
WeatherSounds.AddRange(DesertSound);
public void SetInitialWeatherParameters()
{
// These values are defaults only; subsequent changes to the weather via debugging only change the components (weather, overcastFactor and fogDistance) individually.
switch (Viewer.Simulator.WeatherType)
{
case WeatherType.Clear: Weather.OvercastFactor = 0.05f; Weather.FogDistance = 20000; break;
case WeatherType.Rain: Weather.OvercastFactor = 0.7f; Weather.FogDistance = 1000; break;
case WeatherType.Snow: Weather.OvercastFactor = 0.6f; Weather.FogDistance = 500; break;
case WeatherType.Few: Weather.OvercastFactor = 0.17f; Weather.FogDistance = 20000; break;
case WeatherType.Cloudy: Weather.OvercastFactor = 0.18f; Weather.FogDistance = 6000; break;
case WeatherType.Desert: Weather.OvercastFactor = 0.03f; Weather.FogDistance = 8000; break;
default: break;
}
}
public void UpdateWeatherParameters()
{
Viewer.SoundProcess.RemoveSoundSources(this);
switch (Viewer.Simulator.WeatherType)
{
case WeatherType.Clear: Weather.PrecipitationLiquidity = 1; Weather.PricipitationIntensityPPSPM2 = 0; Viewer.SoundProcess.AddSoundSources(this, ClearSound); break;
case WeatherType.Rain: Weather.PrecipitationLiquidity = 1; Weather.PricipitationIntensityPPSPM2 = 0.010f; Viewer.SoundProcess.AddSoundSources(this, RainSound); break;
case WeatherType.Snow: Weather.PrecipitationLiquidity = 0; Weather.PricipitationIntensityPPSPM2 = 0.0050f; Viewer.SoundProcess.AddSoundSources(this, SnowSound); break;
case WeatherType.Few: Weather.PrecipitationLiquidity = 1; Weather.PricipitationIntensityPPSPM2 = 0; Viewer.SoundProcess.AddSoundSources(this, FewSound); break;
case WeatherType.Cloudy: Weather.PrecipitationLiquidity = 1; Weather.PricipitationIntensityPPSPM2 = 0; Viewer.SoundProcess.AddSoundSources(this, CloudySound); break;
case WeatherType.Desert: Weather.PrecipitationLiquidity = 1; Weather.PricipitationIntensityPPSPM2 = 0; Viewer.SoundProcess.AddSoundSources(this, DesertSound); break;
default: break;
}
}
void UpdateSoundSources()
{
Viewer.SoundProcess.RemoveSoundSources(this);
switch (Viewer.Simulator.WeatherType)
{
case WeatherType.Clear: Viewer.SoundProcess.AddSoundSources(this, ClearSound); break;
case WeatherType.Rain: Viewer.SoundProcess.AddSoundSources(this, RainSound); break;
case WeatherType.Snow: Viewer.SoundProcess.AddSoundSources(this, SnowSound); break;
case WeatherType.Few: Viewer.SoundProcess.AddSoundSources(this, FewSound); break;
case WeatherType.Cloudy: Viewer.SoundProcess.AddSoundSources(this, CloudySound); break;
case WeatherType.Desert: Viewer.SoundProcess.AddSoundSources(this, DesertSound); break;
default: break;
}
}
#######################################################################################
RouteFile.cs
public string ENVFileName(SeasonType seasonType, WeatherType weatherType)
{
// ExRail Weathertypes expansion - ignore extra WeatherTypes to avoid conflicting with ENV file/parsing
if (((int)weatherType) > 2)
weatherType = WeatherType.Clear;