You must be logged in to post messages.
Please login or register

The University

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Weather Effects with UserPatch 1.5
posted 08-26-17 04:11 PM CT (US)   

Weather Effects with UserPatch 1.5


By: Zetnus

************************************************************
Introduction

This guide will show you how to implement the new weather effects included in the UserPatch 1.5 (currently in beta). It is relatively simple to use weather both in random map scripts and also in scenarios. However, the weather will only work if the map is played in UP 1.5 or higher.


************************************************************
General Information

There are four things you can control about the weather system. They are the precipitation type, the tint color for visible areas, the tint color for areas obscured by fog of war, and the direction of moving water. Each is controlled by certain numbers, where 0 is the default. Precipitation is rendered above everything, while tinting only applies to terrains but not to objects.

Precipitation Type
0 = none
2 = rain from west to east
-2 = rain from east to west
3 = thunderstorm from west to east
-3 = thunderstorm from east to west
4 = snow from west to east
-4 = snow from east to west

Rain is drops of water and includes a sound effect.
Thunderstorm is like rain but with with occasional flashes of lightning.
Snow is snowflakes and has no sound effect by default.

Live Color the tint color that is applied to terrain within your line of sight
0 = no tint
1 to 255 = see color palette below

Depending on the color, you can make the lighting appear cloudy or otherwise obscured.



Fog Color the tint color that is applied to terrain obscured by fog of war
0 = no tint
1 to 255 = see color palette above

Often it makes sense to pick a similar color for both the live and fog colors.

Water Direction the direction in which dynamic water appears to flow
0 = random direction
1 = west to east
-1 = east to west

Generally it looks good to match the direction of the water with the direction of the precipitation.


************************************************************
Examples

Here are a few examples of color values that you can experiment with:

Default sunny day
Precipitation: 0
Live color: 0
Fog color: 0
Water direction: 0

Cloudy
Precipitation: 0
Live color: 16
Fog color: 33
Water direction: 0

Westward thunderstorm
Precipitation: -3
Live color: 16
Fog color: 0
Water direction: -1

Eastward thunderstorm
Precipitation: 3
Live color: 11
Fog color: 0
Water direction: 1

Eastward snow
Precipitation: 4
Live color: 16
Fog color: 17
Water direction: 1

Foggy
Precipitation: 0
Live color: 255
Fog color: 132
Water direction: 0


************************************************************
RMS Implementation

So how do you actually make use of all this?

In a random map script, all you need to do is this in the <PLAYER_SETUP> section:
weather_type [precipitation] [live] [fog] [water]
for example:

weather_type -4 16 17 0
This would give snow, a blueish tint to both live and fog colors and random water direction.

That's all you need to do. The only other thing worth noting is that you can check for the UserPatch 1.5 using the if UP_EXTENSION conditional. That way you can set up your weather code to only be active if UP 1.5 is available.


************************************************************
Scenario Implementation

So how do you actually make use of all this?

In a scenario, weather is controlled by using trigger effects to tribute certain resources from Gaia to Gaia.

First, you must tribute gaia resource 230 with an the amount -53754 (see image below). This activates the ability to use the weather system in your scenario.
Once you have done this, you can tribute other gaia resources to control the 4 aspects of the weather system discussed earlier.

gaia resource 231 can be used to control the precipitation type, by tributing the numbers mentioned earlier (0, 2, -2, 3, -3, 4, -4).

gaia resource 232 controls the fog color, and accepts any colors from the palette above (0 to 255).

gaia resource 233 controls the live color, and accepts any colors from the palette above (0 to 255).

gaia resource 234 controls the water direction, by tributing 0, 1 or -1.

Weather can be changed dynamically over the course of the scenario, by triggering new tributes of these gaia resources.

Here is an example of what your trigger effects should look like:




************************************************************
Conclusion

Thanks for reading, and I hope you learned something! If you have any questions, feel free to ask them here.

