Page 1 of 1

Weather Wishes

Posted: Wed Jan 26, 2022 9:38 pm
by dragon slayer
I like to beable to get the weather in the npc speech like we do region name

I was thinking we should beale to get the say the chance of rain in ccode.

.chanceofrain
.chanceofsnow
.chanceofheat
.chanceofstorm
.maxtemp
.mintemp
.windmax
.windmin
.lightmin
.lightmax

this could be a read onlys o my npc can say this

Code: Select all

var mint = npc.mintemp;
var maxt = npc.maxtemp;
var temp = mint + maxt;

if(temp == 50)
{
   npcspeech.textmsg("well looks like the tempture today will be" + temp.toString() + "so looks like you will need you coats as it will be getting 
   pretty nasty.")
}

Re: Weather Wishes

Posted: Thu Jan 27, 2022 4:18 am
by Xuri
I like your suggestion - exposing more of the weather system to the JS engine will allow scripters to engage with it and come up with interesting new twists. It would probably not be accessed as properties of a Character object as in your example, though, but probably in a similar fashion to how regions are exposed.... aka
// Fetch reference to region myNPC is in
var myRegion = myNPC.region;

// Fetch reference to weather system in region
var myRegionWeather = myRegion.weather;

// Get properties of weather system
var chanceToRain = myRegionWeather.chanceToRain;
var currentTemp = myRegionWeather.temperature;
And so on :)