Bay 12 Games Forum

Please login or register.

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

Author Topic: Advanced Modding Tutorial Mod: A Mod for Modders  (Read 4079 times)

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Advanced Modding Tutorial Mod: A Mod for Modders
« on: September 09, 2013, 06:26:04 pm »


After doing quite a bit of modding of my own, I've learned how to do some interesting things with DF, some of which I'm guessing would be useful for other people.  So I decided to make this mod.

This will be a mod for helping modders.  This is an experimental project: a collection of fully-functional raw files that demonstrate modding techniques and tricks, from the simple to the advanced.  Instead of piling up a huge amount of content, this mod will be very streamlined: each entry should demonstrate one or two unique 'gimmicks', which should be clearly marked and explained in the raw files, with an explanation of how they work and how they can be implemented into other people's mods.

I'd like to request other people to contribute to this project!  If you've created any interesting creatures, interactions, etc, please send them forward!

Some guidelines:
Spoiler (click to show/hide)

See existing entries for examples.

Entries so far:

Ragemonkey, an ape that goes completely berserk when injured.
Fluffball, a completely invincible and adorable ball of fluff.
Chomp, a powerful domestic creature with a metal shell that can be melted down, and a random tendency to misbehave.
Fleurberri, a creature made out of plants, with a brewable berry for a heart, and that gets stronger when outside and weaker underground.
Great Devourer, a megabeast that can swallow its victims whole, and can be temporarily sated by leaving dead bodies for it to eat. It can be tamed, but will go berserk if not kept fed with a steady diet of whole corpses or live animals.
Transformo, a transforming robot that retains damage between forms.

Super Mushroom, a seasonal crop that makes whoever eats it double in size, making them much more dangerous in combat. Remember the square cube law!
Crazyweed, a grass that can make animals who graze on it go berserk.

Scarecrow Syndrome, which makes its victim unable to use physical attacks but still able to crawl around and use special techniques.
Disintegrate, which does exactly what it sounds like.
Demonbreaker, a spell that depowers and shrinks demons, night creatures, bogeymen, vampires, werewolves, and the undead, but has no effect on normal creatures. Demons are reduced to the size of humans, other fiends are shrunken down proportionally, making them about the size of large vermin.
Walking Wasteland, an effect that gradually kills every enemy on the map.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #1 on: September 10, 2013, 12:01:11 am »

Very nice, I especially like the CAVE_ADAPTION trigger :) I'll be following this.
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 :::

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #2 on: September 13, 2013, 07:08:53 am »

New version up!  This one has several interactions relating to changing creature's sizes, like supersizing and shrinking.  It also includes the Great Devourer, a megabeast that can swallow its victims whole, a demon-targeting interaction, and a spell that can hit all enemies on the map at once.

RickRollYou2

  • Bay Watcher
  • [START_BIOME:EARTH]
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #3 on: September 13, 2013, 08:12:02 am »

Nice! I love seeing mods like these, especially when they come with walkthrough commentaries in the raws!
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #4 on: September 13, 2013, 08:30:39 am »

Quote
a demon-targeting interaction
?

How did you do this? I know the procedually generated demons have a DEMON tag, but I am quite sure that you cant call that in interactions.
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 :::

RickRollYou2

  • Bay Watcher
  • [START_BIOME:EARTH]
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #5 on: September 13, 2013, 08:39:38 am »

Apparently it targets
Spoiler (click to show/hide)
and then removes the tag... could be a problem if you have those tags in another creature but
Spoiler (click to show/hide)
an immune class is provided! Very thoughtful.
Logged

RickRollYou2

  • Bay Watcher
  • [START_BIOME:EARTH]
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #6 on: September 13, 2013, 08:44:43 am »

If I'm reading the raws right, does this mean if I keep the Great Devourer caged, and release it during a siege via lever, it could "eat" (I know it's an interaction) my enemies? And be safely retrieved afterwards? (since it's been "sated")

EDIT: [CE_BODY_TRANSFORMATION:START:0:END:100] Seems to be missing a PROB... My bad, realised you don't need a PROB for 100%

I just gave every single one of my custom creatures the ability to devour corpses... now they eat my enemies' dead bodies. SO BEAUTIFUL
« Last Edit: September 13, 2013, 09:09:09 am by RickRollYou2 »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #7 on: September 13, 2013, 08:55:00 am »

Ah, so it targets every creature that has these tags, but only demons and custom creatures have the correct tags. All custom creatures get a immune-class, therefore only demons are the one legal target left. That is indeed smart.

It does open the question about FBs, Werebeasts, Vampires and Titans though, which may or may not also  include all the mentioned tags, but cannot have the immune-class, since they are procedually generated as well.

I have to look at extracted raws for these before I say more, but a titan only, fb only and demon only interaction would indeed be fun.

Very clever, I really like it. :) Keep up the good work.
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 :::

scamtank

  • Bay Watcher
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #8 on: September 13, 2013, 01:44:44 pm »

Ah, so it targets every creature that has these tags, but only demons and custom creatures have the correct tags. All custom creatures get a immune-class, therefore only demons are the one legal target left. That is indeed smart.

