Jump to content

Determining BGII game day as condition for dialogue


ericp07

Recommended Posts

Hello,

 

My mod NPC's J file has a handful of talks that each need to fire only on specific game days, as they pertain to calendar-specific holidays. I've calculated the game day for each of these, but I'm not satisfied that my calculations are correct :) I don't expect anyone to play the game throughout an entire game year, but I wanted to be thorough, so I included each observance anyway. If any of these dates will absolutely never fall within a playthrough, I can omit.

 

Given: Game day 1 is Mirtul/May 1st.

 

Feast of the Summer Solstice: game day 50 (Kythorn/June 20th)

Midsummer Night: game day 72 (One day after Flamerule/July 30th, inserted before Elesias/August 1st)

Feast of the Autumnal Equinox: game day 140 (Eleint/September 21st)

Feast of the Winter Solstice: game day 279 (Nightal/December 20th)

Feast of the Spring Equinox: game day 318 (Ches/March 19th)

 

Would someone please give me a sanity check here? That's step one.

 

Step two is: How should this be coded? My thought was to use CalendarDay, but someone suggested using a timer instead. I'd like to set it up in the most efficient/accurate manner possible.

 

Thanks!

Eric

Link to comment

Theoretically, using a timer means you need to set a global variable, and the more stuff gets accumulated by the game, the slower it becomes. On practice, an extra var equals to zero slowdown, so the should be no real difference what you choose.

Link to comment

Whoa, testing that would be a real joy. I don't think there's a way to advance the game to a specific date, so you would have to find the starting date of the game and then do DayNight() repeatedly to advance the clock all the way to the target date, rather like Domi did with her Coran Friendship to make a week pass.

 

Couldn't she just talk about the holiday in the abstract rather than waiting for the specific day?

 

