Checking for specific date

For all talk about quest development - creation, testing, and quest system.
User avatar
haloterm
Posts: 391
Joined: Sat Feb 16, 2019 5:21 am

Checking for specific date

Post by haloterm »

In the recent update of my Black Horse Courier questmod, I use a timer to start one quest at a specific date. As the start date of a new game is always the same, this ensures that my intended date is correct.

Of course this only works if the questmod is used with a new game, where I set up everything in the beginning. But if it is used with an existing save game (by using the startquest console command), the timer simply counts from the current date. This will still start the quest, but on a different day than intended.

So it would be nice to be able to check if we have a specific date in quests.

Edit: If checking for a really specific date is too complex, something like the existing "daily" but for the day of years would be sufficient, too. For example:

In addition to the existing "daily" as in

_Evening_ task:
daily from 20:00 to 23:59

I'd also like something similar for the days in a year, like

_SummerSeason_ task:
day from 180 to 230

(days 180 to 230 in a year, which is roughly July to end of September)

or

_SummerSeason_ task:
month from 7 to 9

(months 7 to 9 / July to September).

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Checking for specific date

Post by pango »

I hoped "Wayrest Painting" (S0000017) would give some useful informations since it says "before end of next season", but it seems it's in fact not timed...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
haloterm
Posts: 391
Joined: Sat Feb 16, 2019 5:21 am

Re: Checking for specific date

Post by haloterm »

Yes, it is just a "soft" way of putting some urgency to that quest.

Would be cool if DFU's quest language could be enhanced to take such conditions into account. One could create lots of holiday-related quests this way, too.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Checking for specific date

Post by TheLacus »

haloterm wrote: Sun Feb 14, 2021 10:13 am Would be cool if DFU's quest language could be enhanced to take such conditions into account. One could create lots of holiday-related quests this way, too.
Quest engine is driven by actions. Mods can defines new actions and register them with QuestMachine.RegisterAction(IQuestAction).

User avatar
haloterm
Posts: 391
Joined: Sat Feb 16, 2019 5:21 am

Re: Checking for specific date

Post by haloterm »

TheLacus wrote: Sun Feb 14, 2021 3:09 pm
haloterm wrote: Sun Feb 14, 2021 10:13 am Would be cool if DFU's quest language could be enhanced to take such conditions into account. One could create lots of holiday-related quests this way, too.
Quest engine is driven by actions. Mods can defines new actions and register them with QuestMachine.RegisterAction(IQuestAction).
So you mean I could define an equivalent to TEMPLATE's "daily from ... to ..." by programming some C# code?

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Checking for specific date

Post by Hazelnut »

Yes, that's been possible for ages. All of the quest actions I wrote, and some from DFIronman, were added to core DFU because they were generally useful. However they started life in mods.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
haloterm
Posts: 391
Joined: Sat Feb 16, 2019 5:21 am

Re: Checking for specific date

Post by haloterm »

Hazelnut wrote: Sun Feb 14, 2021 7:42 pm Yes, that's been possible for ages. All of the quest actions I wrote, and some from DFIronman, were added to core DFU because they were generally useful. However they started life in mods.
Is there somewhere an example? (I think in your own mods, there's none, is it?)

While I have a basic understanding of C# syntax I'm no programmer. So I guess I will continue to focus on writing my quests themselves, and avoiding ideas which are not possible with default template language; I guess that time is better spent :D

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Checking for specific date

Post by TheLacus »

haloterm wrote: Sun Feb 14, 2021 8:30 pm
Hazelnut wrote: Sun Feb 14, 2021 7:42 pm Yes, that's been possible for ages. All of the quest actions I wrote, and some from DFIronman, were added to core DFU because they were generally useful. However they started life in mods.
Is there somewhere an example? (I think in your own mods, there's none, is it?)
Source code for all core actions is here, while this is DailyFrom.

User avatar
haloterm
Posts: 391
Joined: Sat Feb 16, 2019 5:21 am

Re: Checking for specific date

Post by haloterm »

TheLacus wrote: Sun Feb 14, 2021 9:32 pm
haloterm wrote: Sun Feb 14, 2021 8:30 pm
Hazelnut wrote: Sun Feb 14, 2021 7:42 pm Yes, that's been possible for ages. All of the quest actions I wrote, and some from DFIronman, were added to core DFU because they were generally useful. However they started life in mods.
Is there somewhere an example? (I think in your own mods, there's none, is it?)
Source code for all core actions is here, while this is DailyFrom.
I read that code and it seems I have understood it enough to adjust it to my needs ... is it correct that I simply include a C# file with my action (based on the example) and then in my mod's main C# file I use the aforementioned RegisterAction method to "inform" DFU about my new actions?

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Checking for specific date

Post by Hazelnut »

yes that's correct
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply