Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 118 119 [120] 121 122 ... 243

Author Topic: DFHack 50.13-r1  (Read 810370 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1785 on: June 02, 2019, 05:02:31 pm »

I have never once in my life managed to successfully compile DFHack. Right now I can't even get past the CMake step:

Code: [Select]
Project "C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
    Done Building Project "C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj" (default target) (1) ->
      C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.15

Can't find anything about these parts, based on my complete failure to ever compile a C++ project in my entire life I'd guess it's cause I somehow never manage to install MSVC correctly (because I have two hard drives? Because I'm a fuckup? Could be anything). Googling it reveals that there's some ways to fix it by explicitly including stuff in the command line, but I don't really like doing hammer-swing break-shit changes like that for my own personal use to git projects.

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1786 on: June 03, 2019, 06:30:18 am »

can we have a plugin that causes monthly saves? like triggering quicksave at the beginning of each month (except those where seasonal save does)?
the seasonal autosaves aren't enough when the game crashes too often and too unpredictable and i tend to forget to quicksave often enough.

Maybe something like this added to the "onLoad" init file would suffice:
Code: [Select]
repeat -name monthly_save -time 1 -timeUnits months -command [ quicksave ]It wouldn't skip seasonal saves, though. (Not sure if that causes a problem.)

Or if you want it to save every 10 mins, even while paused, this might work:
Code: [Select]
repeat -name ten_min_save -time 60000 -timeUnits frames -command [ quicksave ]Assuming a max FPS cap of 100. Not sure what happens if you're in a menu when it activates. Maybe it just fails.
You could cancel it while going AFK using "repeat -cancel ten_min_save". You'd have to re-enter the main command to reactivate it, or save&quit then reload.

If you want anything more complex, you'd need a script/plugin.
using your first script really helps alot! it saves on every 15th day of the month (can't interfere with seasonal saves) and that somehow seems to make fps smoother after saving.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

ragundo

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1787 on: June 03, 2019, 12:38:48 pm »

I have never once in my life managed to successfully compile DFHack. Right now I can't even get past the CMake step:

Code: [Select]
Project "C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
    Done Building Project "C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj" (default target) (1) ->
      C:\Users\Putnam\Documents\Projects\C++\dfhack\build\win64\VC2015\CMakeFiles\3.14.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.15

Can't find anything about these parts, based on my complete failure to ever compile a C++ project in my entire life I'd guess it's cause I somehow never manage to install MSVC correctly (because I have two hard drives? Because I'm a fuckup? Could be anything). Googling it reveals that there's some ways to fix it by explicitly including stuff in the command line, but I don't really like doing hammer-swing break-shit changes like that for my own personal use to git projects.

Yeah, compiling DFHack in Windows is not as easy as in Linux.

You need to have installed MSVC, git, perl, and cmake as the instructions in dfhack.readthedocs.org says

  • Clone dfhack using git

  • Launch a MSVC command prompt (the default Windows CMD is not good)

  • Go to the DFHack build directory, then go to the directory for your architecture (win64)

  • Run set_df_path.vbs

    This set in the script the location of your hard drive where Dwarf Fortress is installed

  • run one of the generate-MSVC-***.bat. This script calls cmake and is the most important one because:

    • Set the Windows toolset to use (v140, v141)
    • Set the generator that cmake will use for generating the instructions for compiling dfhack.

      If the MSVC version , toolset and generator are not the good ones according to what you have installed, you get a bunch of criptic errors while this script is running or when compiling.


    I normally use a generate-MSVC-minimal.bat like this for my system (Win10 64 bits, VS2017, toolset v141):


    cmake ..\..\.. -T v141 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_STONESENSE=0  -G"Visual Studio 15 2017 Win64" -DDFHACK_BUILD_ARCH=64 -DCMAKE_BUILD_TYPE:string=RelWithDebInfo


    Use toolset v141

    DFHack will be installed in the directory specified when you run set_df_path.vbs

    Build developer utilities

    Build developer plugins

    Don't build Stonesense

    Tell cmake to generate code for Visual Studio 2017 64 bits

    Tell the compiler that DFhack will be a 64 bit application

    Tell the compiler that DFHack will have debug information  embedded. Use Release instead of RelWithDebInfo if you don't want debug information.

  • run build-debug.bat or build-release.bat. Choose the former if you used RelWithDebInfo in the step above, choose the later for Release.

  • run install-debug.bat or install-release.bat for installing the compiled DFHack into the Dwarf Fortress directory.


Hope this helps people if they want to compile DFHack by themselves and not wait for the LNP to be updated.

Also, in IRC #dfhack channel we can provide more specific help (for compiling in Linux and  MacOS)

Greetings
Logged

DerMeister

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1788 on: June 04, 2019, 12:02:20 pm »

How make dwarf and other sapient corpses butcherable and usable?
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1789 on: June 04, 2019, 01:07:28 pm »

Logged

Prismatic

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1790 on: June 05, 2019, 07:02:11 am »

Another basic question:

What is the difference between the following methods? They appear to do the same thing, but is either preferable over the other?

Code: [Select]
for k,unit in ipairs(df.global.world.units.all) do
  unit.name.first_name = 'Testing'
end
Code: [Select]
for k = 0,#df.global.world.units.all-1 do
  local unit = df.global.world.units.all[k]
  unit.name.first_name = 'Testing'
end

Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1791 on: June 05, 2019, 07:17:01 am »

Yes, both scripts achieve the same thing. The first one saves some typing, as well as removing the need to keep track of whether the index uses the C convention (i.e. starting at 0) or the Lua one (defaulting to start at 1).
Logged

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1792 on: June 20, 2019, 01:09:56 pm »

I'd like to know if my Qt experiment works on macOS (I am worried by this). But, since I cannot use macOS myself, I need help from a macOS user who knows how to compile DFHack plugins.

Download and compile the plugin from here. You will need to install Qt (homebrew can help with that) and pass its installation directory to cmake with -DCMAKE_PREFIX_PATH (-DCMAKE_PREFIX_PATH=/usr/local/opt/qt for homebrew installation).

Try enabling the plugin ("enable qapplication"), then try commands like "qt-info" or "qt-log". Please tell me if windows appear and if DF survives it. Also check the content of "qt_log.txt" in DF directory (or the content of the log window if it works).

I finally found a macos vm I could work with and I can confirm that running the Qt gui loop off the main thread is an issue (Qt does not initialize correctly and windows don't show). :(
Logged

Schmaven

  • Bay Watcher
  • Abiding
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1793 on: June 20, 2019, 05:44:48 pm »

I hope that I'm just missing something, but I believe this to be true: Running "reveal" then saving and exiting the game does not allow un-revealing the map when that save is re-opened.
Logged

DerMeister

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1794 on: June 20, 2019, 08:38:02 pm »

Can DFhack automatically forbid fertile eggs? I need this for test egg-laying civ.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1795 on: June 20, 2019, 11:00:14 pm »

I hope that I'm just missing something, but I believe this to be true: Running "reveal" then saving and exiting the game does not allow un-revealing the map when that save is re-opened.
That is correct. The previous state is only saved in memory. "revflood" should be helpful in reproducing the unrevealed state for the most part, though.
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.44.12-r2
« Reply #1796 on: June 21, 2019, 04:27:46 am »

Can DFhack automatically forbid fertile eggs? I need this for test egg-laying civ.
You can write a DFHack Lua script to forbid fertile eggs, but it would probably cost you in FPS, because I don't think there's any trigger for the laying of eggs, so you'd have to use a script that makes a callback at fixed intervals. If those intervals are too long, eggs may be laid and collected in between script callbacks.

Also note that egg laying creatures that need to eat are tricky to breed, as they'll suffer from dehydration and starvation while sitting on their eggs (Elk Birds, for instance, need to graze). I'm not sure if that problem affects citizens, though, as the "give food/water" mechanism MIGHT kick in. With Elk Birds I've hauled the female off to a cage where she was promptly food and then led her back to the pasture, The eggs hatched, eventually.
« Last Edit: June 21, 2019, 04:31:45 am by PatrikLundell »
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1797 on: June 21, 2019, 08:17:25 am »

A thought, since I'm posting anyway: Alongside with the fixing of fat dwarves and buckets, maybe the script in this post would also fit in in fps fixes folder? (Though it could use replacing tabs with spaces and comment for documentation. And maybe making the repeat internal.)

@PatrikLundell: JSYK, iirc they'll also feed ones on a chain. Install one next to a nestbox, maybe?

@DerMeister: Here's quick and dirty one that forbids new fertilized eggs every tick.

repeat -name forbid-eggs -time 1 -command [ ":lua eggtable = eggtable or {} for index, egg in ipairs(df.global.world.items.other.EGG) do if not eggtable[egg.id] then if egg.egg_flags.fertile then egg.flags.forbid = true end eggtable[egg.id]=true end end" ]
« Last Edit: June 21, 2019, 08:22:59 am by Fleeting Frames »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1798 on: June 21, 2019, 08:29:33 am »

Yes, I've used a chain, and I think that worked. However, unless they've been sentenced, you can't chain up citizens...
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1799 on: June 21, 2019, 10:10:22 am »

Unless one uses Script to restrain creatures.

Mind, iirc I've seen haulers bring water to thirsty but free-walking miners, so this might be more of a matter of difference for civ culture.
Pages: 1 ... 118 119 [120] 121 122 ... 243