Hello everyone,
I am currently trying a undead race, but the game says "your settlement has crumbled", if all civ members are opposed to life. Not-Living is not enough to make civ-members friendly to undeads, but I remembered that vampires act neutral, and not even invading necromancer armies do attack them. At least I read forum posts about this.
My current plan it to set the vampire flag for all civ members with an automated dfhack script. It doesnt have to add any tags, like bloodsucker, it just needs to help the game identify the civ-members as vampires. (even if they are none)
I found this related post by Grewon:
I modified warmist's syndrome script from here so that it searches for the vampire syndrome id by checking the syndrome's displayed name(in this case vampire), and then infects the selected unit with the vampire syndrome, effectively making him a vampire. It also seems to work with necromancers.
function assignSyndrome(target,syn_id)
if target==nil then
qerror("Not a valid target")
end
local ns=df.unit_syndrome:new()
local trg_syn=df.syndrome.find(syn_id)
ns.type=trg_syn.id
--ns.year=
--ns.year_time=
ns.ticks=1
ns.unk1=1
for k,v in ipairs(trg_syn.ce) do
local sympt=df.unit_syndrome.T_symptoms:new()
sympt.ticks=1
sympt.flags=2
ns.symptoms:insert("#",sympt)
end
target.syndromes.active:insert("#",ns)
end
function makeVampire(unit)
for i=0,#df.global.world.raws.syndromes.all-1 do
for j=0,#df.global.world.raws.syndromes.all[i].ce-1 do
for k,v in pairs(df.global.world.raws.syndromes.all[i].ce[j]) do
if k=="name" then
if v=="vampire" then --this can be changed to necromancer
print("Found vampire syndrome id:"..i)
assignSyndrome(unit,i)
print("Infected unit with vampire syndrome.")
return
end
end
end
end
end
end
local unit=dfhack.gui.getSelectedUnit()
makeVampire(unit)
P.S. this simple cure script removes all syndromes in case you want to undo the effects of the first script, or even if you want to cure genuinely infected units.
local unit=dfhack.gui.getSelectedUnit()
while #unit.syndromes.active > 0 do
unit.syndromes.active:erase(0)
end
while #unit.body.wounds > 0 do
unit.body.wounds:erase(0)
end
unit.body.wound_next_id=1
Unfortunately I dont know exactly how to get from this code to a lua-script that runs on each civ-member. I know how to run a script with SyndromeTrigger. I could write an interaction for the civ that targets themselves and runs a script, but I would need a script that adds the vampire-flag without any other syndromes. OR whatever else would lead to an undead civ, which is friendly to zombies, but does not end the game automatically.
I tried pretty much everything thats possible with modding, and it did not work. I have to ask for your assisstance (again
). If anyone knows how to make civ-members friendly to undeads, please let me know.
EDIT: After more tests it seems to be possible with modding alone. SYN_CLASS:VAMPCURSE and/or the BLOODSUCKER tag allow allying with undeads. So please dont mind about this script anymore, I found a solution. Make all civ members bloodsuckers, but have no civ members with blood.