π Colour actions in Nile
Change the colours during a match: the sky goes red when the last flag falls, a storm rolls in, night turns green. Nile 1.6 TEST6 has an action for every colour, plus Color Fade so changes fade in instead of snapping.
The actions
They are in the General action group, after Fog Color and the other environment actions. Each one writes one line into your map's .wac script.
| Nile action | Writes | Values | What it changes |
|---|---|---|---|
| Fog Color | fogcolor(R,G,B) | 0-127 | the distance haze |
| Horizon Color | skyfog(R,G,B) | 0-127 | the sky band behind distant things |
| Sun Color | sun(R,G,B) | 0-255 | sun / moon light |
| Sky Light Color | sky(R,G,B) | 0-255 | light from above |
| Ground Light Color | ground(R,G,B) | 0-255 | bounce light from below |
| Lightning Color | lightning(R,G,B) | 0-255 | tint of lightning flashes |
| Color Fade | colorfade(seconds) | seconds | how long the next colour changes take |
Fog Color and Horizon Color are at half strength: 127 is already full. For a red haze you want to see as 220,40,40, enter 110,20,20.
Using them in an event
- Make (or open) the event that should change the colours, with its trigger (for example "area captured" or a timer).
- Add Color Fade first if you want a fade, for example 10 seconds.
- Add the colour actions you want, for example Fog Color 110 20 20 and Horizon Color 110 20 20.
- Save and build the map as usual.
In the script that comes out as:
colorfade(10) fogcolor(110,20,20) skyfog(110,20,20)
Put Color Fade before the colours. It sets the fade time for every colour change that comes after it, until another Color Fade changes it. A Color Fade placed after the colours does nothing for those colours.
Going back to the map's own colours
Give a colour any value above 255, for example Fog Color 999 999 999. That colour lets go and goes back to the map's own: the colour you set in MED Map Colours if there is one, otherwise the normal day/night colour. Do it for each colour you changed.
Going back snaps instead of fading. That is a known limit of the DLL, noted for a later version.
Who sees it
The script runs on the server. With the FMJ onHook DLL on the server and the players, the server sends every change to every player, and anyone who joins later gets the current colours within 30 seconds. Without the DLL the actions do nothing (no error, the map just keeps its normal colours). More in who sees the colours.
Wind
The Wind Speed action now says kph: "Set Wind to N kph over N seconds". The FMJ DLL's wind work is on hold, so treat wind as experimental for now.
Tested so far
Nile TEST6 loads the new actions, and every line they write compiles in Joint Ops' own script compiler. Adding them to an event in Nile and playing the map has not been reported yet: if you try it, post how it went in #nile-requests.