Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [DFHack] Have Elf Diplomat thrown into pit!  (Read 930 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
[DFHack] Have Elf Diplomat thrown into pit!
« on: June 12, 2013, 12:26:06 am »

Provided that you have modded elf diplomats back into your game:

Elf Diplomat: You have disrespected the trees in this area, but this is what we have come to expect from your stunted kind. Further abuse cannot be tolerated. Let this be a warning to you.
Dwarf Baron: You threaten my people with environmentalism and death!
Elf Diplomat: This is blasphemy! This is madness!
Dwarf Baron: Madness? [Grabs Elf] This is Dwarf Fortress! [Throws Elf into deep magma pit]

Code: (sparta.lua) [Select]
--order targeted unit (any creature) to be tossed into latest (newest) pit/pond designation

unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

local mypit=-1

for k,v in pairs(df.global.world.buildings.all) do
if v:getType() == 30 then
if v.zone_flags.pit_pond == true then
--print(k)
mypit=k
end
end
end

if mypit == -1 then
print ("No Designated Pits! Aborting.")
return
end

local lengthp=#df.global.world.buildings.all[mypit].assigned_creature

df.global.world.buildings.all[mypit].assigned_creature:insert(lengthp, unit.id)
print("Targeted creature assigned to pit!")

I know 300 is not an accurate depiction of ancient Greek culture, but I've always wanted to do this and thought other people would enjoy it as well.

RickRollYou2

  • Bay Watcher
  • [START_BIOME:EARTH]
    • View Profile
Re: [DFHack] Have Elf Diplomat thrown into pit!
« Reply #1 on: June 13, 2013, 06:02:09 am »

How does the script deal with multiple pits? Does it just for the nearest one?
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: [DFHack] Have Elf Diplomat thrown into pit!
« Reply #2 on: June 13, 2013, 09:44:43 am »

It says the latest (newest).
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

RickRollYou2

  • Bay Watcher
  • [START_BIOME:EARTH]
    • View Profile
Re: [DFHack] Have Elf Diplomat thrown into pit!
« Reply #3 on: June 13, 2013, 08:57:51 pm »

Ah yes. Missed that somehow. Thanks!
This combined with fastdwarf can break sieges really easily, by the way.
Logged