......../\
......./ / / \ Check out my Blacksmith submissions as well as my Random Map Scripts.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Definitive Random Map Scripting Guide
..../_____\\\ \
....\\\\\\\\\\\\\/ and the Random Map Scripting Links and FAQ thread.

[This message has been edited by Zetnus (edited 08-26-2017 @ 04:15 PM).]

Replies:
posted 08-27-17 09:08 AM CT (US)     1 / 9  
Spectacular article. I am sure that this will be consulted by many for years to come!

~ Forgotten Empires ~

Storm on the Steppe | Galderton Hill RP | Proud member of Stormwind Studios

"Deyr fé, deyja frændr, deyr sjálfr it sama; ek veit einn at aldri deyr, dómr um dauðan hvern." - Hávamál 77.
posted 08-27-17 04:54 PM CT (US)     2 / 9  
posted 09-03-17 07:30 PM CT (US)     3 / 9  
Great work, Zetnus! Everything I'm seeing about UP 1.5 is fascination, some incredibly powerful scenario tools are coming with it!

If I recall correctly, you're entitled to claim a custom title, if you so wish!

Member of BlackForest Studios
Co-creator of Silent Evil (4.6) Voted Best Multiplayer Scenario of 2009 (Most Fave'd Multiplayer Scenario)
and The Seas of Egressa (4.8) Voted Best Multiplayer Scenario of 2010
"Popey just hates everywhere." - Chocolate Jesus, on my fear of Romanian organ-traffickers
"Hooray for Dear Leader-Comrade-Generalissimo-Presidente-Lord Protector Popey!" - Lord Sipia, on my benevolent, iron-fisted rule
"You're not Popeychops; you don't get to physics." - Moff, in response to a clumsy muon simile

[This message has been edited by Popeychops (edited 09-03-2017 @ 07:33 PM).]

posted 09-05-17 03:22 AM CT (US)     4 / 9  
I would be entitled to get the custom title of Huskarl for 4 submissions; however, I am aiming directly for Champion at 7, so I still have one more to go I think.

......../\
......./ / / \ Check out my Blacksmith submissions as well as my Random Map Scripts.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Definitive Random Map Scripting Guide
..../_____\\\ \
....\\\\\\\\\\\\\/ and the Random Map Scripting Links and FAQ thread.
posted 09-17-17 07:34 AM CT (US)     5 / 9  
...so i updated to 1.5 but i don't seem to see these resources in the cascade menu...just the usual four...
Tried with age of forgotten empires and age of chivalry hegemony, both don't have the additional features.
If I click in the installer on "create 1.5" then i've got a Conquerors expansion that posseses the new features.

[This message has been edited by Rico_jolla (edited 09-17-2017 @ 12:16 PM).]

posted 09-18-17 03:34 PM CT (US)     6 / 9  
Are you making sure to launch age2_x1.5.exe and not age2_x1.exe ?

......../\
......./ / / \ Check out my Blacksmith submissions as well as my Random Map Scripts.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Definitive Random Map Scripting Guide
..../_____\\\ \
....\\\\\\\\\\\\\/ and the Random Map Scripting Links and FAQ thread.
posted 10-08-17 03:51 PM CT (US)     7 / 9  
I would be entitled to get the custom title of Huskarl...
Everyone wants to be a huskarl!
posted 10-08-17 06:18 PM CT (US)     8 / 9  
I mean I'd prefer to be a Teatonic Knight, or at the very least, Teutonic Knight, but Huskarl was still better than squire.

Time of Tea
Still in the Dark Age
Don't be a melodramatic clown. ~Mr Wednesday
posted 10-14-17 06:02 PM CT (US)     9 / 9  
They're custom titles, you can choose to have whatever you want. I only chose "huskarl" because it's my favourite unit, but that was before I realised everyone else had gone for huskarl as well.
Age of Kings Heaven » Forums » The University » Weather Effects with UserPatch 1.5
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames