Bay 12 Games Forum

Please login or register.

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

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

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1170 on: October 20, 2014, 10:13:26 am »

You know, instead of ignoring my posts, you guys (including the pros) could just say 'no idea' if you have no idea how to look into it.

I am really disliking the fact that it looks like you people are ignoring my posts. :<

The problem with the alternative is you get 99 people saying "dunno" to every question (possibly followed by one person who does know) which doesn't really contribute to discussion and spams the thread. If someone knows the answer they'll say something within a day or two. If I don't know I just leave it.

Never mind, danaris beat me to it.
« Last Edit: October 20, 2014, 10:15:06 am by expwnent »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1171 on: October 20, 2014, 01:52:37 pm »

So, can I get access to a socket from a lua script? I can tell that I can use clsocket from a native plugin, but I want to write an IRC chatbot and I'd rather not have to build/manage binaries every time I want to make a dumb change.
Warmist's work in this branch may be helpful, although I'm not sure how usable it is in its current state.
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.

Gerund

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1172 on: October 20, 2014, 03:36:45 pm »

Warmist's work in this branch may be helpful, although I'm not sure how usable it is in its current state.
Alright, I'll ping him to see what he remembers about it. On the off chance that I hack it into something halfway usable, you think upstream would be interested in a PR for it? Giving arbitrary scripts socket access might be a bit dicey.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1173 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
  • On hiatus
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1174 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
On hiatus. Feel free to adopt or update:
(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 #1175 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
  • On hiatus
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1176 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
On hiatus. Feel free to adopt or update:
(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 #1177 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 #1178 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 #1179 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 #1180 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
  • On hiatus
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1181 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
On hiatus. Feel free to adopt or update:
(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 #1182 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
  • On hiatus
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1183 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
On hiatus. Feel free to adopt or update:
(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 #1184 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
Pages: 1 ... 77 78 [79] 80 81 ... 361