Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 290 291 [292] 293 294 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1120071 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4365 on: June 06, 2016, 05:14:13 pm »

Okay, what was the exact user profile of impregnate? I.E. what were the arguments/GUI like? I can whip one up in a jiffy given that I already have ectobiology.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4366 on: June 06, 2016, 06:28:25 pm »

Ctrl-F "empregnate" here

It would be lovely if you could write a catsplosion script, too ;)
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4367 on: June 06, 2016, 06:55:57 pm »

Code: (impregnate.lua) [Select]
local function getFemaleCasteWithSameMaxAge(unit)
    local curCaste=df.creature_raw.find(unit.race).caste[unit.caste]
    for k,caste in ipairs(df.creature_raw.find(unit.race).caste) do
        if caste.gender==0 and caste.misc.maxage_min==curCaste.misc.maxage_min and caste.misc.maxage_max==curCaste.misc.maxage_max then return k end
    end
end

function impregnate(unit)
    local script=require('gui.script')
    script.start(function()
    unit=unit or dfhack.gui.getSelectedUnit(true)
    if not unit then
        error("Failed to impregnate. Unit not selected/valid")
    end
    if unit.curse then
        unit.curse.add_tags2.STERILE=false
    end
    local genes = unit.appearance.genes
    if unit.relations.pregnancy_genes == nil then
        unit.relations.pregnancy_genes = unit.appearance.genes:new()
    end
    local ngenes = unit.relations.pregnancy_genes
    unit.relations.pregnancy_timer=1
    unit.relations.pregnancy_caste=1
    if unit.sex==1 then
        local normal_caste=unit.enemy.normal_caste
        unit.enemy.normal_caste=getFemaleCasteWithSameMaxAge(unit)
        script.sleep(1,'ticks')
        unit.enemy.normal_caste=normal_caste
    end
    end)
end

impregnate()

This code will take the selected unit, impregnate him or her, if male turn him into a female so that he may give birth, then turn him back into a male immediately.

Code: (catsplosion.lua) [Select]
local function getSpecies(unit)
    return df.creature_raw.find(unit.race).creature_id
end

local function getFemaleCasteWithSameMaxAge(unit)
    local curCaste=df.creature_raw.find(unit.race).caste[unit.caste]
    for k,caste in ipairs(df.creature_raw.find(unit.race).caste) do
        if caste.gender==0 and caste.misc.maxage_min==curCaste.misc.maxage_min and caste.misc.maxage_max==curCaste.misc.maxage_max then return k end
    end
end

function impregnate(unit)
    local script=require('gui.script')
    script.start(function()
    unit=unit or dfhack.gui.getSelectedUnit(true)
    if not unit then
        error("Failed to impregnate. Unit not selected/valid")
    end
    if unit.curse then
        unit.curse.add_tags2.STERILE=false
    end
    local genes = unit.appearance.genes
    if unit.relations.pregnancy_genes == nil then
        unit.relations.pregnancy_genes = unit.appearance.genes:new()
    end
    local ngenes = unit.relations.pregnancy_genes
    local rng=dfhack.random.new()
    local timer=rng:random(100)+1
    unit.relations.pregnancy_timer=timer
    unit.relations.pregnancy_caste=1
    if unit.sex==1 then
        local normal_caste=unit.enemy.normal_caste
        unit.enemy.normal_caste=getFemaleCasteWithSameMaxAge(unit)
        script.sleep(timer+1,'ticks')
        unit.enemy.normal_caste=normal_caste
    end
    end)
end

for k,v in ipairs(df.global.world.units.active) do
    if getSpecies(v)=='CAT' then
        impregnate(v)
    end
end

and there's catsplosion
« Last Edit: June 06, 2016, 07:18:54 pm by Putnam »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4368 on: June 06, 2016, 07:13:00 pm »

Code: (impregnate.lua) [Select]
local function getFemaleCasteWithSameMaxAge(unit)
    local curCaste=df.creature_raw.find(unit.race).caste[unit.caste]
    for k,caste in ipairs(df.creature_raw.find(unit.race).caste) do
        if caste.gender==0 and caste.misc.maxage_min==curCaste.misc.maxage_min and caste.misc.maxage_max==curCaste.misc.maxage_max then return k end
    end
end

