Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 77 78 [79] 80 81 ... 360

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1170 on: October 20, 2014, 03:58:22 pm »

I cannot imagine what kind of horrible things could be done with that that couldn't be done with a C++ plugin or an independent lua script. Besides that, who're we worried about? I doubt pack makers like PeredexisErrant or Meph will be very willing to do weird stuff with that, and besides that it's far more risky to make it C++ based anyway due to the fact that the code may not be readily available. Besides that, worse comes to worse, Toady would probably get the whole "there's malware included in this mod" angle.

Even ignoring malware, the worst case is performance issues, AFAIK, though I may be missing something there.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1171 on: October 21, 2014, 02:04:36 pm »

How would one go about expanding the embark tools plugin? 

In my major mod, smelter reactions are all custom reactions with additional reagents to the ore itself.  For example, tetrahedrite smelting needs a flux in rough green glass which you can get in several ways, lead and tin ores need another coal bar to reduce the oxide, and ironworking is done entirely outside of the smelter.  This means, metal ores are no longer considered as such by the vanilla game, so that they no longer appear on the embark screen as "Shallow Metal" and "Deep Metal". 

I want to restore something like that to the embark screen, which I think would work in a similar way to the sand indicator.  As groundwork I've prefixed all the ore names with METAL_ORE_ (so, METAL_ORE_HEMATITE and so on).  How would such a script work, so that for example, the string to search would be "METAL_ORE_"? Ideally I would like for it to work like vanilla (with plurals and depth and all) though that is too much wizardry for me (I can't into DFHack programming  :()
I'm not sure if samanato ever got an answer, but I was hoping to make a variation of the sand indicator for my mod as well, to indicate the presence of "living stone" (a set of several minerals added by the mod).  Ideally, I'd like the player to be able to filter locations by its presence, but that's probably beyond my limited coding capabilities.
Looking at the source code in embark-tools.cpp, it doesn't look too hard to hack the sand indicator to check for a specific pattern of mineral names.  Before I get started, I have a couple more generic questions about DFHack plugins.

1. The "compile document" in this thread's OP is a broken link.  A pointer to real compiling instructions would be invaluable.  My limited experience with compilers was several years ago, and my experience with Git is non-existent.
2. Could embark-tools and a separate plug-in interposing at the same point coexist peacefully?  Can I guarantee that embark-tools would run first?
3. Would the embedded space in Core::getInstance().runCommand(out, "prospect all"); cause any problems?
4. This thing is going to be a stripped-down version of embark-tools, and I would really like to give attribution to the original author(s).
5. Is there a way to read what DF wrote on the screen?  That would let me put my indicator at the bottom of the site attributes.  Otherwise I need to print on top, and commingle my tool with the sand indicator.
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

LeoCean

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1172 on: October 21, 2014, 02:20:58 pm »

1. It was mentioned how to compile dfhack multiple times in the last 2 months a quick search will let you find that information.

http://www.bay12forums.com/smf/index.php?topic=139553.msg5667803#msg5667803 May help you or do a search for compile dfhack.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1173 on: October 21, 2014, 02:28:01 pm »

1. It was mentioned how to compile dfhack multiple times in the last 2 months a quick search will let you find that information.

http://www.bay12forums.com/smf/index.php?topic=139553.msg5667803#msg5667803 May help you or do a search for compile dfhack.
Thanks!  Visual Studio Express would work fine for me because I don't know enough about the different compilers to have a strong preference, so I can use those instructions directly.
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

salithus

  • Bay Watcher
  • gottagofast
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1174 on: October 21, 2014, 02:37:16 pm »

1. It was mentioned how to compile dfhack multiple times in the last 2 months a quick search will let you find that information.

