Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 22 23 [24] 25 26 ... 244

Author Topic: DFHack 50.14-r1.1  (Read 892839 times)

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #345 on: October 02, 2017, 09:36:50 pm »

OOOOOOHHHHHH YEEEEESSSSS. I can fulfill my dragon rampage dreams!  :D Oh, and can you make a script for eating things from the ground?
« Last Edit: October 02, 2017, 09:43:20 pm by KittyTac »
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #346 on: October 03, 2017, 04:43:34 am »

Thank you! 8) I'm so glad that interest in bodyswap hasn't completely disappeared and that someone worked on updating it. I was sad to see DFusion and, particularly, Rumrusher's "Adventure Tools" (aka, "adv_tools") get abandoned, but I miss bodyswap most of all.

BTW: Which lines are the ones that need to be commented out?


Ok, either someone please tell me about a replacement to Dfusion's freaky Friday-like change adventurer script or just tell me how to re-add Dfusion.

Well, the easy part is set a target grab (dfhackgetselectedunit or whatnot) and grab hist_id, pass it to the find command (what was the dfhack one? not the df.global.find(k) one or whatnot) and it'll pull up the df.global.world.history.hist_figs[k] for you, then have it set flags[0] to true, which should add that unit to the Specific Person part of the adventurer selection screen, I've gm-editor'D a bodyswitch but it was all sorts of slapdash, it should just be a matter of unlinking your unit from df.global.world.units.active[0] and setting your new adventurer target in there, plus tracking down any hanging links left in the hist_fig part I think?

I meant swapping the bodies of a decoy adventurer and a megabeast, as a hacky way of playing an actual worldgen megabeast.
there should be an Adv-bodyswap script left over from uhh one of the dfhack folks remaking warmist scripts but if that got lost in the recent updates of dfhack then uhh uh oh shoot I don't know which one to port, my copy is a tad rigged for my tastes and I know there's a bodyswap script that allows for switching back to your original body that's some where in dfhack's old versions... or in dfusion.

edit : uhh oh wow there is no adv-bodyswap lua file or plugin at all in the files, there is an adv-fort but no adv-bodyswap.
I was toying around trying to get this fixed so it shows a list of retired adventurer flag=true units to swap back to if targeted on yourself:
Code: (assumecontrol.lua) [Select]
--Assume Direct Control of the unit you're viewing. This Can Hurt You.
--[====[
assumecontrol
=============
Allows you to temporarily or permanently swap bodies with another unit.
Animals and other non-historical figures can be glitchy if you travel as one, be careful!
]====]
local utils = require 'gui'
local dialog = require 'gui.dialogs'

function assumeControl(new,old)
local actold
for i,j in ipairs(df.global.world.units.all) do
    if j.id==df.global.world.units.active[0].id then
        actold=j.id
        break
    end
end
local active=df.global.world.units.active
local old
old=df.unit.find(actold)
local new
new=dfhack.gui.getSelectedUnit(true)
if new==nil then
    qerror("Unable to Assume Control!")
end
local actnew
for k,v in pairs(active) do
    if v==new then
        actnew=k
        break
    end
end
if actnew==nil then
    qerror("Attempt to Assume Control has failed?")
end
if dfhack.gui.getSelectedUnit(true)==active[0] then
    local choices={}
    for k,v in pairs(active) do
        if dfhack.units.getNemesis(active[k]).flags.RETIRED_ADVENTURER==true then
            local nems=active[k]
            table.insert(choices,{text=nems.name.first_name,nems=k})
        end
        dialog.showListPrompt("Unit choice", "Choose unit to return to:", COLOR_WHITE,choices,
            function (idx,choice)
              dfhack.units.getNemesis(choice).flags.ACTIVE_ADVENTURER=true
              dfhack.units.getNemesis(choice).flags.ADVENTURER=true
              dfhack.units.getNemesis(choice).flags.RETIRED_ADVENTURER=false
              choice.status.current_soul.personality.flags[1]=true
              dfhack.units.getNemesis(old).flags.ACTIVE_ADVENTURER=false
              dfhack.units.getNemesis(old).flags.RETIRED_ADVENTURER=true
              old.status.current_soul.personality.flags[1]=false
              return
            end)
    end
