Bay 12 Games Forum

Please login or register.

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

Author Topic: Auto-designation macro  (Read 13386 times)

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #15 on: January 03, 2008, 09:39:00 pm »

quote:
Originally posted by Fenrir:
<STRONG>
Hmmm... I did. I'll try again and if it still doesn't work, I'll show you the csv file.</STRONG>

The other thing that could go wrong is the quoting in the file. It should look like this:

"D","D","#"

Not this:

D,D,#

Upload the first few lines of the file and I'll try to figure out what the problem is.

Fenrir

  • Guest
Re: Auto-designation macro
« Reply #16 on: January 03, 2008, 09:41:00 pm »

quote:
Originally posted by Valdemar:
<STRONG>

The other thing that could go wrong is the quoting in the file. It should look like this:

"D","D","#"

Not this:

D,D,#
</STRONG>



That's the problem. Thanks!
Logged

omagaalpha

  • Bay Watcher
  • positve infinite
    • View Profile
Re: Auto-designation macro
« Reply #17 on: January 27, 2008, 07:47:00 pm »

Hey is there way you can have program start in top right corner also to start design? For think make lot more useful so that people do not has to  count to get to left top corner.
Logged
Quote from: Jetsquirrel
Announce that i saw the whole creation of hte universe! and hold the monolith again
|The monolith is alive! And seemingly annoyed by your hugs. Or maybe static electricity of some kind that for some reason didn’t hit you last time.

Keizo

  • Bay Watcher
  • Proving dwarven motorcycle gangs are yankees too.
    • View Profile
Re: Auto-designation macro
« Reply #18 on: January 28, 2008, 04:00:00 pm »

You've won not just 2 internets, but also 3 elephants, a school of carp, and an artifact barrel that menaces with spikes of elf bone. I am so designing my entire fortresses in excel from now on...
Logged
火族

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #19 on: January 28, 2008, 06:10:00 pm »

Another update! You can now select which corner of the area you would like to indicate. The OP has been updated with instructions. Thanks to omagaalpha for the suggestion.

More parsed images:

   
   
(Note- this will only designate one of the small blocks - 1/9 of the picture)

If anyone else has any images they'd like parsed, please post them!

Moocow

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #20 on: January 28, 2008, 09:14:00 pm »

Could you add an ability to place doors/furniture? That would be epic.

[ January 28, 2008: Message edited by: Moocow ]

Logged
Death solves all problems - no dwarf, no problem.
- Joseph Stalin

Trukkle

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #21 on: January 30, 2008, 07:07:00 pm »

Oh god!

Bedroom_design  and Design_strategies on the wiki have some nice templates.

Hehe, I like how the row of hashes works out to the DF column in the sierpin.csv

[ January 30, 2008: Message edited by: Trukkle ]

I've just made up THLawrence's pods, testing them soon, then I'll post.

[ January 30, 2008: Message edited by: Trukkle ]

Logged
He needs distractions to get through the working day.

Trukkle

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #22 on: January 30, 2008, 08:30:00 pm »

Hmm, got a problem/bug here. Whenever it tries to dig an up/down stair it shifts downwards by 20 spaces before AND after placing it.

Code for this:

code:
===X===

ends up as this:

===
 
 
  X
 
 
   ===


This happens using your files and ones I've made.

Logged
He needs distractions to get through the working day.

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #23 on: January 30, 2008, 09:58:00 pm »

quote:
Originally posted by Trukkle:
<STRONG>Hmm, got a problem/bug here. Whenever it tries to dig an up/down stair it shifts downwards by 20 spaces before AND after placing it.

Code for this:

code:
===X===

ends up as this:

===
 
 
  X
 
 
   ===


This happens using your files and ones I've made.</STRONG>


Hmm, so you mean this happens when you use preloaded macro 1? That's strange... it works fine for me.

Aygar

  • Escaped Lunatic
    • View Profile
Re: Auto-designation macro
« Reply #24 on: January 31, 2008, 11:48:00 pm »

I improved the speed of the auto-designation macro using the SendInput function  and condensing contiguous actions and skipping unnecessary movement.  It adds the ablity for it to handle multi z-level constructions.  In addition it now can deal with both quoted and unquoted values in cells (double quotes only).

Download