FYI, my average SoA playthrough is ~45 days, game time (at least according to Gavin's bi-weekly visitation schedule), so unless the player is really taking his time, he'll probably make Summer Solstice, but probably not the rest.

 

Also, you might want to make sure you corroborate the holidays. I'm not seeing Forgotten Realms holidays like Greengrass and Shieldmeet on there. Yes, I remember seeing a website that listed Forgotten Realms holidays as the eight solar holidays, but its credibility was a bit dubious. I use this, which might still be incomplete.

 

All months in the Forgotten Realms calendar have 30 days, with 5 holidays inserted between the months to make up the difference between 360 and 365 days.

 

Mirtul has no holidays in it, but Greengrass occurs on the day between Tarsakh 30 and Mirtul 1.

Kythorn 20 marks Summer Solstice in 1369DR, but not all faiths will commemorate the occasion.

Midsummer falls on the day between 30 Flamerule and 1 Eleasis.

There are no holidays in Eleasis.

Autumn Equinox falls on 21 Eleint in 1369DR, but again, not every faith celebrates.

Highharvestide falls on the day between 30 Eleint and 1 Marpenoth, but there are no holidays in Marpenoth.

The Feast of the Moon occurs on the day between 30 Uktar and 1 Nightall, with Winter Solstice falling on 20 Nightall (ibid).

Midwinter falls on the day between 30 Hammer and 1 Alturiak (Hammer is the first month of 1370DR, the Year of the Tankard... 1369 was the Year of the Gauntlet).

There are no other holidays in Alturiak.

Spring Solstice falls on 19 Ches (and Gavin's birthday on 1 Ches...), but not everyone will celebrate either.

And we're back to Greengrass, on the day between Tarsakh and Mirtul.

 

BG2 is set to occur in 1369DR, the Year of the Gauntlet, which would make BG1 take place in 1368DR, the Year of the Banner. Yes, I really did look all this up once.

 

Edit: Shieldmeet occurs on the day after Midsummer, but only once every 4 years. It happened in 1368DR, so it won't happen again until 1372DR, the year NWN2 is supposed to take place.

 

Edit2: Using a timer means not one but two variables. There's the global variable you set using SetGlobal() and there's the timer itself. If you're using SetGlobalTimer() or RealSetGlobalTimer(), you are creating a global variable that gets stored in the game file. One or two variables=no appreciable slowdown. Five thousand variables, potential lag of a few miliseconds. The game has a fixed number of global variables permitted, but no reasonable installation would ever see that number. If it was modified to the point that it did, the lag from other factors would make the game unplayable anyway.

Link to comment

Yep, I had all the same information about the Calendar of Harptos, and the starting date for BGII. I need only the game day numbers for the equinoxes, solstices, and Midsummer, as these are the festivals observed in Mielikkian (and my NPC's) faith. I might possibly have Meleryn mention other holidays (she will, if the PC asks her about her faith's holidays). Recalculating gave me the following:

 

Holiday Game day

-------- -----------

Summer Solstice 50

Midsummer 91

Autumnal Equinox 142

Winter Solstice 233

Spring Equinox 324

 

I'll plug in the values and give it a try, and post the results.

 

Thanks,

Eric

Link to comment

Huh. You'd think a nature faith would do something for Greengrass and Highharvestide, at least, but go fig.

 

At the very least, the exercise has prompted me to to go work on my long-abandoned fanfic. Though doing so would probably make me want to go back and rewrite the shiity bits, and that's something I dread, so probably best not attempted. It sucks when you don't want to finish a story because you wrote a load of excrement. Seriously. Maybe I'd better just give it a miss until my modding commitments are done.

Link to comment
Huh. You'd think a nature faith would do something for Greengrass and Highharvestide, at least, but go fig.

 

At the very least, the exercise has prompted me to to go work on my long-abandoned fanfic. Though doing so would probably make me want to go back and rewrite the shiity bits, and that's something I dread, so probably best not attempted. It sucks when you don't want to finish a story because you wrote a load of excrement. Seriously. Maybe I'd better just give it a miss until my modding commitments are done.

 

Mielikki is more narrowly focused than, say, Silvanus, so that might account for her having only a handful of holiday observances, rather than take the in-between festivals on as well. Makes sense to me to avoid a harvest festival, as she's not associated with agriculture as a whole, but rather with forestry.

 

"And that's all I have to say about that." :)

Cheers,

Eric

Link to comment

As usual, I've hit a wall here. Weidu complains about my use of CalendarDay(xx) in the conditions of a dialogue:

 

[trigger list near line 138, column 40 of Meleryn/dialogue/EP#MelB.d] PARSE WARNING at line 139 column 1-15
Near Text: )
	[CalendarDay] not found in TRIGGER.IDS
WARNING: cannot verify trigger ~InParty("EP#Mel")
CalendarDay(91)
Global("EP#MelMidsumNight","GLOBAL",0)~: Parsing.Parse_error

 

The code block looks like this:

 

// Meleryn mentions Midsummer Night
IF
~InParty("EP#Mel")
CalendarDay(91)
Global("EP#MelMidsumNight","GLOBAL",0)~
THEN BEGIN EP#MelMidsumNightDesc
SAY ~Tonight is the festival of Midsummer Night. It's a great ritual in my faith, combining revels of the sensual side of life with planting rites and the Wild Ride.~
++ ~Tell me about this Wild Ride, then.~ DO ~SetGlobal("EP#MelMidsumNight","GLOBAL",1)~ GOTO EP#MelMidsumNightDesc_1
END

IF ~~ THEN EP#MelMidsumNightDesc_1
SAY ~During the Wild Ride, the Lady causes unicorns to gather in herds and gallop through the woods. Then, we're allowed to ride them bareback through the night, covering long distances and seeing much. On such rides, the Lady empowers the unicorns to use their teleport ability as often as they wish, and can move up to three times their normal range!~
IF ~~ THEN EXIT
END

 

I've read about CalendarDay in iesdp, and looked at other things in there that have to do with time, but I don't know if it's appropriate to use this for my purpose here. That purpose is, of course, to check if the game is currently on a specific calendar day, as I have about five talks that must happen only on certain dates.

 

As for the spartan nature of my dialogues, I'll add more (mostly PC lines) later, to make it more conversational, after I've gotten all the coding squared away.

 

Weidu accepts everything in my B file prior to this particular block, so there's an encouraging bit of progress :)

 

Please advise.

Thanks,

Eric

Link to comment
You could always turn it into a discussion about the different holidays that is independent of the actual calendar day. People do talk about holidays at times other than on the holiday itself.

 

That would utterly destroy the concept for these particular dialogues. Maybe I should just scrap the whole idea :)

 

There's a token called <GAMEDAY>, but it doesn't appear to me that this is what I need to use.

 

- E

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...