Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding to add a Necromancer to my fortress  (Read 1277 times)

redrowen

  • Bay Watcher
    • View Profile
Modding to add a Necromancer to my fortress
« on: April 12, 2013, 10:48:34 am »

Hey All!

I'm not overly used to modding in DF, though I have been playing around in DFHack more recently.

What I want to do is add a Necromancer tag to a creature within my fortress, can anyone help me out with what tag I would need to add to give a creature type the ability to raise the dead? 

My fortress is starting to get a little Dull now that my military is trained up and I want to add a little additional !FUN! :D

Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #1 on: April 12, 2013, 11:33:26 am »

There's not a single "necromancer tag".  You'll have to learn a bit about interaction modding.  Make (or copy) a raise dead interaction (lots of mods already have them, you can look in Orc Fortress for one for example) and then you have to decide how you want to deploy it.  Either put it as a [CAN_DO_INTERACTION] in a creature file, or you can make an inorganic boiling stone that conveys a syndrome with the effect CE_CAN_DO_INTERACTION, or you can even go further and use e.g. Putnam's itemsyndrome to make an enchanted object. 

redrowen

  • Bay Watcher
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #2 on: April 12, 2013, 11:53:24 am »

Thanks for the response,

So I will want to add CAN_DO_INTERACTION:RAISE_CORPSE_FRIENDLY to the creature_standard.txt?  Am I able to designate the specific creature type?  For example, if I want to allow Mummy to raise dead (which are considered Human) would I need to find the Mummy in a specific text?

Or perhaps, can I use DFHack to drop a creature on the map?  IE Just conjure a Warlock?
« Last Edit: April 12, 2013, 11:57:13 am by redrowen »
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #3 on: April 12, 2013, 12:06:10 pm »

step 1, add the interaction itself to an interaction file

e.g. INTERACTION:RAISE_CORPSE_FRIENDLY
Spoiler (click to show/hide)
as far as I know is in interaction_masterwork.txt, I think it is originally an interaction from the Dwarf Chocolate mod.  Anyway it's not the one i use currently but that will do fine.  But I don't know whether you have it in your DF install obviously.  Note they're not actually going to be friendly.

step 2, yes, you add CAN_DO_INTERACTION to a creature or caste, not just willy nilly in the file.  You'll also need to add a bunch of CDI tags with supporting information.  You can see lots of examples under the magic user castes in creature_orcfort_taigaorc.txt within Orc fortress (or again, many other mods) if you like.

redrowen

  • Bay Watcher
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #4 on: April 12, 2013, 12:13:45 pm »

Hmm, interesting.  I'm working on that for now.  For the moment, would something such as this work:  (Note using MasterWork DF V2 playing as Orc Fortress)

Spoiler (click to show/hide)

Or would it be better just to set the Fishmen to the [SELECT_CASTE:NECRO_MALE] Caste, giving them all the proper magic to begin with?
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #5 on: April 12, 2013, 12:21:02 pm »

A few things:
1)You don't need the YESMAGIC thing in front of each line. That's just something from whatever mod you copied that from. (Of course if you want the mod remove/add magic to apply to this as well then you would need them of course).
2)[SELECT_CASTE:xxxx] doesn't work that way. What it does is exactly as it says, it selects an already created caste in the particular creature for further editing. (So all [SELECT_CASTE:NECRO_MALE] will do is come up with an error unless you manually created a caste titled "NECRO_MALE" inside the fish man entry.)
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

redrowen

  • Bay Watcher
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #6 on: April 12, 2013, 12:33:20 pm »

Within Interaction_masterwork I have:

INTERACTION_RAISE_CORPSE:

Spoiler (click to show/hide)

and INTERACTION:RAISE_CORPSE_FRIENDLY

Spoiler (click to show/hide)


So under any creature in a creature file, I should be able to simply call either Interaction to give them that ability?

I.E:

[CAN_DO_INTERACTION:RAISE_CORPSE_FRIENDLY]
      [CDI:ADV_NAME:Animate corpse]
      [CDI:TARGET:A:LINE_OF_SIGHT]
      [CDI:TARGET_RANGE:A:2]
      [CDI:VERB:gesture:gestures:NA]
      [CDI:TARGET_VERB:shudder and begin to move:shudders and begins to move]
      [CDI:WAIT_PERIOD:30]