http://www.bay12forums.com/smf/index.php?topic=139553.msg5667803#msg5667803 May help you or do a search for compile dfhack.
Thanks!  Visual Studio Express would work fine for me because I don't know enough about the different compilers to have a strong preference, so I can use those instructions directly.
you specifically need 2010 - I haven't dared to find out why yet but everyone who is "in the know" says that horrible things happen to your friends and loved ones if you use any other version.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1175 on: October 21, 2014, 02:39:34 pm »

IIRC DF is compiled in that and not compiling it in that will cause random-ass crashes or something along those lines.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1176 on: October 21, 2014, 02:48:54 pm »

The INVENTORY_CHANGE event currently crashes the game whenever it runs regardless of listeners.

just repeating this since it's a gigantic showstopper that prevents the release of numerous mods for the current version of DF

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1177 on: October 21, 2014, 02:56:48 pm »

1. It was mentioned how to compile dfhack multiple times in the last 2 months a quick search will let you find that information.

http://www.bay12forums.com/smf/index.php?topic=139553.msg5667803#msg5667803 May help you or do a search for compile dfhack.
Here is the documentation on Github.

How would one go about expanding the embark tools plugin? 

In my major mod, smelter reactions are all custom reactions with additional reagents to the ore itself.  For example, tetrahedrite smelting needs a flux in rough green glass which you can get in several ways, lead and tin ores need another coal bar to reduce the oxide, and ironworking is done entirely outside of the smelter.  This means, metal ores are no longer considered as such by the vanilla game, so that they no longer appear on the embark screen as "Shallow Metal" and "Deep Metal". 

I want to restore something like that to the embark screen, which I think would work in a similar way to the sand indicator.  As groundwork I've prefixed all the ore names with METAL_ORE_ (so, METAL_ORE_HEMATITE and so on).  How would such a script work, so that for example, the string to search would be "METAL_ORE_"? Ideally I would like for it to work like vanilla (with plurals and depth and all) though that is too much wizardry for me (I can't into DFHack programming  :()
I'm not sure if samanato ever got an answer, but I was hoping to make a variation of the sand indicator for my mod as well, to indicate the presence of "living stone" (a set of several minerals added by the mod).  Ideally, I'd like the player to be able to filter locations by its presence, but that's probably beyond my limited coding capabilities.
Looking at the source code in embark-tools.cpp, it doesn't look too hard to hack the sand indicator to check for a specific pattern of mineral names.  Before I get started, I have a couple more generic questions about DFHack plugins.

1. The "compile document" in this thread's OP is a broken link.  A pointer to real compiling instructions would be invaluable.  My limited experience with compilers was several years ago, and my experience with Git is non-existent.
2. Could embark-tools and a separate plug-in interposing at the same point coexist peacefully?  Can I guarantee that embark-tools would run first?
3. Would the embedded space in Core::getInstance().runCommand(out, "prospect all"); cause any problems?
4. This thing is going to be a stripped-down version of embark-tools, and I would really like to give attribution to the original author(s).
5. Is there a way to read what DF wrote on the screen?  That would let me put my indicator at the bottom of the site attributes.  Otherwise I need to print on top, and commingle my tool with the sand indicator.
1. Replace "COMPILE.rst" with "Compile.rst"
2. Yes. Priority for specific hooks can be set with IMPLEMENT_VMETHOD_INTERPOSE_PRIO instead of IMPLEMENT_VMETHOD_INTERPOSE.
3. That space is intentional - "prospect all" is the desired command, and "prospectall" is not.
4. File history. I've been meaning to implement a better way of checking for sand that doesn't involve searching prospect's output.
5. From the search plugin:
Code: [Select]
Screen::Pen pen = Screen::readTile(x,y);
if (pen.valid())
{
    // pen.ch, pen.fg, pen.bg, pen.bold, etc.
}
I'm not sure if this is the best solution, though - with the smallest window size (80x25), there are only a few extra rows available. If you're interested in all metals available, I'd recommend a script which duplicates some of prospect's functionality instead.
« Last Edit: October 21, 2014, 03:07:57 pm by lethosor »
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.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1178 on: October 21, 2014, 03:48:23 pm »