function impregnate(unit)
    local script=require('gui.script')
    script.start(function()
    unit=unit or dfhack.gui.getSelectedUnit(true)
    if not unit then
        error("Failed to impregnate. Unit not selected/valid")
    end
    if unit.curse then
        unit.curse.add_tags2.STERILE=false
    end
    local genes = unit.appearance.genes
    if unit.relations.pregnancy_genes == nil then
        unit.relations.pregnancy_genes = unit.appearance.genes:new()
    end
    local ngenes = unit.relations.pregnancy_genes
    unit.relations.pregnancy_timer=1
    unit.relations.pregnancy_caste=1
    if unit.sex==1 then
        local normal_caste=unit.enemy.normal_caste
        unit.enemy.normal_caste=getFemaleCasteWithSameMaxAge(unit)
        script.sleep(1,'ticks')
        unit.enemy.normal_caste=normal_caste
    end
    end)
end

impregnate()

This code will take the selected unit, impregnate him or her, if male turn him into a female so that he may give birth, then turn him back into a male immediately.

Hmm, I wonder what would happen if you had a sieger give birth. Could make for a fun insectoid type race.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4369 on: June 06, 2016, 07:25:59 pm »

I toyed with that idea as a way to create units but I never tried it. The unit would have to be added to the invasion for your case otherwise it wouldn't advance or retreat with the others.
Logged

SomeKif2.0

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4370 on: June 06, 2016, 08:05:44 pm »

I am having a bit of trouble installing dfhack 0.42.06-r1. So far I have downloaded it and unzipped it directly into my DF folder (and the contents look like the pre-installed version I was using before but is now outdated). When I launch DF the dfhack terminal doesn't open (clicking dfhack-run.rar while DF is running doesn't help). I have followed the directions on the OP and tried removing SDL.dll like README.html said to do (and then put it back when it didn't work). With the instructions so simple, I can't imagine having this much trouble.

For the record, I am on Windows.
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4371 on: June 06, 2016, 08:26:20 pm »

Is the SDL.dll getting overwritten when you extract the package?
Logged

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4372 on: June 06, 2016, 09:07:42 pm »

and there's catsplosion

Awesome, I'll replace the plugin with this :)
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4373 on: June 06, 2016, 09:32:22 pm »

This code will take the selected unit, impregnate him or her, if male turn him into a female so that he may give birth, then turn him back into a male immediately.

Thank you kindly!
BTW: Will this be a part of a future release of DFHack?

adv-bodyswap and bodyswap are two different and similar things one being a plugin and the other being a txt function script that I copy and pasted.
you could harvest most of it from the recarnation script as that kinda puts you in the body of the killer and the coding needed to do that has the basic command needed to swap bodies.

Interesting. I may try to piddle around with the code to see if I can get something to work, because of all the missing DFusion and adv_tools, I think I'd miss some type of bodyswap the most. However, I never was familiar with Lua and my programming is extremely rusty ATM.

Wait... ??? Where is the "recarnation script" you mention?

[-snip-]
...wanna say sorry thundercraft for not releasing the big book of dumb spells I keep backup in case I need them and they get purged from Dfhack for reasons. Mostly because my 3 main folders I copy over when dfhack is updated...

It would be much appreciated if you did release some sort of script pack or mod or something. (Though, it would be very cool if you could get some of your scripts or plugins to be added to DFHack. 8) Just saying...)

Also, some of the stuff on your GitHub looks quite interesting. I'd love to try out Mount.lua and Mount-Order.lua. (A script to ride horses and other animals? :o Yes, please! I've really wanted mounts for years.) But, the script being 3 years old, I have to wonder if they would still work, as is.
« Last Edit: June 06, 2016, 09:40:16 pm by Thundercraft »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4374 on: June 06, 2016, 09:41:21 pm »

This code will take the selected unit, impregnate him or her, if male turn him into a female so that he may give birth, then turn him back into a male immediately.

Thank you kindly!
BTW: Will this be a part of a future release of DFHack?

i don't see a reason why not

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4375 on: June 06, 2016, 10:32:20 pm »

The 0.43 version of DFHack isn't imminent, is it?  I'm still working out kinks in create-unit.lua but don't have a presence on GitHub or anything.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Probe1

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4376 on: June 07, 2016, 08:04:37 am »

On that note is there anything we can do to help?
Logged

SomeKif2.0

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4377 on: June 07, 2016, 10:06:30 am »

Is the SDL.dll getting overwritten when you extract the package?
I'm not sure. How would I check that?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4378 on: June 07, 2016, 11:00:26 am »

The 0.43 version of DFHack isn't imminent, is it?  I'm still working out kinks in create-unit.lua but don't have a presence on GitHub or anything.

I don't think so but I haven't been on irc much the last two weeks.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4379 on: June 07, 2016, 11:01:51 am »

Is the SDL.dll getting overwritten when you extract the package?
I'm not sure. How would I check that?

Try extracting SDL over what's there again.
Logged
Pages: 1 ... 290 291 [292] 293 294 ... 360