(I assume RAISE_CORPSE itself would give him access to any corpse within line-of-site, _FRIENDLY only allowing him to raise friendly mobs to the creature?

Oh, will DF pick up the changes to the save file or will I need to restart the client for it to see the update?
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #7 on: April 12, 2013, 12:44:56 pm »

That's basically right.

Well, I suggest you don't make assumptions about the difference based on the title but rather look what is actually different about the spells -- one of them adds OPPOSED TO LIFE to the raised undead and the other doesn't.  They both affect corpses of creatures with the class GENERAL_POISON, which is basically everything.  I suspect based on experience that the undead will be hostile to the caster either way, but I'm not positive.

BTW now that I know you're playing Orcfortress you should already as part of the mod be able to give your Orcs this ability temporarily using a bone voodoo doll at the Totem pole (in v1.02) or by equipping a Barrow Draugr Dreamcatcher on a Dreamwalker caste orc (if you downloaded the Beta v1.2x).  The latter uses a new DFHack trick, as I mentioned above Putnam's Itemsyndrome, that I haven't gotten any reports on whether it works or not though in this case :)

>> Oh, will DF pick up the changes to the save file or will I need to restart the client for it to see the update?

Definitely restart.  Possibly new world.
« Last Edit: April 12, 2013, 12:49:24 pm by smakemupagus »
Logged

redrowen

  • Bay Watcher
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #8 on: April 12, 2013, 12:49:29 pm »

Thank you for all your help, pretty straight-forward once you go looking through the files.

It looks to be either a new map or I need to wait for a fresh crop of the monster type to arrive in hopes they have the attributes, the current available are wandering around a sea of bones and bodies not doing jack all.

To confirm, I put the interaction in the correct spot for the monster:

Gave MoleDog's the ability to raise dead:

Spoiler (click to show/hide)

Thanks again!
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #9 on: April 12, 2013, 12:51:27 pm »

Cool, good luck! :D

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #10 on: April 12, 2013, 12:54:03 pm »

OPPOSED_TO_LIFE is kind of funky. Until you stop aging, OPPOSED_TO_LIFE will still try to harm people with NOT_LIVING. In short, NOT_LIVING doesn't imply un/death, it just simply classifies your creature as not living at all.

Which is why at that RAISE_CORPSE_FRIENDLY, OPPOSED_TO_LIFE was removed.

Also, as they said, RAISE_CORPSE_FRIENDLY is just an interaction title. Even if you changed it to LOLIPOPS on both sides, it would still function that way, so as long as your CAN_DO_INTERACTION is referring to LOLIPOPS and LOLIPOPS actually exist.
Logged
Thank you for all the fish. It was a good run.

redrowen

  • Bay Watcher
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #11 on: April 12, 2013, 12:59:18 pm »

OPPOSED_TO_LIFE is kind of funky. Until you stop aging, OPPOSED_TO_LIFE will still try to harm people with NOT_LIVING. In short, NOT_LIVING doesn't imply un/death, it just simply classifies your creature as not living at all.

Which is why at that RAISE_CORPSE_FRIENDLY, OPPOSED_TO_LIFE was removed.

Also, as they said, RAISE_CORPSE_FRIENDLY is just an interaction title. Even if you changed it to LOLIPOPS on both sides, it would still function that way, so as long as your CAN_DO_INTERACTION is referring to LOLIPOPS and LOLIPOPS actually exist.

hehe for sure, I get that it's just a title.  Generally from a coding perspective things tend to be named in accordance with action, but you are correct in that it's the code I should look at, not the name.

Logged

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #12 on: April 12, 2013, 01:01:32 pm »

Try learning to code interactions. It's fun, especially when you're raising hydras from bodyparts. :P
Logged
Thank you for all the fish. It was a good run.

redrowen

  • Bay Watcher
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #13 on: April 12, 2013, 01:04:31 pm »

I'm to the point in playing DF that I need to start looking into modding to keep things exciting :)

Been playing for about 6 months now, many many a failed mistake.  This current fortress is rocking and rolling quite happily but I wish the area had more challenge. 

Maybe I can find a way to change the map from Untamed Wilds to Terrifying.......
Logged

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: Modding to add a Necromancer to my fortress
« Reply #14 on: April 12, 2013, 01:13:26 pm »

Well, if you want to learn modding, here's some tips.

1. Read the beginner guides to modding at the wiki. They should provide you with adequate know-how to various things, then...
2. Dissect every mod that you can get your hands on. I learned most of my modding knowledge from Genesis (Old Genesis).
3. Ask questions from the modding section every now and then. Putnam knows so much, and he usually hangs out there to answer questions.

And yes, modding changes everything. It makes both fun and <<FUN>>.
Logged
Thank you for all the fish. It was a good run.