Jump to content

Growing Flora


lrh9

Recommended Posts

Hello. I'm thinking about creating a flora related mod where flora plants grow during gameplay by rescaling them. I have a working proof of concept that simply makes the flora grow quickly.

 

http://youtu.be/YEG_vysUQUE

 

This would be my first mod, and I would like some guidance and help.

 

I'm open to any suggestions. My immediate concern is that I want flora growth to be based on several factors. I want one of the factors to be the in-game season. I have looked in the Construction Set for a variable or setting that might give me this information, on the Construction Set Wiki, and on the forums. I am unable to find how to determine the season.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

furfur1974 and MOTOSXORPIO directed me to examine how Weather - All Natural and Enhanced Seasons determine the current season. Both mods seem to determine the season based on the global variable GameDaysPassed. Thank you for reading. Edited by lrh9
Link to comment
Share on other sites

GameDaysPassed returns the number of days since you started this particular game.

It will not help you with determinig the season.

 

Use GameMonth and GameDay, instead.

 

Weather - All Natural and Enhanced Seasons both determine the season using the following formula:

 

short dayOfYear

set dayOfYear to (GameDaysPassed + 238) % 365
if dayOfYear <= 166 ;Spring
elseif dayOfYear <= 260 ;Summer
elseif dayOfYear <= 355 ;Fall
else ;Winter
endif

Link to comment
Share on other sites

That formula makes no sense as it will be spring 45% of the year, Summer and Fall 26% each and winter 2% of the year.

 

Using vanilla new game, we all start the game on Last Seed 27. By our calendar, that is March/27, so the formula sets Spring to start on Nov/20, Summer on May/5, Fall on Aug/07 and Winter from Nov/10 to Nov/19.

 

Weird! Unless, of course, if this is done on purpose (I am not familiar with the lore and Nim's astronomical characteristics).

 

Another problem is that you may use an alternate start mod that changes the game start date, in which case, the seasons woud be shifted.

 

Something like this seems more 'natural':

 

If GameMonth <= 3
   ;  Jan-Feb-Mar > Winter
ElseIf GameMonth <= 6
   ;  Apr-May-Jun > Spring
ElseIf GameMonth <= 9
   ;  Jul-Aug-Sep > Summer
Else
   ;  Oct-Nov-Dec > Fall
endif

 

And you may turn it more precise by throwing GameDay into the formula.

Link to comment
Share on other sites

Thank you for responding. I'm reviewing the scripts to see if I made a mistake and misread or misquoted the scripts in question. I cannot see it if I did. I did the calculations to see how the seasons broke down, and you are right. Spring half of the year. I think Enhanced Seasons may have made an error. At least Weather - All Natural adds in another check for dayOfYear less than or equal to 44, which it refers to as deep winter. That breaks it down so that winter is ~15%, spring ~33%, summer ~26%, fall ~26%.

 

http://www.uesp.net/wiki/Lore:Calendar

 

The lore on the Elder Scrolls calendar differs between games. Daggerfall featured months with an equal number of days (30) in each. Oblivion and Skryim match the Gregorian calendar, and Morrowind is very similar excepting a missing month.

 

I don't know if in Elder Scrolls lore the seasons differ greatly from our own. I am reading the lore and various holidays seem to be associated with seasons.

 

Flower Day (First Seed 25th) is a celebration in High Rock when children pick the new flowers of spring.

 

Drigh R'Zimb is a festival held in the hottest time of the year in Hammerfell. That might correlate with summer.

 

It is a topic worth looking further into, and I might even contact the authors of Weather - All Natural and Enhanced Seasons. However, you state that the game begins on Last Seed and that corresponds to March of our calendar. Looking at the lore page for calendar, Last Seed corresponds to August.

 

Assuming:

The first day of spring is March 20.

The first day of summer is June 21.

The first day of fall is September 22.

The first day of winter is December 21.

That Oblivion seasons map directly to Gregorian seasons.

 

Then in Oblivion:

The first day of spring is First Seed 20.

The first day of summer is Midyear 21.

The first day of fall is Hearthfire/Heartfire 22.

The first day of winter is Evening Star 21.

 

So I calculate that the formula (GameDaysPassed + 238) % 365 is fairly correct to return the day of the year. However, I calculate the comparison values should be like this:

 

NOTE: Edited to incorporate QQuix's fixes.

 

short dayOfYear

set dayOfYear to (GameDaysPassed + 239) % 365
if dayOfYear < 79
;Winter
elseif dayOfYear < 172
;Spring
elseif dayOfYear < 265
;Summer
elseif dayOfYear < 355
;Fall
else
;Winter
endif

 

That results in a much more even equidistribution of seasons, with winter at ~24%, spring at ~25%, summer at ~25%, and fall at ~25%. (Does not total 100% due to rounding.)

 

...

Edited by lrh9
Link to comment
Share on other sites

My mistake. Last Seed is August, all right (March is First Seed)

 

The script seems good.

 

But if you want to be picky . . . the formula sets January 1st as DayOfYear = 0.

Starting the counting at 0 makes March, 20th dayOfYear = 78, not 79.

You may change the formula to (GameDaysPassed - 239) % 365 to set January 1st as day 1 and the rest falls in place.

Not really relevant, of course.

Edited by QQuix
Link to comment
Share on other sites

I made Season a global variable, and I am using a quest script to update it. It works correctly if I start a new game, but if I load a game saved without the mod present, the script doesn't work. How do I get the script to work for those saves?
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...