Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5

Author Topic: DFWall - a mass rewall/refloor utility  (Read 5909 times)

Shurhaian

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #45 on: May 16, 2008, 02:24:00 pm »

That's appreciated. As it stood, it was VERY easy to miss them in the 2nd instruction block.

For clarity, it might be helpful to list a common example - both where to find the tileset file(i.e. Dwarf Fortress's /data/art subdirectory, say, curses_800x600.bmp) and how to determine the tile dimensions.

...now, though, I'm having a problem trying to get the mapmaker to work. It seems to be treating the tile width inconsistently, with the result that pixels start showing up in the template that are actually from the next tile over(or down). It's not EVERY tile, which makes it all the more puzzling. About 7 chars in, I notice that it's shaving one pixel off(of course, this is much easier to tell since that's where the next tile is inverted, thus the whole vertical line shows up on the tile before), and by the end of the line, it's getting two extra filled pixels in. Should I not actually be putting in the coords that the calibration shows as the top-left magenta pixel? It seems even the first tile on each line is off-center on both x and y(the graphic is too high and too far left, i.e. it's starting too low and too far right).

If there's any way to hand the tileset file directly to the program, that'd simplify things greatly; the file path, the BG color(though I'm pretty sure that due to the engine that should always be FF00FF), and the number of tiles in each dimension(again, is this not always 16 x 16?) would be enough to crunch on. But I imagine there are constraints in the language used, so I'll keep poking at it...

Addendum: This seems to have been a fault with the GIMP, which wants to put a select box around the edge of the image and in so doing seems to actually put it ON the image. Tried again with MS Paint, and while some of the tiles still look off-center, the results appear sane, making me think that maybe the tileset itself IS slightly off-center in some places. Other tiles, even at the edge of the image, look spot on.

[ May 16, 2008: Message edited by: Shurhaian ]

Logged
Working on: drakes - making the skies(mostly) a bit more varied

My guards need something better to do than make my nobles happy with hugs and justice.

LordZabujca

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #46 on: May 16, 2008, 04:02:00 pm »

quote:
For clarity, it might be helpful to list a common example - both where to find the tileset file(i.e. Dwarf Fortress's /data/art subdirectory, say, curses_800x600.bmp) and how to determine the tile dimensions.

Eh. I can add some info about getting the TileWidth and TileHeight values to the OP, but if somebody doesn't know where to find the tileset file then they probably have the standard curses640x300 one anyway - and DFWall is configured for that by default.

   

quote:
If there's any way to hand the tileset file directly to the program, that'd simplify things greatly; the file path, the BG color(though I'm pretty sure that due to the engine that should always be FF00FF), and the number of tiles in each dimension(again, is this not always 16 x 16?) would be enough to crunch on. But I imagine there are constraints in the language used, so I'll keep poking at it...

FF00FF as the background colour may be hardcoded at the moment, but I didn't see any harm in moving that to the ini (the same goes for the 16x16 thing). It was completely no effort at all while saving me from problems in case:
1. it WASN'T hardcoded
2. it stops being hardcoded in the future

This "lets export everything I ever assume that can be easily changed to the ini" policy has already saved me from problems twice (see those two tilesets that were incompatible with the original settings in the previous posts), so I'll probably keep doing that in the future.

A simple way to use the mapmaker like a "mapmaker curses800x600.bmp 16 16 10 12 newtemplate" command would be ideal, but to make that possible I'd have to learn some things about interpreting graphical files - and I really don't have time for that at the moment (the language isn't really a problem - I can simply use an external program to do whatever cannot be reasonably scripted in AHK, as I'm doing anyway with the "extc.exe" and the mapmakers ctrl+2 function). The current solution is quick and dirty, but it works.

And yeah, those standard tilesets are a bit off-center. If that's the only problem then the mapmaker works correctly.

[ May 16, 2008: Message edited by: LordZabujca ]

Logged

Fedor

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #47 on: May 18, 2008, 09:31:00 pm »

Thank you for your help, LordZabujca.

The utility now works for me, which means I can help you with the usage instructions, hopefully making them easier to understand for more users.

=================
Usage:
1. Type 'b', then 'C' to go to the wall/floor construction interface.  Choose any type of construction and location, then select (but do not choose) a material type. With the material highlighted, hold down either Ctrl key and type a digit from 0-9, using the keys at the top of the keyboard and not the number pad. The program will visibly load your preference.  
2. Return to the wall/floor construction interface, choose the appropriate construction type, and get to the selection of a location. Move the cursor (selector) to one corner of the rectangle you wish to fill with constructions. Hold down either Ctrl key, and use the arrows or numbers on the main keypad (not the number pad) to navigate to the opposite corner. Release Ctrl.
3. Hold down the letter used to build the construction type (f (for floors), w (for walls), etc.), type the number you used to select the material type, then release the letter.

The utility will now automatically build the constructions, one by one, until the rectangle is filled.

Notes: (should be verified, corrected, and added to)
* Material preferences only load once for a given number; to reset them, restart the utility.
* Be careful not to request more constructions than you have available materials of that type.
=================

I'd also help with the installation instructions, but there are some points I'm still unsure of.  Does this utility require the installation of AutoHotKey?  I assume not, but installed AutoHotKey previously so am not certain on this point.

Logged
Fedor Andreev is a citizen of the Federated Endeavor. He is a member of the Wandering Minds.

Fedor

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #48 on: May 18, 2008, 09:47:00 pm »

Oops.  Spoke too soon.

Using the steps above, the utility actually chooses, not the correct material type, but the nearest material every time I've tried it so far.  In other words, it doesn't scroll down the materials list, just choosing whatever's on the  top. What might I be doing wrong?

Logged
Fedor Andreev is a citizen of the Federated Endeavor. He is a member of the Wandering Minds.

LordZabujca

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #49 on: May 19, 2008, 03:29:00 am »

The script is compiled so autohotkey isn't necessary.

 

quote:
Notes: (should be verified, corrected, and added to)
* Material preferences only load once for a given number; to reset them, restart the utility.
* Be careful not to request more constructions than you have available materials of that type.

1. Er, not really. You should be able to reuse a number however many times you want - unless there's a bug I'm not aware of.
2. Sure, but it's not that important. If you request more constructions than you have materials then DFWall will simply start skipping tiles when you run out of them - or stop completely if you've got StopOnFailure set to TRUE.

 

quote:
Oops. Spoke too soon.

Using the steps above, the utility actually chooses, not the correct material type, but the nearest material every time I've tried it so far. In other words, it doesn't scroll down the materials list, just choosing whatever's on the top. What might I be doing wrong?


DFWall is programmed to quit the material selection screen in case of not finding the necessary material, so there are two cases when that could happen:
1. DFWall does find the material, but can't scroll to it
2. Something is wrong in the ini file leading to false positives

In general the solution is:
1. Check the ini and change:
PageDownButton - the button you use to scroll down a whole page in the material list (numerical * by default)
ScrollDownButton - the button you use to scroll down by one material in the material list (numerical + by default)

If those are correct:
2. Go through this checklist:
I. Are your XStart and YStart correct? Use the ctrl+m tool of the mapmaker or the MSPaint method to check that.
II. Was your map file generated properly (if in doubt, regenerate)? Is it setup correctly? Remember that you aren't supposed to add the file extension to its name in the ini.
III. Are the colours setup correctly? Use the mapmaker and its ctrl+m tool (and the colour explaination from the OP) to check that.

It sound to me (from that first note in your previous post) that the likely cause of the problems is that your SeparatorColour value is correct while the rest of the colours are incorrect, so pay special attention to 2/III. I don't know why the colours I gave you won't simply work - if all else fails, try using a fresh DF install with the default settings (run in a window) and a fresh copy of DFWall, also with the default settings. If that works then we have a configuration problem to overcome. If not then I'll probably be unable to help you further.

[ May 19, 2008: Message edited by: LordZabujca ]

Logged

Fedor

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #50 on: May 19, 2008, 05:36:00 pm »

LordZabujca, thank you for your efforts to work with me on this problem.

After some more time investment, I did manage to get DFWall to work - but only for the curses tileset.

The Herrbdog tileset breaks DFWall.  The reason is, not that it is shaded, but that it does not guarantee any specific highlight color; the brightest (least shaded) pixel differs from character to character.  The colors you kindly provided only work for some characters.

Happily, the solution is quite simple.  I noticed that the ratios between the red, blue, and green values remains approximately constant regardless of the amount of shading, and also noticed that, because DF has so few colors, it's really, really easy to tell them apart.  So, all DFWall needs to do is to request the user to supply the "pure" selection color (0x00FFFF by default) and accept tiles with even roughly the same proportions of red, blue, and green.

With more robust color matching, the program could potentially access the file "\init\init.txt", read the values for colors there, and use them as the "pure" values.  No need for the awkward and fool-vulnerable Ctrl+m method.

=========

The "notes" section may have been erroneous, but please do feel free to use the "usage" section in your documentation.  I believe you will find that more people will actually be able to get DFWall to work if provided revised instructions.

Logged
Fedor Andreev is a citizen of the Federated Endeavor. He is a member of the Wandering Minds.

LordZabujca

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #51 on: May 19, 2008, 06:18:00 pm »

If only it was easily possible to tell Autohotkey to accept all colours not further away than a certain radius from a given colour...

Hmm... Actually, that may be possible. I'll look into upgrading the FindActive function and making the ini file requirements a bit more reasonable when I'll have some free time.

And yeah, thanks for the instructions. I've already added them to the OP with the appropriate credit.

EDIT: You know, it should be possible to alter the Herrbdogs tileset a little bit to ensure that consistent "selected"/"not selected" colours will show up in at least one pixel in every tile without making a noticeable change. This could be the temporary quick fix you need until I figure out something better to deal with this kind of circumstances (maybe instead of actually looking for the active material I'll keep sending "scroll up" until the colour of the first material changes? That could work - I just need to deal with the few special cases).

[ May 20, 2008: Message edited by: LordZabujca ]

Logged

Moronical

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #52 on: May 23, 2008, 03:01:00 am »

Why does mine work stupid. I did the stuff needed to make the floor set, but all it does is move the cursor, select the WALL, use the WRONG materials, on the WRONG place. What's wrong? Version? I think it's the df_27_176_38c.

Explain   :o

Logged

LordZabujca

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #53 on: May 23, 2008, 03:54:00 am »

The version makes no difference, as long as it's one of the 3D ones.

It seems to me that you didn't configure it correctly. Upload your Dwarf Fortress folder (without saved games) with a screenshot of your DF window and your copy of DFWall inside to rapidshare and I'll take a look.

Logged

Tylui

  • Bay Watcher
  • O_o
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #54 on: June 11, 2008, 07:42:00 pm »

I did the rectangle method with some flooring I wanted...  But it was up above, and some squares the floors couldn't be placed...  So when it error'd out of the floor, it would automatically try to build a wall.  Once it was successful, and built a wall, it would move on a build a floor.

Recap:  If it goes from a Red(unplacable) to a Green(placable) square, it'll try to build a wall.  Green to Green, it will properly build a floor.
:)

Asking you to do all the work of assigning all furniture a symbol, etc. would just be ridiculous, so if you make it moddable, then we have to worry about that; not you.  ;)

Logged

LordZabujca

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #55 on: June 12, 2008, 12:39:00 pm »

Yeah, I know about that "wall after implacable" thing. It was supposed to be a quickly hacked way to deal with failures to place a floor without stopping the construction. It works so far, sort of, and is a temporary thing. As for the pattern rewalling as it is now is sort of a proof of concept - people were complaining that there was no easy way to feed patterns from external programs into DFWall, so I gave it that functionality. I do plan to give it an overhaul (and that includes making it moddable) - it's the next item on the agenda, right after sorting out proper tileset support.

The problem is I've got all my sources on a laptop hard drive and its graphics card is fried, so that put a stop to any developement work that I've planned until the matter is resolved - don't expect any new releases soon. If you really place a lot of beds I can give you a quick and easy hack to let you do that - just change the BuildCageButton to {b} and use the "cage" symbol in your templates to signify beds. It should work, as long as I've remembered to actually get the button to build cages from the ini and not assume that it's a 'j'. If that won't work, try the same with the statue construction button and the statue symbol - for this one I'm pretty certain that it do read it from the ini.

If this method works it should probably work for any kind of one tile constructions accessible directly from the 'b' menu.

[ June 12, 2008: Message edited by: LordZabujca ]

Logged

Tylui

  • Bay Watcher
  • O_o
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #56 on: June 15, 2008, 08:12:33 pm »

Man I love the DF Forums... We have such a great community here, and great people like you, LZ, make it all the more possible.
Logged

Keldor

  • Bay Watcher
  • Blood for the blood god!
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #57 on: June 16, 2008, 12:39:33 am »

Instead of having to manually count for XStart and YStart, why not just call GetClientRect() to obtain the client area from the DF window?
Logged
If ignorance is bliss, why are my dwarves all tantruming?

LordZabujca

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #58 on: June 16, 2008, 01:37:08 am »

Well, mostly because it was easier to implement in the beggining - I'm pretty new to autohotkey (in which DFWall is written at this point) and I've decided to just implement stuff strictly necessary to release DFWall before learning how to do calls to external functions. Don't worry though, I will do that for the new version (which, as I've said, won't come soon - I can't access my source files until my graphics card is repaired and those computer store guys are taking their sweet time with it).
« Last Edit: June 16, 2008, 01:40:32 am by LordZabujca »
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: DFWall - a mass rewall/refloor utility
« Reply #59 on: June 20, 2008, 04:51:13 pm »

I've had few problems with this too (I like it very much) one of them was the Wrong Material (though I'm unsure what caused it) and the other is that I can't mass build Fortifications.  It does one (because that's what was selected at the time of designating an area) and then does floors.  I also can't get it to do ramps or stairs at all (not that I should ever need them).
Logged
Pages: 1 2 3 [4] 5