Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 295 296 [297] 298 299 ... 360

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

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4440 on: June 26, 2016, 07:29:20 pm »

There are changes that need to be made...

But it sounds like almost half of the stuff you mentioned needs to be done, anyway, to release another DFHack for the next x86 (32-bit) DF release. I mean, regardless of whether or not x64 DF is supported, there's still a need to make DFHack work with the new compiler.

Though, I do understand that this could be much more work than usual and that it will take longer. I'd imagine that support for x64 DF probably isn't a priority, either.
« Last Edit: June 26, 2016, 07:35:56 pm by Thundercraft »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4441 on: June 26, 2016, 08:49:36 pm »

It depends on whether Toady keeps distributing 32-bit builds of DF - it sounds like he is, given that he's building both on Windows and Linux so far, but if not, we obviously can't have a 32-bit-only DFHack and a 64-bit-only DF.

I don't know how the Windows side of things with MSVC 2015 is coming along, being mostly a Mac/Linux person. I think most of the research involves figuring out how to analyze changed structures from outside DF, since DFHack should be compatible with DF if it's compiled with the same compiler.

Toady said he uses fixed-width types in some places, so a 64-bit transition could be easier than we expected, although it could also be a disaster (there's at least one file that I know won't compile under MSVC 2015 for x64). If there are integers that vary in size between builds, we'll have to come up with a new way to describe them in df-structures and possibly check a *lot* of things (but hopefully that won't be the case very often).
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.

Urlance Woolsbane

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4442 on: June 28, 2016, 02:02:36 am »

Apologies for the broadness of this question, but how much of the structure of the save-files has been mapped-out?
I put a couple months of my life into that project back during 34.11, but didn't publish anything. I got most of the world map data. (So maybe a quarter-ish of a typical world.dat.) It was good enough to get all the generated raws/interactions/etc (which are easy), all the region and subregion data. I didn't get mappings for entities or sites, which is a lot to be missing.

If you really really care, I could make the code available, but I consider it low-value. I used those wiki pages as a starting point and I did get significantly farther than them, at least.

Ultimately I abandoned the project because:
- Dfhack memory mappings are so far ahead of save file research, and can accomplish almost any desirable edit.
- I didn't think my made-up XML schema for describing a world.dat file was going to be flexible enough to describe the whole file.
- It was a tremendous amount of work that it seemed like only I cared about.

Let me know if you'd like the unfinished project. It's in C++ using Boost and will produce a text file dump of the portions of an uncompressed 34.11 save that it can interpret.
If it's not too much trouble, I'd appreciate it. Having a handle on the region and subregion data would be wonderful, seeing as they're probably the most difficult aspect of the file-structure.
Logged
"Hey papa, your dandruff is melting my skin. Is that normal?"
"SKREEEONK!!!"
"Yes, daddy."

Repseki

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4443 on: June 28, 2016, 04:49:48 am »

Any chance either of these will work with current versions of DFHack/DF. Not really sure where I picked them up, but had them sitting around and thought they might be useful for some generational fort messing about.

Spoiler (click to show/hide)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.42.06-r1
« Reply #4444 on: June 28, 2016, 08:11:44 am »

Excuse me, I have a question about the four scripts that omniclasm wrote that help FPS, namely deterioratefood, corpses, clothing and starvingdead.rb.

They work way too quickly, with food and clothing rotting away in 1-2 months, while undead sieges barely reach the fortress before the undead crumble to dust. I need to make it work much slower, but I dont know which numbers to change in the scripts.

Here is the starvingdead.rb example:
Code: [Select]
# Weaken and eventually destroy undead over time
=begin

starvingdead
============
Somewhere between a "mod" and a "fps booster", with a small impact on
vanilla gameplay. It mostly helps prevent undead cascades in the caverns,
where constant combat leads to hundreds of undead roaming the
caverns and destroying your FPS.

With this script running, all undead that have been on the map for
one month gradually decay, losing strength, speed, and toughness.
After six months, they collapse upon themselves, never to be reanimated.

Usage: ``starvingdead (start|stop)``

=end

class StarvingDead

    def initialize
        @threshold = 1
        @die_threshold = 6
    end

    def process
        return false unless @running
        month_length = 67200
        if (@undead_count >= 25)
            month_length *= 25 / @undead_count
        end

        @undead_count = 0
        df.world.units.active.each { |u|
            if (u.enemy.undead and not u.flags1.dead)
                @undead_count += 1
                if (u.curse.time_on_site > month_length * @threshold)
                    u.body.physical_attrs.each { |att|
                        att.value = att.value - (att.value * 0.02)
                    }
                end

                if (u.curse.time_on_site > month_length * @die_threshold)
                    u.flags1.dead = true
                    u.curse.rem_tags2.FIT_FOR_ANIMATION = true
                end
            end
        }
    end

    def start
        @onupdate = df.onupdate_register('starvingdead', 1200, 1200) { process }
        @running = true
        @undead_count = 0

        if ($script_args[1] and $script_args[1].gsub(/[^0-9\.]/,'').to_f > 0)
            @threshold = $script_args[1].gsub(/[^0-9\.]/,'').to_f
        end

        if ($script_args[2] and $script_args[2].gsub(/[^0-9\.]/,'').to_f > 0)
            @die_threshold = $script_args[2].gsub(/[^0-9\.]/,'').to_f
        end

        puts "Starving Dead starting...weakness starts at #{@threshold} months, true death at #{@die_threshold} months"
    end

    def stop
        df.onupdate_unregister(@onupdate)
        @running = false
    end
    def status
        @running ? 'Running.' : 'Stopped.'
    end
end

case $script_args[0]
when 'start'
    if ($StarvingDead)
        $StarvingDead.stop
    end
    $StarvingDead = StarvingDead.new
    $StarvingDead.start