Don't want this to turn into a wall-of-quotes, so I'll start fresh :)

Thank you, lethosor, Putnam and salithus.  I'll make sure I find a copy of VSE 2010.  Somehow.  The original embark-tools only used "prospect" (looking for sand on the surface) and I just wanted to make that I didn't need to escape the space or somesuch to search for subterranean minerals with "prospect all".

The point of the project is that I made a mod that adds several features to the game, but they are only relevant if some of the modded stone types are on your map (LIVING GRANITE, LIVING SHALE, etc.).  For my own use I type prospect all at the console, but some players might consider that cheating.

With the Screen::Pen information it should be possible to loop my way down and find a blank line to report the site's status with "", "Living Stone" or "Living Stones".  I'll be sure to test it with an 80x25 screen on a busy embark site.

I think to start I will try a lua script (a wrapper around prospect all? prospector.cpp looks complicated...) that just reveals a little info about living stone on the map.  That has the advantage of being cross-platform and something I can throw into the raw/scripts folder.
« Last Edit: October 21, 2014, 03:51:38 pm by Dirst »
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

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.40.13-r1
« Reply #1179 on: October 21, 2014, 08:38:42 pm »

I'll make sure I find a copy of VSE 2010.  Somehow.
You don't have to look very hard - it's right here.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1180 on: October 22, 2014, 10:27:13 am »

I'll make sure I find a copy of VSE 2010.  Somehow.
You don't have to look very hard - it's right here.
Pleasantly surprised that prior versions are still available.  Was not my experience with Microsoft the last time I was looking for old stuff (though that was years ago).

I'll stop hogging the thread now  :-X
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

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1181 on: October 22, 2014, 01:57:01 pm »

The how to compile link has been fixed in the first post. Thanks for letting me know.

The INVENTORY_CHANGE event currently crashes the game whenever it runs regardless of listeners.

just repeating this since it's a gigantic showstopper that prevents the release of numerous mods for the current version of DF

Still on it, thanks. Hopefully I'll have some time this weekend to do DF stuff.

My current list is

Code: [Select]
fix digType
fix interaction-trigger
do conversion script for old syndromeTrigger system
fix INVENTORY_CHANGE
merge stuff
do release

No guarantees it'll be finished this weekend of course but I'll try.
« Last Edit: October 22, 2014, 03:25:13 pm by expwnent »
Logged

Kiloku

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1182 on: October 23, 2014, 10:28:36 am »

I saw that DFHack generates a few files relating to ghosts:
  • unit_ghost_info.h
  • ghost_goal.h
  • ghost_type.h
Can these somehow be used to modify ghosts and their behavior? I was thinking of making a mod that added friendlier and productive ghosts, but I've read that ghosts are hard-coded and can't be found on the Raws. Is DFHack powerful enough for me to make a ghost mod?
Logged

PariahDog

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1183 on: October 23, 2014, 11:20:33 am »

Hi, I've got a question about DFhack v34.11 (I've still got a Fort left in 0.34)

I've tried activating the gui/assign-rack script but it told me to activate the weaponrack-UNassign binpatch first, when I did it gave me this error.
Now I have to admit that computers, programming etc. are by no means my domain so I wager I'm doing something wrong. However I was unable to find any kind of solution on the internet.
Thanks in advance and apologies if I'm posting this in the wrong place, if this post doesn't belong here then just tell me where to post and I'll delete it.

Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.40.13-r1
« Reply #1184 on: October 23, 2014, 01:05:31 pm »

You're typing the command "binpatch check/apply <weaponrack-unassign>", which is totally invalid - you should be typing "binpatch apply weaponrack-unassign" to apply the patch (or "binpatch check weaponrack-unassign" to check if it's already applied).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.
Pages: 1 ... 77 78 [79] 80 81 ... 360