It does open the question about FBs, Werebeasts, Vampires and Titans though, which may or may not also  include all the mentioned tags, but cannot have the immune-class, since they are procedually generated as well.

I dug around a bit. The DRINK/EAT/SLEEP/PAIN/STUN/NAUSEA/FEAR/EXERT/DIZZY/FEVER/BREATHE immunities seem to be part of the standard package for every generated creature there is. The LEARN/SPEAK requirements narrow it down a bit to a.) vampires b.) demons c.) all night creatures such as boogeymen, proc-named spouse grabbers and werecreatures.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #9 on: September 14, 2013, 02:35:16 pm »

Night Creatures do not appear in fprt-mode, and vampires are no creatures... they are interactions given to creatures, a dwarf-vampire is still a dwarf, and his immune-class will still work.

So yeah, this seems to work. I still have to look at the titans/fbs though...
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 :::

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #10 on: September 22, 2013, 06:31:12 am »

Updated, adding only one creature, but it's a good trick with many potential applications: a transforming creature that retains damage between forms, enabling prolonged battles without having to kill it in the space of one form.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #11 on: December 22, 2013, 09:39:48 pm »

This looks cool, where are the comments? I totally missed it!

Quote
Transformo, a transforming robot that retains damage between forms.
What do you mean "retains damage"? Do you mean it keeps damaged by its leaking hot liquid which melts it or what?

Quote
[I_EFFECT:HIDE] <-- Prevents some glitch messages.
I wonder about this in the eating interactions. What does it mean?

P.S. The devourer is AMAZING.

Quote
It abuses a quirk of the AI that a creature chooses its targets in order, but will not use the interaction if it cannot find both an 'A' target and a 'B' target.
It's a great find, it allows a good combination of spells I want to make to be avaliable! Like, being able to maintain one aura at a time and stuff like that :). Thank you.
« Last Edit: December 22, 2013, 09:51:49 pm by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Tsuchigumo550

  • Bay Watcher
  • Mad Artificer
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #12 on: December 23, 2013, 09:50:04 am »

Admittedly I don't have anything to contribute, as my mod-fu is rather pitiful, but I do have a question.

Would it be possible to have a creature spawn a number of creatures, preferably within a range of numbers, upon death? Furthermore, would it be possible to tie this to the creature in such a way that certain causes of death don't allow the spawn reaction to happen? I'm kinda wanting a symbiote/parasite sieger, that if killed in standard combat, spawns 1-3 smaller, weaker, syndrome-carrying beasties. Different castes of the creature spawn different amounts: a Knight is the classification for a human-sized symbiote capable of using weapons, only spawns 1, most are Brutes, incapable of using weapons, comes with different built-in weapons depending on caste, spawns 1-3, some are Carriers, with no weapons and no capability to use them that spawn 4-6 creatures. If any of this is possible, I can probably build the castes from there if I can figure out castes well enough.

The creatures themselves should be rather fast, crawling about and attacking via bite that may cause nausea and very rarely cause necrosis, localized.

Even if you can't get them to spawn on-death conditionally, if they could be able to spawn them one time and one time only that would be OK as well, and noncombat methods of killing them should work on the resulting creatures as well (magma burns, water drowns, keas steal, life goes on).
Logged
There are words that make the booze plant possible. Just not those words.
Alright you two. Attempt to murder each other. Last one standing gets to participate in the next test.
DIRK: Pelvic thrusts will be my exclamation points.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #13 on: December 23, 2013, 10:51:38 am »

That's not that hard to do. Make them resurrect themselves and apply a syndrome as they do it. The resurrection should have IT_CANNOT_HAVE_SYNDROME_CLASS, and the syndrome class is defined in your resurrection syndrome, so they can only resurrect once. The resurrection should turn them into lesser forms of the creatures you want.

This way if you chop someone's hand off, it becomes a parasite.

If you want a single creature to split in multiple no matter what, make it transform (when resurrected) into a creature consisting of a few bodies connected together with a tissue which boils at room temperature, and give it interaction to resurrect its parts as lesser creatures.

This way the following happens:
1) a creature dies.
2) gets resurrected by an ally as a weird 3-body combo.
3) connective tissue boils away, only one main body remains, and 2 "bodies" which are technically bodyparts that fell off.
4) the remained body resurrects those bodyparts as similar creatures (which are technically different, since they are defined as one-body variants of three-body creature in the raws).

Don't forget to apply syndrome when you resurrect with SYNDROME_CLASS:SOMETHING and make sure your resurrection interactions check that there's no SOMETHING on the bodies already, to prevent endless resurrections.
« Last Edit: December 23, 2013, 10:55:00 am by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Advanced Modding Tutorial Mod: A Mod for Modders
« Reply #14 on: December 26, 2013, 05:36:45 pm »

There is a tiny bug that I found.

SUPER_MUSHROOM_AMT => The growdur is 3 entire seasons. Its active seasons are spring, summer and autumn. This means if you plant it 01. day of spring, then wait three months (all spring, all summer, all winter), then you can harvest it 01. day of winter. But first day of winter it will wither, because winter is not an active season.
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