Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 8

Author Topic: Holidays  (Read 8668 times)

brolol.404

  • Bay Watcher
    • View Profile
Holidays
« on: September 19, 2019, 02:45:02 pm »

I had an idea to somehow make seasons more seasonal by somehow incorporating aspects of holidays into the game. Although holidays are a cultural thing (and therefore would be handled per civ during gameplay), I was trying to think if there was a way to incorporate holidays into the gane through a mod.

This could take the form of certain characters/creatures showing up at certain times or somehow adding holiday specific items for use during their holiday season or specific seasonal crops/food etc. Does anyone have any thoughts on this? Any ideas on bringing holidays into the game? The holidays wouldn't have to be the modern holidays, but take inspiration from them (e.g. fall: harvest festival, spooky festival, feast, winter: gifts, decorated trees, etc.)

DerMeister

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #1 on: September 19, 2019, 04:36:35 pm »

I had an idea to somehow make seasons more seasonal by somehow incorporating aspects of holidays into the game. Although holidays are a cultural thing (and therefore would be handled per civ during gameplay), I was trying to think if there was a way to incorporate holidays into the gane through a mod.

This could take the form of certain characters/creatures showing up at certain times or somehow adding holiday specific items for use during their holiday season or specific seasonal crops/food etc. Does anyone have any thoughts on this? Any ideas on bringing holidays into the game? The holidays wouldn't have to be the modern holidays, but take inspiration from them (e.g. fall: harvest festival, spooky festival, feast, winter: gifts, decorated trees, etc.)
Bad idea for mod. This will not holiday for dwarves. Add suggestion to forum, this will be in future update.
Logged

Unknown72

  • Bay Watcher
  • Undead Enthusiast, at your service.
    • View Profile
Re: Holidays
« Reply #2 on: September 19, 2019, 05:20:33 pm »

There isn't a way to mess with the Date files to do something like this? I can fire away on ideas for holidays but I don't know how viable it is to have it so that only specific enemies/creatures/foods/objects can be made on those days.
Logged
You guys ought to fix Unknown72's turn to some point later in the order. Maybe after Sanctume. Normally that's what happens when someone fesses up to having real life going up like a storm of explosive diarrhoea blasted into a fan.

@me on Discord: Multi#0897

NJW2000

  • Bay Watcher
  • You know me. What do I know?
    • View Profile
Re: Holidays
« Reply #3 on: September 19, 2019, 06:24:23 pm »

I imagine this would be pretty hard, from the little I know of DF modding. A couple of ideas do spring to mind though.

DF crops are seasonal in some cases, I think. Plants can also be seasonal, as can trees. So for major emphasis on seasons, season-specific plants would work. I'm not sure if you can make shrubs, say, that die after a week of maturity, but if that's possible, you could probably make food that could only be gathered in a certain week.

Nobles and occupations like outpost liaison and traders only visit at certain times, perhaps something could be done with that.

You could make creatures that only survive in certain temperature ranges? Dubious as temperature varies with elevation.



Actually, I'm an idiot. The best way to do this would be to mod in holiday specific cultures with their own creatures, items, occupations, etc, with caravans that visit during specific seasons. Possibly instead of the other civs.

This would make adventure mode a bit weird, and you might end up at war with Halloweentown, but this method would be simplest and best, I think. Caveat: I'm not a modder.
Logged
One wheel short of a wagon

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Holidays
« Reply #4 on: September 19, 2019, 06:30:56 pm »

Mh... Roses has his building-subtype-change scripts, which can change workshops based on a timer. One could do "holiday decorations" that automatically change with time. Show a pumpkin lantern and spiderwebs for halloween, show pretty lights for christmas, etc. Or whatever holidays you will come up with.

There are of course seasonal plants for farmplots, which could be used to grow christmas trees etc in winter. SPRING, SUMMER, AUTUMN, WINTER also works on wild plants.

The same counts for grasses. For example in my Warlock fort I had a nice view of the mountain avens starting to bloom in winter, slowly spreading over the map.

Color changes on leaves on trees are a thing, just like their grows. You can easily make a conifer tree that "grows" pretty glass spheres and candles at a specific time of year, using GROWTH_PRINT and GROWTH_TIMING.

There are caste-specific creature tokens, NO_SPRING (summer, autumn, winter), that disable them from appearing. So you could have castes: "bunny" for summer and autumn, an "white winter bunny" for winter, and a "easter bunny" for spring. But I don't know how much people will notice, considering the large amount of animals in the game. The chances that your few modded ones will show up are rare.

