Bay 12 Games Forum

Please login or register.

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

Author Topic: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)  (Read 10717 times)

Exponent

  • Bay Watcher
    • View Profile

The button is grayed out if the program doesn't have all the information it needs to execute the current operation.  Did you grab all the addresses off of the wiki page?  in_viewport requires the following:

<address name="menu_state" value="0x01386260" />
<address name="view_state" value="0x009EF368" />
<address name="viewport_x" value="0x00D387FC" />
<address name="viewport_y" value="0x00D66870" />
<address name="viewport_z" value="0x00D6684C" />
<address name="window_grid_x" value="0x016F8A7C" />
<address name="window_grid_y" value="0x016F8A80" />

Without all of those values, the program cannot determine the size/location of the viewport, and therefore cannot determine if a tile is within the viewport or not.
Logged

Slappy Moose

  • Bay Watcher
    • View Profile

Hah, silly me.

Thanks!
Logged
Zaneg Thazor: Armok Reincarnate Story http://www.bay12games.com/forum/index.php?topic=19291.msg196691#msg196691

[Healthcare Update Thread] Personally, I can't wait for doctors to get possessed and start surgically attaching axes to champion soldier's arms.

CrazyEyes

  • Bay Watcher
    • View Profile

I'm getting an odd error whenever I try and run a utility...

Code: [Select]
Reading of the map data resulted in an exception.

Exception type:
DwarfFortressStateException
Exception message:
Map data is not yet available.

Halp? :-\
Logged
I'm glad all the DF players are not living in one district. It'd be the most dangerous district for the whole world.
Actually, it'd be the most dangerous district in hundreds of thousands of worlds, starting with 'Xah Rabin' The Dimension of Omen. 

Exponent

  • Bay Watcher
    • View Profile

Well, the most obvious cause of that message would be that you don't yet have a fortress loaded, but are rather in the main menu somewhere.  If that isn't the case, my next thought would be that the address in your xml file for Tweak is wrong.  Assuming you are running the latest version of DF (39f), can you verify that you have the following value (make sure it is exactly correct) is in one of the xml files in the versions/0.28.181.39f folder?

   <address name="map_data" value="0x015B7920"/>

If neither of these are the problems, then somehow, when I ask the Tweak program for the value stored at that location, it returns 0, which should only happen if no map is loaded.  If it's happening even though a map is loaded, and if it is grabbing the value from the correct address, then I'm stumped.
Logged

Idiom

  • Bay Watcher
  • [NO_THOUGHT]
    • View Profile

Works perfect with this new tweak fix: http://www.bay12games.com/forum/index.php?topic=22815.0

Fun utility.

is_water -> set_liquid_level(0);
 ;D
What ocean?

is_river_spawn->is_magma_spawn;
is_water->is_magma
Styx!
Logged

Ter13

  • Bay Watcher
  • Oh wait... Dwarves like food, don't they?
    • View Profile

Anyone figured out how to use the set_raw_type stuff yet? I'm stumped...
Logged
Murderhold - A story about a fortress closed off from the world, attempting to survive a zombie-infested wilderness.
Murderhold Discussion thread

Exponent

  • Bay Watcher
    • View Profile

Version 0.4 is now available from DFFD:  http://dffd.wimbli.com/file.php?id=404

Changes:
  • general interface improvements
  • fixed undo bug, when the maximum undo/redo depth was infinite
  • added z_distance_to_surface
  • renamed is_ramp to is_upward_ramp
  • added is_ramp, is_downward_ramp, is_above_upward_ramp and make_downward_ramp
  • renamed is_lava to is_magma_source, and make_lava to make_magma_source
  • added traffic designation queries, which had erroneously been left out
  • added a few additional example operation sets to the included file

Improvements to the wiki page will come sporadically, but it's still a work in progress, and I'm hoping that my program is intuitive enough to limit the need for much documentation.  Note the tooltip help things that popup when you hover your mouse over most items in the insert menu/insert toolbar buttons, as those contain the bulk of the documentation that I have written.