end
active[actnew]=active[0]
active[0]=new
local target = dfhack.units.getNemesis(new)
    if target then
    local nwnem=dfhack.units.getNemesis(new)
    local olnem=dfhack.units.getNemesis(old)
    if olnem then
        olnem.flags.ACTIVE_ADVENTURER=false
        olnem.flags.RETIRED_ADVENTURER=true
        olnem.unit.status.current_soul.personality.flags[1]=false
        olnem.unit.idle_area.x=olnem.unit.pos.x
        olnem.unit.idle_area.y=olnem.unit.pos.y
        olnem.unit.idle_area.z=olnem.unit.pos.z
    end
    if nwnem then
        nwnem.flags.ACTIVE_ADVENTURER=true
        nwnem.flags.RETIRED_ADVENTURER=false
        nwnem.flags.ADVENTURER=true
        nwnem.unit.status.current_soul.personality.flags[1]=true
        for k,v in pairs(df.global.world.nemesis.all) do
            if v.id==nwnem.id then
                df.global.ui_advmode.player_id=k
                end
            end
        end
    else
        qerror("Assuming Direct Control! Current target may not last long!")
    end
end
assumeControl(new,old)

Commenting out those lines makes it work just fine, though it just spits an error when you dismiss the box atm, my lua mojo ran out.
« Last Edit: October 03, 2017, 05:21:48 am by Thundercraft »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #347 on: October 03, 2017, 04:08:15 pm »

don on me that I still haven't fix the invoke script to add a new dialog option than just changing or converting some options.
this probably would fix and lead to some more dialog options in adventure mode or setting up Scripts that trigger on conversation.
being able to mandatory force folks to accepting hearthperson roles, or taking folks positions away seems ok.
probably call it the dialog-unlocker.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #348 on: October 03, 2017, 11:37:41 pm »

So, I've been working on a little change to the RPC stuff in DFHack, and due to its nature, I think it needs a bit of discussion.

PR Here: https://github.com/DFHack/dfhack/pull/1173

Basically, it allows the user to turn on being able to use the DFHack RPC stuff from outside their computer. This is dangerous, obviously, which is why not all RPC functions are available. Biggest two that are disabled are the run command and the lua command, both of which can potentially wreck your everything due to being able to run arbitrary code.

So, opinions?
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #349 on: October 04, 2017, 04:07:37 am »

Thank you! 8) I'm so glad that interest in bodyswap hasn't completely disappeared and that someone worked on updating it. I was sad to see DFusion and, particularly, Rumrusher's "Adventure Tools" (aka, "adv_tools") get abandoned, but I miss bodyswap most of all.

BTW: Which lines are the ones that need to be commented out?
These:
Code: (attempt at getting "select past adventurers via list" to work) [Select]
if dfhack.gui.getSelectedUnit(true)==active[0] then
    local choices={}
    for k,v in pairs(active) do
        if dfhack.units.getNemesis(active[k]).flags.RETIRED_ADVENTURER==true then
            local nems=active[k]
            table.insert(choices,{text=nems.name.first_name,nems=k})
        end
        dialog.showListPrompt("Unit choice", "Choose unit to return to:", COLOR_WHITE,choices,
            function (idx,choice)
              dfhack.units.getNemesis(choice).flags.ACTIVE_ADVENTURER=true
              dfhack.units.getNemesis(choice).flags.ADVENTURER=true
              dfhack.units.getNemesis(choice).flags.RETIRED_ADVENTURER=false
              choice.status.current_soul.personality.flags[1]=true
              dfhack.units.getNemesis(old).flags.ACTIVE_ADVENTURER=false
              dfhack.units.getNemesis(old).flags.RETIRED_ADVENTURER=true
              old.status.current_soul.personality.flags[1]=false
              return
            end)
    end
end

don on me that I still haven't fix the invoke script to add a new dialog option than just changing or converting some options.
this probably would fix and lead to some more dialog options in adventure mode or setting up Scripts that trigger on conversation.
being able to mandatory force folks to accepting hearthperson roles, or taking folks positions away seems ok.
probably call it the dialog-unlocker.
Now I wanna get out of "woodcarving mode" and back into "hackery mode" and try to figure out how to make a list prompt version of that, though I'd have gone with allconvo.lua or convocontrol.lua myself.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #350 on: October 04, 2017, 04:14:09 am »

So, I've been working on a little change to the RPC stuff in DFHack, and due to its nature, I think it needs a bit of discussion.

PR Here: https://github.com/DFHack/dfhack/pull/1173

Basically, it allows the user to turn on being able to use the DFHack RPC stuff from outside their computer. This is dangerous, obviously, which is why not all RPC functions are available. Biggest two that are disabled are the run command and the lua command, both of which can potentially wreck your everything due to being able to run arbitrary code.