Active seasons are of course also a part of entities. You could have the hogfather or christmas elves appear in winter, with their "sled" wagon, being pulled by reindeers or hogs. ^^ Same for the other seasons. Spooky Jack Skelington coming by in autumn to peddle pumpkins and skulls.

Overall: Yes, you can kinda do this, but most options would affect the entire season, not just a few days/weeks. I would assume that dfhack scripts would be much better options for this. Big popup, pausing the game, saying "THE HOLIDAY OF X HAS STARTED!" and for the next week all plants grow instantly; or dwarves get free alcohol, or happy thoughts added. All undead put to rest, that sort of thing.

I had an idea to somehow make seasons more seasonal by somehow incorporating aspects of holidays into the game. Although holidays are a cultural thing (and therefore would be handled per civ during gameplay), I was trying to think if there was a way to incorporate holidays into the gane through a mod.

This could take the form of certain characters/creatures showing up at certain times or somehow adding holiday specific items for use during their holiday season or specific seasonal crops/food etc. Does anyone have any thoughts on this? Any ideas on bringing holidays into the game? The holidays wouldn't have to be the modern holidays, but take inspiration from them (e.g. fall: harvest festival, spooky festival, feast, winter: gifts, decorated trees, etc.)
Bad idea for mod. This will not holiday for dwarves. Add suggestion to forum, this will be in future update.
If people enjoy doing mods, why not let them?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

brolol.404

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #5 on: September 19, 2019, 06:45:59 pm »

There isn't a way to mess with the Date files to do something like this? I can fire away on ideas for holidays but I don't know how viable it is to have it so that only specific enemies/creatures/foods/objects can be made on those days.

It is easy to make creatures spawn only in certain seasons and crops to only grow in certain times of year, but specific dates I am not sure about. Were beasts only transform on the full moon which is a recorded date in game, so I assume that there might be some way to tie things to a specific date possibly through secrets (at least to the full moon dates). If nothing else that would be three full moons each season.

I imagine this would be pretty hard, from the little I know of DF modding. A couple of ideas do spring to mind though.

DF crops are seasonal in some cases, I think. Plants can also be seasonal, as can trees. So for major emphasis on seasons, season-specific plants would work. I'm not sure if you can make shrubs, say, that die after a week of maturity, but if that's possible, you could probably make food that could only be gathered in a certain week.

You could make creatures that only survive in certain temperature ranges? Dubious as temperature varies with elevation



What plants/creatures do you think would work here? Make turkeys and pumpkins really common in the fall? Or more specific and have actual ghosts/headless horsemen running around in fall and father winter and reindeer running around in the winter?

Actually, I'm an idiot. The best way to do this would be to mod in holiday specific cultures with their own creatures, items, occupations, etc, with caravans that visit during specific seasons. Possibly instead of the other civs.

This would make adventure mode a bit weird, and you might end up at war with Halloweentown, but this method would be simplest and best, I think. Caveat: I'm not a modder.

This could actually be really cool. Reminds me of the nightmare before Christmas with the different holiday trees. What holiday towns/cultures should I include?

Mh... Roses has his building-subtype-change scripts, which can change workshops based on a timer. One could do "holiday decorations" that automatically change with time. Show a pumpkin lantern and spiderwebs for halloween, show pretty lights for christmas, etc. Or whatever holidays you will come up with.

There are of course seasonal plants for farmplots, which could be used to grow christmas trees etc in winter. SPRING, SUMMER, AUTUMN, WINTER also works on wild plants.

The same counts for grasses. For example in my Warlock fort I had a nice view of the mountain avens starting to bloom in winter, slowly spreading over the map.

Color changes on leaves on trees are a thing, just like their grows. You can easily make a conifer tree that "grows" pretty glass spheres and candles at a specific time of year, using GROWTH_PRINT and GROWTH_TIMING.

There are caste-specific creature tokens, NO_SPRING (summer, autumn, winter), that disable them from appearing. So you could have castes: "bunny" for summer and autumn, an "white winter bunny" for winter, and a "easter bunny" for spring. But I don't know how much people will notice, considering the large amount of animals in the game. The chances that your few modded ones will show up are rare.

Active seasons are of course also a part of entities. You could have the hogfather or christmas elves appear in winter, with their "sled" wagon, being pulled by reindeers or hogs. ^^ Same for the other seasons. Spooky Jack Skelington coming by in autumn to peddle pumpkins and skulls.

Overall: Yes, you can kinda do this, but most options would affect the entire season, not just a few days/weeks. I would assume that dfhack scripts would be much better options for this. Big popup, pausing the game, saying "THE HOLIDAY OF X HAS STARTED!" and for the next week all plants grow instantly; or dwarves get free alcohol, or happy thoughts added. All undead put to rest, that sort of thing.

