More often rain, fog weather

Users who are viewing this thread

stephan_dinavoa

Sergeant at Arms
Good day to you all

Thank you for helping me understand what changes I must make in order to deal with this

Scarcely there is rain or fog or snow, almost always it's sunny. So I want to know how I can make all other weathers appear much more often.

 
There are two neat commands you can use for this. 'set_rain' and 'set_fog_distance'.
 
so typical... thats just the response he needed.....

check here: http://forums.taleworlds.com/index.php/topic,72678.msg1888624.html#msg1888624

it has something to do with it. I personally dont know how but perhaps you find your answer there.
 
[quote author= Halcyon]so typical... thats just the response he needed.....[/quote]
:neutral: Alright then...

To make some more rain in your scenes (more often), you can use the set_rain operation. The full "formula" for set_rain is (set_rain,<rain-type>,<strength>). The rain types are 1 as normal rain and 2 as snow, strength can be anywhere in the range of 0-100. So, if you'd want rain in your scene, you would use this script.
Code:
(set_rain, 1, 75), #Rather rainy.

For snow, however, you could use the same thing, expect change the "rain type".
Code:
(set_rain, 2, 75), #Rather snowy.

Now, if you want it to be more often, or common, then you'd simply have to make a mission templates trigger, where you'd run a check before the mission begins if you want the rain or not. One trigger would be something like this.
Code:
rain = (
    ti_before_mission_start, 0, ti_once, [],
	[
	    (store_random_in_range, ":rain_power", 0,100),
		 (set_rain, 1, ":rain_power"),
	])

We first make sure the trigger is run before the mission starts or actually loads in by using ti_before_mission_start on the check interval, and we also are sure that the trigger is run only once by ti_once. In the conditions block, we have nothing, however, this is not the case in the consuqences block. There, we store a random number from 0 to 100 and assign the rain to be rain type 1, that means it will not be snow, and put the rain's power as the random number to make sure you never get the same, dull rain.

Though, for the fog, the formula is (set_fog_distance, <distance_in_meters>, [fog_color]). The distance in meters is exactly what it says ... the distance in meters! What it means is that, when you set the distance_in_meters as 100, for example, then the rain will be pretty much un-noticeable because you have set the fog 100 meters away from you. The fog_color is the color of the fog in Hexadecimal code, e.g for white it should be something like "0x0FF000" or similar.

So, you could use the exactly same thing for fog.
Code:
fog = (
    ti_before_mission_start, 0, ti_once, [],
	[
	    (store_random_in_range, ":fog_distance", 25,100),
		(set_fog_distance, ":fog_distance", 0x0000FF),
	])

Notice how we changed the random number from 0,100 to 25,100. That's because if the random number gets to be 0 or something like 5, you won't be able to see anything at all. Now, to include those basic scripts and get them work, you would simply add them to your wanted mission templates by simply typing them out there, such ast his 'fog,' and 'rain,'. Notice the comma.

cdvader
 
my goodness, that is a wonderful reply. I thank you very much.

I cant' figure out where do I write all this.?. Do I need the modyle, py thing?
 
I wonder why you did not do that in the first place.

This would make all weather changes more common on the entire map correct?

Also thanks for the correct reply.
 
Actually, I did mention where to put it. In the module_mission_templates.py, and yes, this needs the ModuleSystem, or the "py thing".

This doesn't change anything on the map, I'm afraid. However, it'll do so in the scenes/battles.
 
ah, that is what i meant. Something put me off into thinking that it was only for custom scenes. I did not get my morning coffee lol. I thought fog made the world map blurry sometimes, when you are in the fogs area.
 
i have a problem with my scene specific weather, therefore i have made a post here to yoschiboy may can answer:

Edit: solved here!

http://forums.taleworlds.com/index.php/topic,109558.0.html
 
Back
Top Bottom