So, opinions?

My view is reverse: allow everything, but be disabled by default.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #351 on: October 04, 2017, 04:38:13 am »

It's currently setup to be disabled by default, actually.
Logged

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #352 on: October 04, 2017, 06:29:37 am »

Again, any way to eat things from the ground?
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #353 on: October 04, 2017, 07:39:08 am »

Again, any way to eat things from the ground?
Nope, but you can e.g. haul the item before trying to eat.

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #354 on: October 04, 2017, 08:33:48 am »

Again, any way to eat things from the ground?
Nope, but you can e.g. haul the item before trying to eat.

I meant a script. Dragons don't have hands, you know.
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: DFHack 0.43.05-r2
« Reply #355 on: October 06, 2017, 01:33:27 pm »

I'm experiencing a weird bug when refreshing Dwarf Therapist when a migrant wave is currently incoming. Last time I did thins when migrants were incoming and a caravan leaving. It looks like migrant dwarves are stuck outside of the map. In a previous fortress I had a caravan stuck outside of the map and a new one never arrived again.  :'(

http://dffd.bay12games.com/file.php?id=13121

I don't know whether this is a Dwarf Therapist or a DFHack issue, I think it could be either one, because DT only uses when DFHack gives it, but I also read that they DT may be connecting and disconnecting to DF memory every time it refreshes... so I don't know. I also reported this bug in DT GitHub, hoping that either you or the DT guys will find the cause for this.

Thank you for your involvement.
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #356 on: October 06, 2017, 02:03:55 pm »

I don't know whether this is a Dwarf Therapist or a DFHack issue, I think it could be either one, because DT only uses when DFHack gives it, but I also read that they DT may be connecting and disconnecting to DF memory every time it refreshes... so I don't know. I also reported this bug in DT GitHub, hoping that either you or the DT guys will find the cause for this.
DFHack currently doesn't provide any data to DT. (Well, you can generate layout files for DT using DFHack, but DT is independent from DFHack otherwise, and you should run into the same issues regardless of whether you're actually using DFHack.)
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #357 on: October 06, 2017, 03:22:01 pm »

However, there are quite a few issues on the forum regarding merchants/migrants/sieges stuck more or less off the map, and in the cases explored it does seem to be a vanilla DF bug (or set of bugs), unrelated to either DFHack or DT. It's quite natural that you'd see the bug as you refresh DT, as you'd refresh DT as migrants arrive, so if it happens "naturally" you'd also have refreshed DT to look at the new arrivals.
When a caravan gets stuck it tends to block other caravans from appearing.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #358 on: October 06, 2017, 09:07:39 pm »

I was wondering for a bit there if DT saving changes in the middle of a migrant wave could be a cause, e.g. if it broke yet-to-arrive migrants. However, I can't think of a good reason for people to be consistently committing changes with DT during a siege or caravan arrival, so that might not be it.

DFHack does have a couple of recently-added scripts to address that issue, anyway. Check the changelog for details - maybe fix/stuck-merchants is one of them.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

feelotraveller

  • Bay Watcher
  • (y-sqrt{|x|})^2+x^2=1
    • View Profile
Re: DFHack 0.43.05-r2
« Reply #359 on: October 07, 2017, 12:00:54 am »

This is off topic for dfhack, I believe.

But just to chip in because the comments are here - Dwarf Therapist can cause this issue.  :( I'm not sure of the how but I have experienced it myself (infrequently).  Best practice is not to refresh DT (nor to save DF for that matter...) whilst migrants are arriving - that is until you are certain that all new arrivals are on the map.  DT was changed (34.0, I think) to show the entire migration wave once they have started to arrive (and if memory serves you can actually see the migrant wave shortly before they are announced and start to arrive on the map) but did not address this problem. 

I also advise against refreshing DT whilst the caravan is departing as this can cause oddness, at least as far as DT information display is concerned.  Although once it caused me serious 'game-ending' problems. In this case making a save as a backup should be fine (I think) if you want to try your luck with DT, since it is often ok.

If the unit-id of the missing dwarf can be ascertained then I would suggest using 'teleport' to bring them onto the map and all should be good.  Getting the unit-id could be tricky though?  Patrik, I seem to remember you dealing with this problem for the missing merchants, am I wrong?  Or is there a shortcut where the dwarf will have unit-id one higher than the other dwarf of the migrant wave...?
« Last Edit: October 07, 2017, 01:03:51 am by feelotraveller »
Logged
Pages: 1 ... 22 23 [24] 25 26 ... 244