This is all really good info. I'm actually not familiar with dfhack at all, but I may be interested in learning it for this mod. I could make the whole seasons more seasonal while also making specific date holidays. Is there a list of dfhack capabilities? Could I have a specific creature spawn on a specific day using dfhack?

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Holidays
« Reply #6 on: September 19, 2019, 08:14:31 pm »

About the full moon triggers, they are part of the so called Counter-Triggers:
Quote
ALCOHOLIC   How long it's been (in time units) since the creature last had a drink of alcohol. Only present on creatures who need alcohol to get through the working day.
100800 (3 months) = and is starting to work slowly due to its scarcity
201600 (6 months) = and really wants a drink
302400 (9 months) = and has gone without a drink for far, far too long
403200 (1 year) = and can't even remember the last time he/she had some

CAVE_ADAPT   How cave-adapted the creature is. Increases by 1 for every time unit spent underground, to a maximum of 800000.
403200 (1 year) = going outside causes irritation
604800 (1.5 years) = going outside causes nausea

PARTIED_OUT   How long before the creature will decide to attend another party. Starts at 3+ months and counts down to zero.
MILK_COUNTER   How long before the creature can be milked again. Starts at the creature's MILK frequency and counts down to zero.
EGG_SPENT   How long before the creature can lay more eggs. Starts at 3 months and counts down to zero.
GROUNDED_ANIMAL_ANGER   How angry (and likely to attack) an animal is from being over-crowded. Increases when over-crowded and otherwise counts down to zero.
TIME_SINCE_SUCKED_BLOOD   How long it's been (in time units) since the creature last sucked somebody's blood.
DRINKING_BLOOD   How much longer the creature will be drinking somebody's blood. Starts at 2.4 days and counts down to zero.

Not really useful for exact dates.

Dfhack capabilities are anything you can dream of. You can write things in C++, lua or ruby. Head down the rabbit hole here: https://dfhack.readthedocs.io/en/stable/docs/Lua%20API.html It has nothing to do with modding anymore and is proper programming. ;) You can also have a look at the uncompiled source here https://github.com/DFHack/dfhack
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

brolol.404

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #7 on: September 19, 2019, 09:35:20 pm »


Dfhack capabilities are anything you can dream of. You can write things in C++, lua or ruby. Head down the rabbit hole here: https://dfhack.readthedocs.io/en/stable/docs/Lua%20API.html It has nothing to do with modding anymore and is proper programming. ;) You can also have a look at the uncompiled source here https://github.com/DFHack/dfhack

Thanks. I'll look at this tomorrow. How do I get started in dfhack? Can I use notepad or do I need something like notepad++? Do I need a compiler? Is there a simple getting started guide? (i.e. what do download, where to put in code, where to save the files/code, etc)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Holidays
« Reply #8 on: September 20, 2019, 06:38:02 am »

Notepad++ would be better than notepad :D Compiler yes for plugins (c++), no for scripts (lua, ruby). Getting started guide: No idea, I don't think so. But a "getting started with C++/lua/ruby" book/tutorial would help. ^^
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

brolol.404

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #9 on: September 20, 2019, 08:36:31 am »

Notepad++ would be better than notepad :D Compiler yes for plugins (c++), no for scripts (lua, ruby). Getting started guide: No idea, I don't think so. But a "getting started with C++/lua/ruby" book/tutorial would help. ^^

Thanks. I took a college course on C++ and have used it in the past, but not sure how to tie it into DF. Maybe I will try and take a look at one of your mods.

Roses

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #10 on: September 20, 2019, 10:45:46 am »

Notepad++ would be better than notepad :D Compiler yes for plugins (c++), no for scripts (lua, ruby). Getting started guide: No idea, I don't think so. But a "getting started with C++/lua/ruby" book/tutorial would help. ^^

Thanks. I took a college course on C++ and have used it in the past, but not sure how to tie it into DF. Maybe I will try and take a look at one of your mods.

Personally I would suggest starting with lua because no compilation is necessary and you can do much of the same things (not everything). And it will give you a sense of how data is stored. Also if you want to share your scripts with others it just involves sharing your single file instead of an entire compiled version, or expecting others to compile it (you can get around this by adding stuff directly to the dfhack release if what you want to do can only be done in c++).

lua is fairly straight forward, there is a couple oddities like all languages have, but I think it's easy enough to pick up. There are dozens (hundreds maybe?) lua scripts already in DFHack that you can look at for examples. Some modders and others also have their own repos for scripts. Putnam has some really good ones, I have a LOT that are so-so, and there are a lot of other authors that have some as well. The sky is basically the limit when you start thinking about modding with DFHack scripts included.

Of the top of my head for a holidays thing, you could have buildings change for different holidays (they wouldn't even need to look different but they could have different reactions available). Transform invaders and random creatures based on the holiday as the enter the map. Give units specific interactions for specific holidays (give a "scare" reaction to dwarves during "Halloween"). Change personality traits, physical/mental attributes, emotions for given holidays. Add certain pets/items to caravans for certain holidays. Trigger weather effects for certain holidays. Change the value of certain materials/items. And a whole lot more
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #11 on: September 21, 2019, 05:58:59 pm »

Notepad++ would be better than notepad :D Compiler yes for plugins (c++), no for scripts (lua, ruby). Getting started guide: No idea, I don't think so. But a "getting started with C++/lua/ruby" book/tutorial would help. ^^

Thanks. I took a college course on C++ and have used it in the past, but not sure how to tie it into DF. Maybe I will try and take a look at one of your mods.

Personally I would suggest starting with lua because no compilation is necessary and you can do much of the same things (not everything). And it will give you a sense of how data is stored. Also if you want to share your scripts with others it just involves sharing your single file instead of an entire compiled version, or expecting others to compile it (you can get around this by adding stuff directly to the dfhack release if what you want to do can only be done in c++).

lua is fairly straight forward, there is a couple oddities like all languages have, but I think it's easy enough to pick up. There are dozens (hundreds maybe?) lua scripts already in DFHack that you can look at for examples. Some modders and others also have their own repos for scripts. Putnam has some really good ones, I have a LOT that are so-so, and there are a lot of other authors that have some as well. The sky is basically the limit when you start thinking about modding with DFHack scripts included.

Of the top of my head for a holidays thing, you could have buildings change for different holidays (they wouldn't even need to look different but they could have different reactions available). Transform invaders and random creatures based on the holiday as the enter the map. Give units specific interactions for specific holidays (give a "scare" reaction to dwarves during "Halloween"). Change personality traits, physical/mental attributes, emotions for given holidays. Add certain pets/items to caravans for certain holidays. Trigger weather effects for certain holidays. Change the value of certain materials/items. And a whole lot more

Awesome thanks. This may be a dumb question, but where do I start? Do I need some sort of template file to start from or can I just open a new notepad++ file and start pasting in premade scripts? Does the file get saved directly into the DF main folder? What is the file extension? How does the game know to read it or will dfhack automatically start it up based on the name of the file? Do I just drag and drop df hack into the DF folder as well or do I need to do something extra with it to include my own scripts?

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Holidays
« Reply #12 on: September 22, 2019, 07:06:50 am »

New file in notepad is fine.

Save in dwarffortress/hack/scripts/brolol

File extension is .lua.

The dfhack.init or onload.init will run the script if you tell it to. Usually it's just a line, like "stardwarf 10" or "autobutcher enable". It depends on the script, some have arguments, some don't.

Nothing needed to run custom scripts, except copying them in there.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

brolol.404

  • Bay Watcher
    • View Profile
Re: Holidays
« Reply #13 on: September 22, 2019, 07:15:31 am »

New file in notepad is fine.

Save in dwarffortress/hack/scripts/brolol

File extension is .lua.

The dfhack.init or onload.init will run the script if you tell it to. Usually it's just a line, like "stardwarf 10" or "autobutcher enable". It depends on the script, some have arguments, some don't.

Nothing needed to run custom scripts, except copying them in there.

Awesome thanks. I guess my question is, where do you put the code to tell dfhack.init to run it? In the new lua file itself?

As in, how does a modder set commands to run during gameplay once certain conditions are met?

e.g. how do you tell dfhack to run "spawnunit RACE CASTE" on a specific date? How is it called on during gameplay by dfhack?
« Last Edit: September 22, 2019, 07:18:40 am by brolol.404 »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Holidays
« Reply #14 on: September 22, 2019, 08:31:43 am »

Into the dfhack.init.

Modders can't really set commands during gameplay, but there is an entire subsection of scripts called modtools. https://dfhack.readthedocs.io/en/stable/docs/_auto/modtools.html There you can select different things that might trigger the script, anything from interactions, reactions, syndromes, projectiles, items... that way the player or dwarves(!) can trigger the scripts.

If you want a script to trigger at a specific date, you have to write the script for that yourself. That doesn't exist so far, as far as I know. You could make it check every X ticks for the date; if date is Y; then do Z. Simple If/Else.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::
Pages: [1] 2 3 ... 8