Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: Meph on January 01, 2014, 07:17:52 pm

Title: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 01, 2014, 07:17:52 pm
I am stumbling upon more and more strange things when it comes to modding my race of undeads. As far as I know this has not been done before, so I thought I share some oddities and fixes with everyone, as well as post problems and bugs. This will probably go on for the entire month, and I dont want to bore people that make suggestions/play with things only relevant to modders.

First of all:
NO_AGING. This is the key. Creature that are affected with no aging are treated as friendly to undeads. Civilians will still be frightened, but NOFEAR helps with that.

OPPOSED_TO_LIFE. This removed the creature from your civs, and you lose control. If everyone is opposed to life, your fort crumbles. Pets cant be trained or sheared or pastured anymore. So only use this tag for random-undeads-that-roam-the-map.

ANIMATE. By using animation in the interaction, you will get a undead-unit. They dont necessarily have to be opposed to life, so you can make 'friendly'-tagged undeads. Just copy the vanilla df interaction raise-corpse and removed the opposed to life.

RESSURECT. By using this you will bring the unit back to life, as they were before. With all their injuries, which means that they instantly die again. Add a 1-tick transformation to it to heal them, then you get fully healed and resurrected civ members. The problem is that creatures retain their AI, so if you resurrect invaders, you just have more invaders. I would only use this in specific workshops that you build near your graveyard, for more control.

Tombs and Necromancer Towers make excellent starting embarks, as the undeads will run out of the buildings, scatter across the map, kill wildlife and protect you from thieves, ambushes and later one distract sieges. 'Embark Everywhere' will allow starting on those.

NOEMOTION. Does not stop friends. It stops tantrums, but the unit description will still list feelings and relations. Its a good tag for skeletons or zombies, so that they dont tantrum, but they will still have skeleton and zombie friends.

SOULS: I added this to all creatures: [EXTRA_BUTCHER_OBJECT:BY_TYPE:THOUGHT][EBO_ITEM:PLANT:NONE:PLANT_MAT:SOUL:STRUCTURAL]. It will drop a soul when being butchered, which will wither away after 4 weeks. It makes a nice currency to barter with demons, or to animate objects/creatures. It uses a fairly basic fake-plant:
Spoiler (click to show/hide)



Problems:
NECROSIS. Rotten civ-members like zombies will constantly spam requests for diagnosis, cleaning and surgery. I did not find a way around this.

WEREBEASTS. As soon as I added werebeast-civ members, which use the vanilla DF werebeast interaction found in the interaction-examples folder, the worldgen or embark crash 100% of the time. I dont know why. I just added this to the creature file:
Spoiler (click to show/hide)

MONOLITH: I have an immobile creature that should animate all dead around it, but it does not do anything. I can spawn it in the Arena and it will animate corpses just fine, but it wont do it in fort mode. I already posted that in the modding quesions thread, so I just copy+past the post:
Spoiler (click to show/hide)
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: dennislp3 on January 01, 2014, 08:30:34 pm
very helpful!
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Di on January 02, 2014, 05:10:40 am
And what about NOT_LIVING?
People create colossi fortresses from time to time and those don't seem to crumble instantly.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 02, 2014, 05:19:43 am
NOT_LIVING does nothing, except restricting the animation. It doesnt turn the unit undead or anything, it simply means that its not a normal, live creature. NOT_LIVING could be used on machinery, golems, wagons, that kind of stuff. CANNOT_UNDEAD was the old tag for it, which is less confusing.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: MDFification on January 02, 2014, 03:18:27 pm
Hrm. I guess you could get around the necrosis by just not having zombies rot? I imagine anyone dealing in zombies has embalming fluid/alcohol on hand. Pickling your zombies could just be standard procedure in raising the dead. It's much more sanitary and pleasing to the nostrils, and stops your slaves from falling to bits, too!
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: 4maskwolf on January 02, 2014, 04:40:10 pm
Just a couple suggestions, they probably aren't any good.

For the necrosis problem, have you considered having the ghouls use a miasma ball greeting?  You mentioned on another thread that there was a DFHack way to generate them, but that the zombies wouldn't use it.  Perhaps using it as a greeting would be close enough to the effect that you desire?  They would hit whoever they saw who was friendly with miasma, which would have similar effect to them generating a miasma cloud.  It would probably have a short range, just due to realism.

For the monoliths: similar thing, have them use a greeting interaction which generates a reanimating mist, if that's possible.  It wouldn't be perfect, but if any allies came within a certain range it would reanimate the corpses in close proximity.

Also, have you tested the werewolves in arena mode?
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 02, 2014, 07:29:11 pm
The problem was miasma is that its not a material. They only way to use it is DFHACK_MIASMA with projectileExpansion, and gases/clouds do not count as projectiles.

Monolith should act on finding corpses, but I can give GREETING a try. It would just mean that someone has to touch the monolith to activate the spell, which can fit the lore.

Werewolves I did not test in arena mode, but the werewolf creature was already included in the mod, as has the interaction. Both of them work. It just seems that DF dislikes werebeast-civ-members for some point.

MDFification: I got around the rotting issue by not having the Ghouls rot. They instead are covered in stale blood and mess up the place with it now and then.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Grim Portent on January 02, 2014, 08:02:17 pm
Are the undead civ members fragile at all? I tried to do a skeleton civ a while back and had problems with them falling apart at the drop of a hat. Would have made good workers with the right tags but were far to easy to knock bits off of.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 02, 2014, 08:24:47 pm
I have not played long enough to fight much.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: 4maskwolf on January 04, 2014, 01:30:03 am
Hmm... I can't see why it doesn't like werebeasts...