The upper left hand corner of each level must be in the same z column.

The first z-level is assumed to be the reference level.  Subsequent z-levels are delimited by the string '#!num'  where num is the offset from the reference level.

   

It is fairly easy to overwhelm the df's key processing.  If the macro drops key commands this can be fixed by decreasing the value of the KeySentLimit variable.  The values that I found worked best was 50 keys followed by a 525 millisecond sleep cycle.

It should be able to run any layout that was created for the original macro.

[ January 31, 2008: Message edited by: Aygar ]

Logged
ilage THEN burn.

thirqual

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #25 on: February 01, 2008, 05:33:00 am »

Hi. I have the same problem as Truckle. It does offset by 2 to the right and 2 down each time the cvs contains something else than a d, a # or an absence of character. I tried for h, j, u, t, x, etc... strange. I'm runnig xp on a p4, so nothing fancy here, but the langage and the keyboard are french ones. Don't think it should matter but well.
Logged

twincannon

  • Bay Watcher
    • View Profile
    • http://www.twincannon.com
Re: Auto-designation macro
« Reply #26 on: February 02, 2008, 11:25:00 pm »

Oh man, if you could make it so this works with floors/walls/etc, you will basically just win the entire internet in a lump sum.
Logged

thirqual

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #27 on: February 04, 2008, 02:27:00 am »

Ok, I tried some things yesterday and the problem seems to come from the definition of both " and , in the french system (relative to the one for which the macro was written). Without changing the macro, I manage to use it successfuly by deleting the " around every character, except the # where they were necessary.

The effect of having " around the Ds was to offset the first D by 2 to the right and downwards, then correct behaviour for the other Ds (as long as it was only Ds and blank spaces). Same thing for any other character in fact. That's why with the  default files there was an issue with every character apart from the Ds.

(oh, and I suppect Excel to wreak severe havock with the .csv files on my system. Perhaps due to the fact that , is the decimal separator in the french system, excel kept on asking semicolumns...)

Logged

Aygar

  • Escaped Lunatic
    • View Profile
Re: Auto-designation macro
« Reply #28 on: February 04, 2008, 11:47:00 am »

quote:
Originally posted by thirqual:
<STRONG>Ok, I tried some things yesterday and the problem seems to come from the definition of both " and , in the french system (relative to the one for which the macro was written). Without changing the macro, I manage to use it successfuly by deleting the " around every character, except the # where they were necessary.

The effect of having " around the Ds was to offset the first D by 2 to the right and downwards, then correct behaviour for the other Ds (as long as it was only Ds and blank spaces). Same thing for any other character in fact. That's why with the  default files there was an issue with every character apart from the Ds.

(oh, and I suppect Excel to wreak severe havock with the .csv files on my system. Perhaps due to the fact that , is the decimal separator in the french system, excel kept on asking semicolumns...)</STRONG>



The enhanced auto-designation macro that I posted above strips " from around all of the items so it should not have that problem.  In fact I initial motivation for this mod was that I could not figure out how to make excel quote it's string values in csv files.   :)

Logged
ilage THEN burn.

Yahivin

  • Escaped Lunatic
    • View Profile
Re: Auto-designation macro
« Reply #29 on: February 19, 2008, 05:00:00 pm »

quote:
Originally posted by Moocow:
<STRONG>Could you add an ability to place doors/furniture? That would be epic.
</STRONG>

I was able to get it to work with doors and furniture with a one character modification to the script.

Check it out here.

Here's how:
Change the line in designator.ahk where it says: Perform("w{Right}","") to Perform("d{Right}",""). (Somewhere around Line 95) and save it.
Open up DF and the ahk script.
Switch to C-mode with the macro (Alt+C)
Choose the file (Alt+# where # is the # in the file name you saved)
Press B and then any furnishing, move your x to where you want to start.
DO NOT press space and return to the main 'b' menu (you should still have your x on screen).
press Alt+B and watch the script do its magic.

So far I've only tested with basic things like beds, doors, coffers, etc. It should work with anything at that same menu level. It probably won't work with workshops, but there might be a way if multiple characters are in each cell in the csv file ex: "wl","","","l","",""," d" (this could theoretically make two stills and then a door, but I haven't tested yet.)

Logged
Pages: 1 [2] 3 4