Placing a River Source tile in the air will cause a crash. (I suspect the same for chasms, etc.

I was unable to reproduce this crash.  I successfully placed river sources in the air, and when I placed on in the air but next to a cliff that I could mine, I successfully produced a working river source in the air.  I also placed a chasm in the air, and dwarves successfully dumped stuff into the chasm, even though it wasn't on the bottom z-level.  The items disappeared entirely, as I hoped would happen.  Since I couldn't reproduce the crash, I left the relevant code as-is, with no extra checks to avoid crashes.



Anyone figured out how to use the set_raw_type stuff yet? I'm stumped...

The raw functions are there just in case someone wanted to and knew how to access stuff that I haven't figured out or implemented yet.  The set_raw_type(double type) function expects one argument which is the numeric value corresponding to this post by Toady one.  Changing types often seems to involve more work than simply changing this one value, however, so I wouldn't expect much.  For example, changing from a piece of dirt to a tree would require also specifying what type of tree.  This information is probably stored in a separate piece of memory allocated independently, and without it, the game would probably get confused, or ignore the tile, or something.  But feel free to experiment.

The and_raw_ and or_raw_ versions take the argument they are given, convert it to an unsigned integer, and the either binary-and or binary-or it with the current value.  This is for setting subsets of the field, for example, the liquid level of the designation flag, which takes up three bits.  If this is all over your head, it's probably best to avoid the raw functions, but if not, feel free to hack away and see what happens.
Logged

Exponent

  • Bay Watcher
    • View Profile

Less than two hours, and version 0.5 is now available.  Just a single bug fix:
  • set_liquid_type_to_water was not working, now it is
Logged

Ter13

  • Bay Watcher
  • Oh wait... Dwarves like food, don't they?
    • View Profile

Many thanks, Exponent, I've been playing around for a minute, and if there were some way that I could print debug messages from the program into a log, I could figure out what kind of data goes in the raw data. Obviously, if it is a double value, I can just mess around with it and document my success/failure in the wiki pages, however, it seems to be giving me type mismatch errors instead of actually allowing me to change them. =/
Logged
Murderhold - A story about a fortress closed off from the world, attempting to survive a zombie-infested wilderness.
Murderhold Discussion thread

Ter13

  • Bay Watcher
  • Oh wait... Dwarves like food, don't they?
    • View Profile

Many thanks, Exponent, I've been playing around for a minute, and if there were some way that I could print debug messages from the program into a log, I could figure out what kind of data goes in the raw data. Obviously, if it is a double value, I can just mess around with it and document my success/failure in the wiki pages, however, it seems to be giving me type mismatch errors instead of actually allowing me to change them. =/

On second look, the get_raw_type is not returning a double value. What is it returning? I can't get anything to work. It seems like it's returning a boolean, but it doesn't accept any arguments, so I don't get how to use it at all... =/

Oh, and any usage of set_raw_type is calling an "invalid program error".

=/ Wuhtiff?
« Last Edit: August 16, 2008, 12:31:58 pm by Ter13 »
Logged
Murderhold - A story about a fortress closed off from the world, attempting to survive a zombie-infested wilderness.
Murderhold Discussion thread

Pilsu

  • Bay Watcher
    • View Profile

Does this mean the tyranny of microcline clusters is finally over?
Logged

Exponent

  • Bay Watcher
    • View Profile

Many thanks, Exponent, I've been playing around for a minute, and if there were some way that I could print debug messages from the program into a log, I could figure out what kind of data goes in the raw data. Obviously, if it is a double value, I can just mess around with it and document my success/failure in the wiki pages, however, it seems to be giving me type mismatch errors instead of actually allowing me to change them. =/

On second look, the get_raw_type is not returning a double value. What is it returning? I can't get anything to work. It seems like it's returning a boolean, but it doesn't accept any arguments, so I don't get how to use it at all... =/

Oh, and any usage of set_raw_type is calling an "invalid program error".
Ah, yes, I see the problems in the code; they are quite obvious, now that I'm looking for them.  All my fault, and all due to not testing thoroughly.  I'm working on fixing these problems, and adding some new features, so I'll have a new release within the next couple of days.  Tonight, even, if all goes well.  Until then, these raw functions aren't going to operate well at all.
Logged

thepodger

  • Bay Watcher
    • View Profile

Can this create walls?
Logged

Exponent

  • Bay Watcher
    • View Profile

Unfortunately, no.  Creating walls (whether natural or constructed) means specifying what the wall is made out of, and I don't know where that information is, and thus can't write to it.  And even more problematic is the possibility that memory needs to be allocated to turn a non-wall into a wall, which would make the creation of walls even more complicated.  I'd love to be able to figure all this out, but at the moment, it's too much for me.

If it's any solace, I'm planning on adding blood and slime to the next release, once I figure out a concise way to organize the relevant functions.  Soon you will be able to cover your entire fort in blood!  Who could pass that up?
« Last Edit: August 17, 2008, 10:05:11 am by Exponent »
Logged

Idiom

  • Bay Watcher
  • [NO_THOUGHT]
    • View Profile

Turns the tile back into a solid natural stone wall not do-able? There was a utility for this back in the 2D days.

I would like a "stone type -> other stone type" function as well.
Logged
Pages: 1 2 [3] 4 5 6