After all, MW has the... well, I guess I should preface this with: MAJOR SPOILERS:

Spoiler (click to show/hide)

Anyway, I hope the monolith greeting is working for you.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 04, 2014, 06:10:04 am
The MW sleeper are one permanent transformation, what I was trying here is MOON_PHASE based ones. The moon phased once might trigger in worldgen, which crashes it. maybe I can give them a normal interaction, which gives them the moon_phased one (because they dont use normal ones at worldgen), and see what happens.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: MDFification on January 05, 2014, 10:14:27 pm
The MW sleeper are one permanent transformation, what I was trying here is MOON_PHASE based ones. The moon phased once might trigger in worldgen, which crashes it. maybe I can give them a normal interaction, which gives them the moon_phased one (because they dont use normal ones at worldgen), and see what happens.

This is weird, because I've had forts where no non-werebeast civ members survived. (That was after the attack of the were-elephants, the most awesome thing to every happen to me. I wish I still had that file.) I guess the problem is that it doesn't like civs to have werebeast members by default?

Also: Does NOT_LIVING still trigger hostility from undeads? I need to know because reasons.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: 4maskwolf on January 05, 2014, 10:19:13 pm
NO_AGING avoids undead attacks, not NOT_LIVING.  This is so that undead will still attack golems and whatnot, I think.  Regardless, I think that the difference is that the werewolves are an actual caste in this case, as opposed to being infected... I have honestly no idea.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 06, 2014, 02:31:32 am
I will figure out something. Even if not, losing a werebeast caste is not a big issue.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 08, 2014, 11:26:08 am
Got something new:

By adding a self-targetted interaction to normal creatures that have [IT_REQUIRES:OPPOSED_TO_LIFE], you can make their zombies use this, but their normal self does not.

For example dwarves are normal dwarves, but opposed-to-life zombie dwarves can spit bile and vomit, cover the ground in stale blood spatters and get boosts from eating corpses, which destroys the corpse they find. All possible. This would even affect normal DF zombies from otherwise untouchable regional interactions, which are procedually generated.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: milo christiansen on January 08, 2014, 06:11:22 pm
That... That is awesome!
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: 4maskwolf on January 08, 2014, 06:25:51 pm
Thank you Meph.

That is amazing.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 10, 2014, 12:30:51 pm
I found the source of the "monolith doesnt use interactions"-problem: Creatures created with spawnunit do not use interactions.

On the one hand I am glad that I figured that out, and that I didnt make a mistake in the Monolith creature. On the other hand... this is really bad news.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Grim Portent on January 10, 2014, 12:51:13 pm
Would monoliths work as a pet?
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 10, 2014, 01:13:46 pm
They would, if you buy them at embark, if they are born, or if you buy them from caravans. None of which is possible. I designed them to be build in a workshop.

I am currently looking into spawning a creature, and then adding the interaction. Maybe they can use them if its done that way.
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 10, 2014, 01:31:56 pm
Fixed it.

Two solutions: Teach the creature the interaction, or transform the creature once.

First inorganic spawns a Monolith. It doesnt use any of its own interactions. Second inorganic teaches a monolith on the workshop the very same interactions again. A wonder happens. They use them. Third inorganic transforms the monolith generic into monolith generic2, literally the same creature, just a different caste. No difference between castes either. Still, it fixes it. The spawned monolith caste does not do interactions, but the transformed caste does use them.

Code: [Select]
[INORGANIC:MONOLITH_SPAWN]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL:Build a monolith]
[SYNDROME][SYN_CLASS:\AUTO_SYNDROME][SYN_CLASS:\COMMAND]
[SYN_CLASS:spawn][SYN_CLASS:MONOLITH][SYN_CLASS:0][SYN_CLASS:Monolith][SYN_CLASS:\LOCATION]

[INORGANIC:MONOLITH_TEACH]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL:Build a monolith]
[SYNDROME][SYN_CLASS:\AUTO_SYNDROME][SYN_CLASS:\ALLOW_MULTIPLE_TARGETS][SYN_CLASS:\ALLOW_NONWORKER_TARGETS]
      [CE_CAN_DO_INTERACTION:PROB:100:START:0]
         [CDI:INTERACTION:RAISE_CORPSE_MONOLITH]
[CDI:ADV_NAME:Animate corpse]
[CDI:TARGET_RANGE:A:10]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:VERB:hum:hums:NA]
[CDI:TARGET_VERB:shudder and begin to move:shudders and begins to move]
[CDI:WAIT_PERIOD:100]

[INORGANIC:MONOLITH_TRANSFORM]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL:Possess a body]
[SYNDROME][SYN_CLASS:\AUTO_SYNDROME][SYN_CLASS:\ALLOW_MULTIPLE_TARGETS][SYN_CLASS:\ALLOW_NONWORKER_TARGETS]
[SYN_AFFECTED_CREATURE:MONOLITH:GENERIC]
[CE_BODY_TRANSFORMATION:PROB:100:START:0]
[CE:CREATURE:MONOLITH:GENERIC2]
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: coldmonkey on January 12, 2014, 11:01:09 am
I was thinking, could an object be made that moves along minecart rails and resurrects everything along its path?
Title: Re: Undead Civs and You! - Problems and Solutions
Post by: Meph on January 12, 2014, 11:03:21 am
No object, but a creature. Put the creature I posted above into a minecart and it should work.