v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Utility Talk:Tweak/Development

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 18: Line 18:
  
 
Is there a reference for the addresses available?  Or how do I find the addresses? "map_data", "creature_body_part_health_vector_offset" ?  I will compile a list if I can find them. --[[User:M2775|M2775]] 07:07, 28 May 2008 (EDT)
 
Is there a reference for the addresses available?  Or how do I find the addresses? "map_data", "creature_body_part_health_vector_offset" ?  I will compile a list if I can find them. --[[User:M2775|M2775]] 07:07, 28 May 2008 (EDT)
 
:There are xml files in a separate folder (for tweak itself) where you are able to define things for different versions of the game.  It's best to check if the variable is available before using it though.  Almost all the basic useful addresses and offsets are included in those files. --[[User:Corc|Corc]] 12:55, 28 May 2008 (EDT)
 
 
== I'm doing something wrong here... ==
 
 
I'm trying to get the pointer to the data for the tile that is currently highlighted, like Tile Edit does. Here's what I have, but I must be doing something wrong.
 
<pre>
 
UInt32 mapx, mapy, mapz, mapxoffset, mapyoffset, mapzoffset;
 
mapx = memory.ReadU32(version.GetAddress("mouse_x"));
 
mapy = memory.ReadU32(version.GetAddress("mouse_y"));
 
mapz = memory.ReadU32(version.GetAddress("mouse_z"));
 
mapxoffset = mapx * 4;
 
mapyoffset = mapy * 4;
 
mapzoffset = mapz * 4;
 
UInt32 MouseMapOffset;
 
MouseMapOffset = memory.ReadU32(memory.ReadU32(memory.ReadU32(version.GetAddress("map_data")+mapxoffset)+mapyoffset)+mapzoffset);
 
</pre>
 
I've expanded it to figure out the problem as best I was able, and the first ReadU32 returns a pointer like it should, but the second one returns a value way too low to be correct (0x0013####) and when it reads that it ends up with a pointer way too high (0xD0######).
 
It's stumped me for the past 6 hours, so I turn to people more experienced than me in hopes of some help :)
 
&rarr;[[User:Valarnin|Valarnin]] 21:34, 17 July 2008 (EDT)
 
 
: From Tile Edit's source,
 
 
<pre> UInt32 map, xcount, ycount, zcount;
 
 
map = memory.ReadU32(version.GetAddress("map_data"));
 
 
if (map == 0)
 
{
 
MessageBox.Show("Map data is not yet available!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
 
return;
 
}
 
 
UInt32 mousex, mousey, mousez;
 
 
mousex = memory.ReadU32(version.GetAddress("mouse_x"));
 
mousey = memory.ReadU32(version.GetAddress("mouse_y"));
 
mousez = memory.ReadU32(version.GetAddress("mouse_z"));
 
 
if (mousex == 0xFFFF8AD0)
 
{
 
MessageBox.Show("Please press 'k' to choose a tile.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
 
return;
 
}
 
 
if (memory.Suspend() == false)
 
{
 
memory.Resume();
 
MessageBox.Show("Failed to suspend process.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
 
return;
 
}
 
 
xcount = memory.ReadU32(version.GetAddress("map_x_count"));
 
ycount = memory.ReadU32(version.GetAddress("map_y_count"));
 
zcount = memory.ReadU32(version.GetAddress("map_z_count"));
 
 
UInt32 block = memory.GetTileBlockAddress(map, xcount, ycount, zcount, mousex, mousey, mousez);</pre>
 
 
:: Hope that helps. &mdash;[[User:Rick|Rick]] 05:17, 18 July 2008 (EDT)
 
 
::: Thanks, Rick, that was exactly what I needed. I don't know '''''How''''' I missed that function. I can only blame lack of sleep. &rarr;[[User:Valarnin|Valarnin]] 11:47, 18 July 2008 (EDT)
 

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Please sign comments with ~~~~

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)