I changed the "Classperspectives" function (which is from one of my games) and gave it a more appropriate name for the WeatherLib.
Also fixed a couple minor bugs.
Also modified the Tab so that it can be toggled on/off via the Core Game Features Tab by adding a checkbox to CoreEditorGame.aslx (paste it in from the library).
<?xml version="1.0"?>
<library>
<!--
If you are viewing this on GitHub and want to download it, right click on the RAW button
just above, and select "Save link as..."
-->
<!--
Foundation is
WeatherLib v1.0
Quest version: 5.7
Written by: The Pixie, 2017
Tutorial and notes here:
https://github.com/ThePix/quest/wiki/Weather-Library
Upgrades by IpMan in Quest 5.8 2023
Notes on upgrades found inside this library.
Weather Tab can be hidden/added via features. Requires update to CoreEditorGame.aslx
<control>
<controltype>checkbox</controltype>
<caption>WeatherLib</caption>
<attribute>feature_WeatherLib</attribute>
</control>
-->
<function name="Weather">
if (not HasInt(game, "weathercount")) {
game.weathercount = 0
}
if (game.currentweather = null) {
game.currentweather = PickOneObject(FilterByType(AllObjects(), "weather_type"))
}
game.weathercount = game.weathercount + 1
do (game.currentweather, "weatherchangescript")
if (game.weathertochange) {
game.weathercount = 0
exit = PickOneUnlockedExit(game.currentweather)
game.currentweather = exit.to
if (HasString(exit, "message") and not GetBoolean(game.pov.parent, "inside")) {
msg (exit.message)
}
}
if (not HasInt(game.pov, "soaking")) game.pov.soaking = 0
if (not GetBoolean(game.pov.parent, "inside")) {
game.pov.soaking = game.pov.soaking + game.currentweather.rain
}
else {
game.pov.soaking = game.pov.soaking - 5
}
if (game.pov.soaking > 100) game.pov.soaking = 100
if (0 > game.pov.soaking) game.pov.soaking = 0
</function>
<function name="WeatherReport">
if (not GetBoolean(game.pov.parent, "inside")) {
if (GetBoolean(game, "Night")) {
do (game.currentweather, "nightweatherdesc")
}
else {
msg ("" + game.currentweather.alias)
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
msg ("Outside:")
do (game.currentweather, "look")
}
else {
msg ("Outside:")
do (game.currentweather, "nightlook")
}
}
else {
}
</function>
<function name="LookAtSky" type="string">
return (game.currentweather.look)
</function>
<type name="weather_type">
<rain type="int">0</rain>
<weatherchangescript type="script">
game.weathertochange = RandomChance(game.weathercount)
</weatherchangescript>
<desc type="script">
weatherlook
</desc>
</type>
<!--
Allows sky object to read game.currentweather when looked at.
-->
<function name="weatherperspectives" parameters="this">
do (this, "desc")
</function>
<!--
makenight and makeday are complimentary functions which cycle enable and disable the daytime and nighttime turnscripts.
You can edit them to make them your own, make the days longer/shorter, change the message printed when night time is near.
-->
<function name="makenight">
msg ("{random:'15 turns, and what do you get? Another day older and deeper in debt.':'In the jungle, the quiet jungle the lion sleeps tonight.':'I wear my sunglasses at night so I can so I can...':'Now I lay me down to sleep, I pray the Lord my soul to keep. If I should die before I wake...':'Thank the Lord for the nighttime. Forget the day...':'Sweet dreams baby.'}")
msg ("It'll soon be night time...so you'll have a hard time getting around outside.. and be more likely to die.")
SetTurnTimeout (15) {
DisableTurnScript (daytime)
EnableTurnScript (nighttime)
msg ("The sun has set. It's now nearly impossible to get about without a lightsource outside... slightly more dangerous too.")
SetObjectFlagOn (game, "Night")
}
SetTurnTimeout (60) {
makeday
}
</function>
<function name="makeday">
msg ("You feel the night is waning. It shouldn't be long before sunrise.")
SetTurnTimeout (15) {
DisableTurnScript (nighttime)
EnableTurnScript (daytime)
msg ("In 1 turn it will be daytime.")
SetTurnTimeout (1) {
msg ("{random:'wakeup, get out of bed, drag a comb accross my head.':'Good morning, good morning, good morning, good morning, good morning-ga!':A theme from Peer Gynt plays off in the distance:'Call the sun in the dead of the night and the sun's gonna' rise in the sky!':'Zipadee doo dah, zipadee yay!'}")
msg ("It's now morning. Feel free to move about outside without a lightsource.")
SetObjectFlagOff (game, "Night")
}
}
SetTurnTimeout (75) {
makenight
}
</function>
<!--
More complex look functon which incorporates day/night descriptions
and outside/Windowed descriptions.
-->
<function name="weatherlook">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
do (game.currentweather, "look")
}
else {
do (game.currentweather, "nightlook")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
do (game.currentweather, "look")
}
else {
do (game.currentweather, "nightlook")
}
}
else {
msg ("{random: You can't see the sky from here. : You're pretty sure there's a sky outside. : Um...}")
}
</function>
<!--
Built-in weather objects these have scripts on them which read scripts on game.currentweather (your weather rooms).
They will have different results depending upon whether the player is "outside" or in a room with the "Windowed" attribute.
Those scripts can be added to it via the weather tab. For futher customisation add your own weather objects and use scripts similar to what you see on these objects.
If there is no description given, they have default message scripts. The only scripts you MUST put on your weather rooms are:
nightweatherdesc, look, and nightlook which are the first 3 descriptions that can be added from the weather tab.
You will need to add commands in your game that at least do this:
taste: do (this, "tastedesc")
touch: do (this, "touchdesc")
listen: do (this, "listen")
smell: do (this, "smell")
-->
<object name="sky">
<inherit name="editor_object" />
<scenery />
<alt type="stringlist">
<value>weather</value>
<value>climate</value>
</alt>
<drop type="boolean">false</drop>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
<look type="script">
if (HasAttribute(game.pov.parent, "Windowed")) {
msg ("Outside:")
weatherperspectives (game.currentweather)
}
else {
weatherperspectives (game.currentweather)
}
</look>
<smell type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "smell")) {
do (game.currentweather, "smell")
if (HasAttribute(game.pov.parent, "smell")) {
do (game.pov.parent, "smell")
}
}
else if (HasAttribute(game.pov.parent, "smell")) {
do (game.pov.parent, "smell")
}
else {
msg ("You don't smell anything unexpected.")
}
}
else if (HasAttribute(game.pov.parent, "smell")) {
do (game.pov.parent, "smell")
}
else {
msg ("You don't smell anything unusual.")
}
</smell>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "touchdesc")) {
do (game.currentweather, "touchdesc")
}
else if () {
}
else {
msg ("The weather feels as you'd expect it to.")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
msg ("You really can't feel the weather from in here, but you imagine how it feels outside.")
}
else {
msg ("Um... you can't feel the weather from in here...")
}
</touchdesc>
</object>
<object name="clouds">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daycloudsdesc")) {
do (game.currentweather, "daycloudsdesc")
}
else {
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightcloudsdesc")) {
do (game.currentweather, "nightcloudsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daycloudsdesc")) {
msg ("Outside:")
do (game.currentweather, "daycloudsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightcloudsdesc")) {
msg ("Outside:")
do (game.currentweather, "nightcloudsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
}
else {
msg ("{random: You can't see the sky from here. : You're pretty sure there's a sky outside. : Um...}")
}
</look>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="rain">
<inherit name="editor_object" />
<alt type="stringlist">
<value>torrent</value>
<value>drissle</value>
<value>drizzle</value>
<value>sprinkles</value>
<value>raindrops</value>
</alt>
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "dayraindesc")) {
do (game.currentweather, "dayraindesc")
}
else {
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightraindesc")) {
do (game.currentweather, "nightraindesc")
}
else {
weatherlook
}
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "dayraindesc")) {
msg ("Outside:")
do (game.currentweather, "dayraindesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else if (HasAttribute(game.currentweather, "nightraindesc")) {
msg ("Outside:")
do (game.currentweather, "nightaindesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
msg ("{random: You can't see the sky from here. : You're pretty sure there's a sky outside. : Um...}")
}
</look>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "raintouchdesc")) {
do (game.currentweather, "raintouchdesc")
}
else {
msg ("If it's raining, it's wet...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "raintouchdesc")) {
msg ("{random: You can't feel the rain from in here. : You're not getting wet... : You'll want to go outside first.}")
}
else {
msg ("You don't feel any rain in here.")
}
}
else {
}
</touchdesc>
<smell type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "rainsmell")) {
do (game.currentweather, "rainsmell")
}
else if (HasAttribute(game.pov.parent, "smell")) {
msg ("The rain doesn't have a particular smell, but...")
do (game.pov.parent, "smell")
}
else {
msg ("It smells rainy.")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
msg ("{random: You can't smell the rain from in here. : You're pretty sure it smells like rain out there.. : Um...}")
}
else {
}
</smell>
<listen type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "listenraindesc")) {
do (game.currentweather, "listenraindesc")
}
else if (HasAttribute(game.pov.parent, "listendesc")) {
msg ("Even through the natural rhythm of the rain...")
do (game.pov.parent, "listendesc")
}
else {
msg ("You can almost make out a pattern in the sound of the raindrops landing.")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "listenraindesc")) {
msg ("{random: You can't really hear the rain from in here. : The rainsound is muffled from inside. : What did you want the rain to tell you?}")
}
else {
msg ("You don't hear any rain.")
}
}
else {
}
</listen>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="lightning">
<inherit name="editor_object" />
<alt type="stringlist">
<value>bolts</value>
<value>flashes</value>
<value>balllightning</value>
<value>lightningbolts</value>
</alt>
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daylightningsdesc")) {
do (game.currentweather, "daylightningsdesc")
}
else {
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightlightningsdesc")) {
do (game.currentweather, "nightlightningsdesc")
}
else {
weatherlook
}
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daylightningsdesc")) {
msg ("Outside:")
do (game.currentweather, "daylightningsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightlightningsdesc")) {
msg ("Outside:")
do (game.currentweather, "nightlightningsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
}
else {
msg ("{random: Why are you looking for lightning?. : You're pretty sure there's a sky outside. : Um...}")
}
</look>
<smell type="script">
</smell>
<listen type="script">
if (HasAttribute(game.currentweather, "listenthundesc")) {
do (game.currentweather, "listenthundesc")
}
</listen>
<attr name="feature_usegive" type="boolean">false</attr>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="thunder">
<inherit name="editor_object" />
<scenery />
<visible />
<listen type="script">
if (HasAttribute(game.currentweather, "listenthundesc")) {
do (game.currentweather, "listenthundesc")
}
</listen>
<touchdesc type="script">
</touchdesc>
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daylightningsdesc")) {
do (game.currentweather, "daylightningsdesc")
}
else {
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightlightningsdesc")) {
do (game.currentweather, "nightlightningsdesc")
}
else {
weatherlook
}
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daylightningsdesc")) {
msg ("Outside:")
do (game.currentweather, "daylightningsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightlightningsdesc")) {
msg ("Outside:")
do (game.currentweather, "nightlightningsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
}
else {
msg ("{random: Why are you looking for lightning?. : You're pretty sure there's a sky outside. : Um...}")
}
</look>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="sun">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "sundesc")) {
do (game.currentweather, "sundesc")
}
else {
weatherlook
}
}
else {
msg ("The sun has gone to wherever it goes at night.")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "sundesc")) {
msg ("Outside:")
do (game.currentweather, "sundesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
msg ("The sun has gone to wherever it goes at night.")
}
}
else {
}
</look>
<smell type="script">
</smell>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "feelsundesc")) {
do (game.currentweather, "feelsundesc")
}
else {
weatherlook
}
}
else {
msg ("The sun has gone to wherever it goes at night.")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "sundesc")) {
msg ("You can see the sun outside, but in order to really 'feel' it, you'll have to be out there with it.")
}
else {
msg ("The great outdoors would be the right place for trying to feel the sun...")
}
}
else {
msg ("Whatever heat the sun gave to the world while it was here is dissapating now.")
}
}
else {
}
</touchdesc>
<feature_lightdark />
<lightsource />
</object>
<object name="wind">
<inherit name="editor_object" />
<visible />
<scenery />
<alt type="stringlist">
<value>breeze</value>
<value>gale</value>
<value>gust</value>
<value>blowing</value>
</alt>
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "lookwindesc")) {
do (game.currentweather, "lookwindesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "lookwindesc")) {
msg ("Outside:")
do (game.currentweather, "lookwindesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
}
</look>
<smell type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "smellbreezedesc")) {
do (game.currentweather, "smellbreezedesc")
if (HasAttribute(game.pov.parent, "smell")) {
do (game.pov.parent, "smell")
}
}
else if (HasAttribute(game.pov.parent, "smell")) {
do (game.pov.parent, "smell")
}
else {
msg ("You don't smell anything unexpected.")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
msg ("Sniffing the breeze sounds like an interesting idea...but there's no wind inside...")
}
else {
}
</smell>
<listen type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "listenwindesc")) {
do (game.currentweather, "listenwindesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "listenwindesc")) {
msg ("You probably would be able to hear the wind better from outside...")
}
else {
msg ("You don't hear any wind.")
}
}
else {
}
</listen>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "feelwindesc")) {
do (game.currentweather, "feelwindesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "feelwindesc")) {
msg ("You're sheltered enough here that you don't feel the wind.")
}
else {
msg ("There's no wind to feel in here.")
}
}
else {
}
</touchdesc>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="snow">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "looksnowdesc")) {
do (game.currentweather, "looksnowdesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "looksnowdesc")) {
msg ("Outside:")
do (game.currentweather, "looksnowdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
}
</look>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "feelsnowdesc")) {
do (game.currentweather, "feelsnowdesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "feelsnowdesc")) {
msg ("You're sheltered enough here that you don't feel the snow.")
}
else {
msg ("There's no snow to feel in here.")
}
}
else {
}
</touchdesc>
<tastedesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "snowtastedesc")) {
do (game.currentweather, "snowtastedesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "snowtastedesc")) {
msg ("In the mood for a snowcone? You can't taste the snow from here.")
}
else {
msg ("There's no snow to taste in here.")
}
}
else {
}
</tastedesc>
<listen type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "listensnow")) {
do (game.currentweather, "listensnow")
}
else {
msg ("You don't hear any snow...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "listensnow")) {
msg ("You'd have to be out in the snow to hear it.")
}
else {
msg ("You don't hear any snow...")
}
}
else {
}
</listen>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="sleet">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "looksleetdesc")) {
do (game.currentweather, "looksleetdesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "looksleetdesc")) {
msg ("Outside:")
do (game.currentweather, "looksleetdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
}
</look>
<listen type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "listensleet")) {
do (game.currentweather, "listensleet")
}
else {
msg ("You don't hear any sleet...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "listensleet")) {
msg ("You'd have to be out in the sleet to really hear it.")
}
else {
msg ("You don't hear any sleet...")
}
}
else {
}
</listen>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "sleettouch")) {
do (game.currentweather, "sleettouch")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "sleettouch")) {
msg ("You'd have to be out in the sleet to touch it.")
}
else {
msg ("You don't hear any sleet...")
}
}
else {
}
</touchdesc>
<tastedesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "sleettaste")) {
do (game.currentweather, "sleettaste")
}
else {
msg ("You don't taste any sleet...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "sleettaste")) {
msg ("You'd have to be out in the falling sleet to try to taste it")
}
else {
msg ("um....")
}
}
else {
}
</tastedesc>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="hail">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "lookhaildesc")) {
do (game.currentweather, "lookhaildesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "lookhaildesc")) {
msg ("Outside:")
do (game.currentweather, "lookhaildesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
}
</look>
<listen type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "listenhail")) {
do (game.currentweather, "listenhail")
}
else {
msg ("You don't hear any hail...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "listenhail")) {
msg ("You can hear the hail falling faintly from in here. It must be noisy outside!")
}
else {
msg ("You don't hear any hail...")
}
}
else {
}
</listen>
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "hailfeel")) {
do (game.currentweather, "hailfeel")
}
else {
msg ("You don't feel any hail...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "hailfeel")) {
msg ("You should be grateful that the hail isn't hitting you in here!")
}
else {
msg ("You can't feel any hail...")
}
}
else {
}
</touchdesc>
<tastedesc type="script">
</tastedesc>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="rainbow1">
<inherit name="editor_object" />
<alias>rainbow</alias>
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "lookrainbowdesc")) {
do (game.currentweather, "lookrainbowdesc")
}
else {
weatherlook
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "lookrainbowdesc")) {
msg ("Outside:")
do (game.currentweather, "lookrainbowdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
}
</look>
<tastedesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "rainbowtastedesc")) {
do (game.currentweather, "rainbowtastedesc")
}
else {
msg ("Taste the rainbow, eh? Is that an original idea? Very interesting premise, but you just can't seem to taste one right now...")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (HasAttribute(game.currentweather, "rainbowtastedesc")) {
msg ("Taste the rainbow, eh? I'm glad you tried it, but you probably should at least go out there before trying to taste the thing...")
}
else {
msg ("There's no rainbow to taste in here.")
}
}
else {
}
</tastedesc>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="moon">
<inherit name="editor_object" />
<scenery />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daymoondesc")) {
do (game.currentweather, "daymoondesc")
}
else {
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightmoondesc")) {
do (game.currentweather, "nightmoondesc")
}
else {
weatherlook
}
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (not GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "daymoondesc")) {
msg ("Outside:")
do (game.currentweather, "daymoondesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
if (HasAttribute(game.currentweather, "nightmoondesc")) {
msg ("Outside:")
do (game.currentweather, "nightmoondesc")
}
else {
msg ("Outside:")
weatherlook
}
}
}
else {
}
</look>
</object>
<object name="air">
<inherit name="editor_object" />
<scenery />
<touchdesc type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "touchdesc")) {
do (game.currentweather, "touchdesc")
}
else {
msg ("You don't feel anything unexpected in the air.")
}
}
else {
}
</touchdesc>
<smell type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "smell")) {
do (game.currentweather, "smell")
}
else {
msg ("You don't smell anything unexpected.")
}
}
else {
msg ("You don't smell anything unusual.")
}
</smell>
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (HasAttribute(game.currentweather, "desc")) {
classperspectives (game.currentweather)
}
else {
msg ("Air is invisiblel.")
}
}
else {
msg ("You don't see anything unusual.")
}
</look>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<object name="stars">
<inherit name="editor_object" />
<look type="script">
if (not GetBoolean(game.pov.parent, "inside")) {
if (GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "starsdesc")) {
do (game.currentweather, "starsdesc")
}
else {
weatherlook
}
}
else {
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
if (GetBoolean(game, "Night")) {
if (HasAttribute(game.currentweather, "starsdesc")) {
msg ("Outside:")
do (game.currentweather, "starsdesc")
}
else {
msg ("Outside:")
weatherlook
}
}
else {
}
}
else {
}
</look>
<feature_lightdark />
<lightsource />
<lightstrength>weak</lightstrength>
</object>
<!--
mimis starts the "makenight" function and wakey starts the makeday function for testing or as a cheat code.
-->
<command>
<pattern>mimis</pattern>
<script>
makenight
</script>
</command>
<command>
<pattern>wakey</pattern>
<script>
makeday
</script>
</command>
<!--
daytime and nighttime turnscripts are simple. They set lightness/darkness of outside rooms.
They set background color Gray for night and if you chose to set a daycolor script on the weather tab, will run that.
If you chose not to set a daycolor script, the outside rooms will return to White background during the day.
They also move weather objects to appropriate outdoor/Windowed rooms.
-->
<turnscript name="nighttime">
<script>
if (not GetBoolean(game.pov.parent, "inside")) {
SetDark (game.pov.parent)
MoveObjectHere (sky)
MoveObjectHere (clouds)
MoveObjectHere (rain)
MoveObjectHere (lightning)
MoveObjectHere (thunder)
MoveObjectHere (sun)
MoveObjectHere (snow)
MoveObjectHere (sleet)
MoveObjectHere (hail)
MoveObjectHere (rainbow1)
MoveObjectHere (moon)
MoveObjectHere (wind)
MoveObjectHere (air)
MoveObjectHere (stars)
if (HasAttribute(game.currentweather, "fullmoon")) {
SetBackgroundColour ("Gainsboro")
SetObjectLightstrength (moon, "strong")
}
else if (HasAttribute(game.currentweather, "bloodmoon")) {
SetBackgroundColour ("Tan")
SetObjectLightstrength (moon, "strong")
}
else if (HasAttribute(game.currentweather, "gibbousmoon")) {
SetBackgroundColour ("DarkGray")
foreach (obj, GetDirectChildren(game.pov.parent)) {
SetObjectLightstrength (moon, "weak")
}
}
else if (HasAttribute(game.currentweather, "crescentmoon")) {
SetBackgroundColour ("DimGray")
}
else if (HasAttribute(game.currentweather, "newmoon")) {
SetBackgroundColour ("Black")
SetForegroundColour ("White")
SetObjectLightstrength (moon, "")
}
else {
SetObjectLightstrength (moon, "")
}
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
MoveObjectHere (sky)
MoveObjectHere (clouds)
MoveObjectHere (rain)
MoveObjectHere (lightning)
MoveObjectHere (thunder)
MoveObjectHere (sun)
MoveObjectHere (snow)
MoveObjectHere (sleet)
MoveObjectHere (hail)
MoveObjectHere (rainbow1)
MoveObjectHere (moon)
MoveObjectHere (wind)
MoveObjectHere (stars)
if (HasAttribute(game.currentweather, "fullmoon")) {
SetObjectLightstrength (moon, "weak")
}
else if (HasAttribute(game.currentweather, "bloodmoon")) {
SetObjectLightstrength (moon, "weak")
}
else if (HasAttribute(game.currentweather, "gibbousmoon")) {
SetObjectLightstrength (moon, "weak")
}
else if (HasAttribute(game.currentweather, "crescentmoon")) {
SetObjectLightstrength (moon, "weak")
}
else if (HasAttribute(game.currentweather, "newmoon")) {
SetObjectLightstrength (moon, "")
}
else {
SetObjectLightstrength (moon, "")
}
}
</script>
</turnscript>
<turnscript name="daytime">
<enabled />
<script>
if (not GetBoolean(game.pov.parent, "inside")) {
SetLight (game.pov.parent)
if (HasAttribute(game.pov.parent, "daycolor")) {
do (game.pov.parent, "daycolor")
}
else {
SetBackgroundColour ("White")
}
MoveObjectHere (sky)
MoveObjectHere (clouds)
MoveObjectHere (rain)
MoveObjectHere (lightning)
MoveObjectHere (thunder)
MoveObjectHere (sun)
MoveObjectHere (snow)
MoveObjectHere (sleet)
MoveObjectHere (hail)
MoveObjectHere (rainbow1)
MoveObjectHere (moon)
MoveObjectHere (wind)
MoveObjectHere (air)
SetForegroundColour ("Black")
}
else if (HasAttribute(game.pov.parent, "Windowed")) {
MoveObjectHere (sky)
MoveObjectHere (clouds)
MoveObjectHere (rain)
MoveObjectHere (lightning)
MoveObjectHere (thunder)
MoveObjectHere (sun)
MoveObjectHere (snow)
MoveObjectHere (sleet)
MoveObjectHere (hail)
MoveObjectHere (rainbow1)
MoveObjectHere (moon)
MoveObjectHere (wind)
}
</script>
</turnscript>
<tab>
<parent>_ObjectEditor</parent>
<caption>Weather</caption>
<mustnotinherit>editor_object; editor_player</mustnotinherit>
<onlydisplayif>game.feature_WeatherLib</onlydisplayif>
<control>
<controltype>dropdowntypes</controltype>
<types>*=Not weather; weather_type=Weather</types>
<caption>Weather</caption>
</control>
<control>
<controltype>label</controltype>
<caption>These options add weather functionality.</caption>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Weather change script (must set game.weathertochange)</caption>
<attribute>weatherchangescript</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Inside?</caption>
<attribute>inside</attribute>
<mustnotinherit>weather_type</mustnotinherit>
</control>
<control>
<controltype>label</controltype>
<caption>Indoor rooms from which the player can see the weather will run a variation of "weatherlook" function when player types "look sky," and will have visible objects from currentweather in them.</caption>
<mustnotinherit>weather_type</mustnotinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Can See Outside?</caption>
<attribute>Windowed</attribute>
<mustnotinherit>weather_type</mustnotinherit>
</control>
<control>
<controltype>label</controltype>
<caption>Day color script is meant to assign a background color to outside rooms during the daytime. Can automatically run any script on entry into an outside room durning the day. If not assigned, the room will turn white.</caption>
<mustnotinherit>weather_type</mustnotinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Daytime Room Color(If Not Inside)</caption>
<attribute>daycolor</attribute>
<mustnotinherit>weather_type</mustnotinherit>
</control>
<control>
<controltype>label</controltype>
<caption>Check boxes to add weather elements to this weather.</caption>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Moon</caption>
<attribute>presentmoon</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Clouds</caption>
<attribute>presentclouds</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Rain</caption>
<attribute>presentrain</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Lightning</caption>
<attribute>presentlightning</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Wind</caption>
<attribute>presentwind</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Snow</caption>
<attribute>presentsnow</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Sleet</caption>
<attribute>presentsleet</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Hail</caption>
<attribute>presenthail</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Rainbow</caption>
<attribute>presentrainbow</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Stars</caption>
<attribute>presentstars</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>label</controltype>
<caption>If the moon is present in your weather, choose a phase. The nighttime turnscript will set background color and lighting accordingly.</caption>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Moon Is Full</caption>
<attribute>fullmoon</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Blood Moon</caption>
<attribute>bloodmoon</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Moon Half Or More</caption>
<attribute>gibbousmoon</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>checkbox</controltype>
<caption>Crescent Moon</caption>
<attribute>crescentmoon</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>checkbox</controltype>
<caption>New Moon</caption>
<attribute>newmoon</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>label</controltype>
<caption>Below are various descriptions which can be set for when the senses are used on elements of the weather. The first 3 are mandatory in the same way as the room alias.</caption>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Night Weather Description</caption>
<attribute>nightweatherdesc</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Look At Sky</caption>
<attribute>look</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Look At Night Sky</caption>
<attribute>nightlook</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Look At Sun</caption>
<attribute>sundesc</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Feel Sun</caption>
<attribute>feelsundesc</attribute>
<mustinherit>weather_type</mustinherit>
</control>
<control>
<controltype>script</controltype>
<caption>Day Moon Description</caption>
<attribute>daymoondesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Night Moon Description</caption>
<attribute>nightmoondesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentmoon</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Night Clouds Description</caption>
<attribute>nightcloudsdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentclouds</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Day Clouds Description</caption>
<attribute>daycloudsdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentclouds</onlydisplayif>
</control>
<control>
<controltype>number</controltype>
<caption>Rain amount</caption>
<attribute>rain</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrain</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Night Rain Description</caption>
<attribute>nightraindesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrain</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Day Rain Description</caption>
<attribute>dayraindesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrain</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Rain Feel Description</caption>
<attribute>raintouchdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrain</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Rain Smell Description</caption>
<attribute>rainsmell</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrain</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Rain Sound Description</caption>
<attribute>listenraindesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrain</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Night Lightning Description</caption>
<attribute>nightlightningsdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentlightning</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Day Lightning Description</caption>
<attribute>daylightningsdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentlightning</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Thunder Listen Description</caption>
<attribute>listenthundesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentlightning</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Look Wind</caption>
<attribute>lookwindesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentwind</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Smell Wind</caption>
<attribute>smellbreezedesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentwind</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Listen Wind</caption>
<attribute>listenwindesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentwind</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Feel Wind</caption>
<attribute>feelwindesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentwind</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Look Snow</caption>
<attribute>looksnowdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsnow</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Listen Snow</caption>
<attribute>listensnowdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsnow</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Feel Snow</caption>
<attribute>feelsnowdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsnow</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Taste Snow</caption>
<attribute>tastesnowdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsnow</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Look Sleet</caption>
<attribute>looksleetdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsleet</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Listen Sleet</caption>
<attribute>listensleetdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsleet</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Feel Sleet</caption>
<attribute>sleettouch</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsleet</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Taste Sleet</caption>
<attribute>sleettaste</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentsleet</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Look Hail</caption>
<attribute>lookhaildesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presenthail</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Listen Hail</caption>
<attribute>listenhail</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presenthail</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Feel Hail</caption>
<attribute>hailfeel</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presenthail</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Look Rainbow</caption>
<attribute>lookrainbowdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrainbow</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Taste Rainbow</caption>
<attribute>rainbowtastedesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentrainbow</onlydisplayif>
</control>
<control>
<controltype>script</controltype>
<caption>Look Stars</caption>
<attribute>starsdesc</attribute>
<mustinherit>weather_type</mustinherit>
<onlydisplayif>this.presentstars</onlydisplayif>
</control>
</tab>
</library>