Guest deleted2027229 Posted April 15, 2023 Share Posted April 15, 2023 Anyone know how I'd do this, ie if its snowing or heavy rain, script adds a custom spell that drains players attributes. Link to comment Share on other sites More sharing options...
RomanR Posted April 16, 2023 Share Posted April 16, 2023 For vanilla there is a set of commands IsPleasant/IsCloudy/IsRaining/IsSnowing. If you need exact weather for some reason, OBSE has GetCurrentWeatherID function, which can be used like this: ... ref weather ... (somewhere in begin/end block) ... if player.IsInInterior == 0 set weather to GetCurrentWeatherID if weather != 0 if weather == Clear print "It's sunny right now." elseif weather == Cloudy print "It's cloudy right now." elseif weather == Fog print "Mist is all around you." elseif weather == Rain print "Now it's raining." elseif weather == Snow print "Now it's snowing." elseif weather == Thunderstorm print "The storm rages on." elseif weather == Overcast print "Overcast." else print "Custom, special defined or Oblivion weather." endif endif endif ... Link to comment Share on other sites More sharing options...
RomanR Posted April 16, 2023 Share Posted April 16, 2023 Oh, I completetely forgot about vanilla GetIsCurrentWeather it seems. I'm adding a link to weather commands, just for sure:https://cs.elderscrolls.com/index.php?title=Category:Weather_Functions Link to comment Share on other sites More sharing options...
RomanR Posted April 16, 2023 Share Posted April 16, 2023 OK, I made some quest script example using vanilla GetIsCurrentWeather and GetCurrentWeatherPercent commands. Quest itself is set to priority 25 and script attached is: scn RomRStormSlowingQuestScript short storm begin GameMode if player.IsInInterior == 0 if GetIsCurrentWeather Thunderstorm && GetCurrentWeatherPercent >= 0.08 set storm to 1 endif if storm != 0 && player.HasSpell AbStormSlowdown == 0 Message "Storm began to slow you down..." player.AddSpellNS AbStormSlowdown endif if GetIsCurrentWeather Thunderstorm == 0 && GetCurrentWeatherPercent >= 0.08 if player.HasSpell AbStormSlowdown != 0 Message "At last a storm is over..." player.RemoveSpell AbStormSlowdown set storm to 0 endif endif else if player.HasSpell AbStormSlowdown != 0 Message "You escaped a storm's slowing effects." player.RemoveSpell AbStormSlowdown endif endif end As you see this scripts is adding or removing a spell, nothing more. Spell itself is a simple ability with some Drain Atribute effects (speed and agility) defined. Script was tested with ForceWeather command, so you will need propably adjust percentage for coming storm, as ForceWeather command already sets a weather at full transition already. Also you can change OBSE AddSpellNS command for vanilla one, but I found that vanilla workaround to supress messages makes too much delay to add spell in quest for some reason. Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted April 17, 2023 Share Posted April 17, 2023 Your script looks nice. To avoid any mod conflict you should better make yoru editor ID's with a combination of yoru nickname, a description of the object and the acronym of your mod. Link to comment Share on other sites More sharing options...
Recommended Posts