Forecast - Weather Layering System
[
Author Note ]
What simply started out as tinkering rapidly became a colossal script. Or, at least, the most complex script I have written, so far. Although, that is not saying much.
While I have certainly learned more while writing this script, I consider myself rather green when it comes to coding. So, I figured that I would post here. I would very much appreciate anyone glancing over the code and offering suggestions for optimization, features or simply offering some neat coding tricks.
The primary feature of layering and the standard rain, storm, and snow weather work fine, as well as the added hail and petal effects (ported from CCoa's weather script). Issues may arise if the filter system is used, however.
[
Introduction ]
In the beginning, I simply wanted to dynamically resize and affix the second viewport to the map, as well as change the z-coordinate value (much like parallax mapping, but with weather effects). However, as I remembered that pictures also use the second viewport, I shifted my focus to creating my own separate weather layer. Then I figured that I may as well aim for the function to create multiple weather layers to allow for mixing and matching. After that, I figured I may as well introduce the ability to change the color, tone and other settings for both the viewport and sprites on the screen. And on the script goes ...
To give an example of usage, let us say that an author of a game has rain active outside of a house. When the player enters the house, the author is forced to clear the weather, as rain inside of a house does not make much sense. However, if the author had the ability to shift the z-coordinate, he/she could place the weather beneath the tileset or parallax map. Therefore, if there were a window within the house, the weather could still be visible to the player, along with any flashing (lightning, etc) or effects that may occur. The rect of the layer could be altered as well, so that the weather was contained within a smaller region (negate spill-over from behind the tileset, or images).
Or, in another example, if the current map was configured for a semi-side scrolling state, there could be weather in the foreground (zoomed in, and blurred to denote closeness to the 'camera') as well as weather in the background (zoomed out).
[
Completed Features ]
[
Buggy Features ]
[
Planned Features ]
- Weather Fade Control
- Weather Load with Map