when 'end', 'stop'
    $StarvingDead.stop
else
    if $StarvingDead
        puts $StarvingDead.status
    else
        puts 'Not loaded.'
    end
end
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4445 on: June 28, 2016, 08:47:56 am »

Any chance either of these will work with current versions of DFHack/DF. Not really sure where I picked them up, but had them sitting around and thought they might be useful for some generational fort messing about...

I have no idea whether or not those scripts would still work. However, I do know that the current DFHack already has this functionality. Check the DFHack documentation for gui/family-affairs: "view, add, remove, or otherwise change romantic relationships". This includes a user-friendly interface and, among other things, it allows the user to force a marriage or divorce.
« Last Edit: June 28, 2016, 08:54:08 am by Thundercraft »
Logged

Repseki

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4446 on: June 28, 2016, 08:56:59 am »

Well then nevermind and thank you, I had completely glossed over the "gui" portion of what was in there.
Logged

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4447 on: June 28, 2016, 09:22:12 am »

Excuse me, I have a question about the four scripts that omniclasm wrote that help FPS, namely deterioratefood, corpses, clothing and starvingdead.rb.

They work way too quickly, with food and clothing rotting away in 1-2 months, while undead sieges barely reach the fortress before the undead crumble to dust. I need to make it work much slower, but I dont know which numbers to change in the scripts.

Here is the starvingdead.rb example:
Code: [Select]
# Weaken and eventually destroy undead over time
class StarvingDead

    def initialize
        # number of months before undead start to weaken
        @threshold = 1

        # number of months before they crumble completely
        @die_threshold = 6
    end

Annotated the relevant numbers :)
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

pikachu17

  • Bay Watcher
  • PADORU PADORU
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4448 on: June 28, 2016, 09:24:51 am »

Why was Dfusion removed? it was one of my favorite scripts(unless I'm wrong and just forgot the name of it)! if it was in fact removed, how do I re-add it?
Logged
Sigtext!
dwarf 4tress from scratch
The Pikachu revolution!
Thank you NatureGirl19999 for the avatar switcher at http://signavatar.com

A warforged bard named Gender appears and says"Hello. I am a social construct."

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4449 on: June 28, 2016, 12:25:43 pm »

Why was Dfusion removed? it was one of my favorite scripts(unless I'm wrong and just forgot the name of it)! if it was in fact removed, how do I re-add it?

DFusion wasn't a single script. It used to be a separate collection of plugins, until it was merged into DFHack. Check out this post I made a few pages back, where I ask about DFusion and describe part of it. I also listed some of the current DFHack plugins and scripts that has similar functionality as certain DFusion plugins that I missed.

You would probably be interested in reading the posts that immediately follow mine, which explain why it was removed. Basically, DFusion is too old to work anymore and there doesn't seem to be much interest in updating it. But, at least, there are some alternatives or workarounds for some of what's missing.

Also, in this post Putnam shares an impregnate.lua script he wrote, which replaces the one that used to come with DFusion.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.42.06-r1
« Reply #4450 on: June 29, 2016, 09:00:16 am »

I played around a bit with spawn-flow today and noticed two things:
1. Spawned webs do not stick around.
2. It has no direction... It seems to fire towards the wester side, sometimes a bit north/south, but never east. It would be more useful if you could give the flow a direction. Or make it radial.

I initially tried the script because I was expecting water/magma sources, but that doesnt work with it... sadly source.rb doesnt allow me to use a location, it only runs with a cursor, so I cant trigger it from a workshop. Any chance for an update in that regard?

The source rb script has this for position:
Code: [Select]
    :pos => [df.cursor.x, df.cursor.y, df.cursor.z]
While the other scripts in lua that I can call from workshops look like this:
Code: [Select]
if args.location then
  local u = df.unit.find(unitId)
  local pos = df.coord:new()
  pos.x = tonumber(args.location[1])
  pos.y = tonumber(args.location[2])
  pos.z = tonumber(args.location[3])
  local teleport = dfhack.script_environment('teleport')
  teleport.teleport(u, pos)
end
« Last Edit: June 29, 2016, 09:11:01 am by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4451 on: June 30, 2016, 04:51:01 am »

--Rain issues--
Update on this. I got some proper rain and the weather output became:
Code: [Select]
R R R R R
C R C R R
R R R C C
C C R C C
R R R R R
After it stopped raining, the output went back to the usual:
Code: [Select]
C C C C C
C C C C C
C C C C C
C C C C C
R R R R R

I don't know how rain is supposed to work, but from what probing I've done the pseudo-rain area doesn't seem to correlate to any biome boundaries.
Spoiler: Here's a biome map: (click to show/hide)
I can't remember exactly how they interact in my fort, but the shrubland continues all the way up the west side of the map.
« Last Edit: June 30, 2016, 05:18:26 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4452 on: June 30, 2016, 05:37:54 am »

Q: Is there a relatively painless way to stop an NPC in Adventure Mode from being hostile? That is, to permanently convert a unit from hostile to neutral? Would this involve changing a flag on the unit, perhaps using the gui/gm-editor?
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4453 on: June 30, 2016, 08:29:07 am »

Q: Is there a relatively painless way to stop an NPC in Adventure Mode from being hostile? That is, to permanently convert a unit from hostile to neutral? Would this involve changing a flag on the unit, perhaps using the gui/gm-editor?
you can bound them against their will. which turns them into a companion you do have to talk to them to get this to work so,  guess turning them ghostly.
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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.42.06-r1
« Reply #4454 on: June 30, 2016, 08:04:55 pm »

Bumber: do you remember how many tiles on the local map your embark was (when embarking)?
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.
Pages: 1 ... 295 296 [297] 298 299 ... 360