diff --git a/examples/findnameindexes.cpp b/examples/findnameindexes.cpp index 98b83370a..48ad255bd 100644 --- a/examples/findnameindexes.cpp +++ b/examples/findnameindexes.cpp @@ -1,4 +1,5 @@ -// Map cleaner. Removes all the snow, mud spills, blood and vomit from map tiles. +// Dwarf fortress names are a complicated beast, in objects they are displayed as indexes into the language vectors +// use this tool if you are trying to find what the indexes are for a displayed name, so you can then search for it in your object #include #include @@ -62,16 +63,28 @@ int main (void) cout << "\nSelect Name to search or q to Quit" << endl; getline (cin, input); while(input != "q"){ - /*for( map< string, vector >::iterator it = names.begin();it != names.end(); it++){ - for(uint32_t i = 0; i < it->second.size(); i++){ - uint32_t found = tolower(input).find(tolower(it->second[i])); + for( uint32_t i = 0; i < englishWords.size();i++){ + for( uint32_t j = 0;j < englishWords[i].size();j++){ + if(englishWords[i][j] != ""){ + uint32_t found = tolower(input).find(tolower(englishWords[i][j])); + if(found != string::npos){ + stringstream value; + value << setfill('0') << setw(8) << hex << endian_swap(j); + cout << englishWords[i][j] << " " << groupBy2(value.str()) << endl; + } + } + } + } + for( uint32_t i = 0; i < foreignWords.size();i++){ + for( uint32_t j = 0;j < foreignWords[i].size();j++){ + uint32_t found = tolower(input).find(tolower(foreignWords[i][j])); if(found != string::npos){ stringstream value; - value << setfill('0') << setw(8) << hex << endian_swap(i); - cout << it->first << " " << it->second[i] << " " << groupBy2(value.str()) << endl; + value << setfill('0') << setw(8) << hex << endian_swap(j); + cout << foreignWords[i][j] << " " << groupBy2(value.str()) << endl; } } - }*/ + } DF.Resume(); getline(cin,input); } diff --git a/output/Memory.xml b/output/Memory.xml index a7e1d7a09..d31e7b199 100644 --- a/output/Memory.xml +++ b/output/Memory.xml @@ -1581,7 +1581,7 @@ 7a0859795e972574e80fa3cebc9fcf85
0x093154e0
0x093016b8
-
0x09314ff0
+
0x09355940
0x09314ffc
0x09301560
0x08859fc0
@@ -1630,10 +1630,12 @@ 0x0040 0x009E 0x00A0 - 0x0100 - 0x0100 + 0x00F0 + 0x160 + 0x00A0 0x02F8 0x0200 + 0x02F8 0x0334 0x0338 0x033C @@ -1709,7 +1711,7 @@ 51c73ff46b2688aafaee0204efe91a94
0x09315f00
0x093020d8
-
0x09315a10
+
0x09356360
0x09315a1c
0x09301f80
0x0885a9e4
@@ -1749,7 +1751,7 @@ f756194db073f05b98fc6ce872c8757d
0x09333e00
0x0931ffd8
-
0x09333910
+
0x09374260
0x0933391c
0x0931fe80
0x088788e4
@@ -1792,7 +1794,7 @@ cba6354000ec54865a161627605c3837
0x092bf340
0x092ab518
-
0x092bee50
+
0x092bee5c
0x0929a3c8
0x092ab3c0
0x088073d4
@@ -1827,7 +1829,7 @@ 4367c59934cbcf14f43fd3af6444c455
0x08f55740
0x08f41918
-
0x08f55250
+
0x08f5525c
0x08f307c8
0x08f417c0
0x0877b33c
@@ -1863,7 +1865,7 @@ dab3ce6bc074529706a1e5fe1273108c
0x08f5a760
0x08f46938
-
0x08f5a270
+
0x08f5a27c
0x08f357e8
0x08f467e0
0x08780354
@@ -1901,7 +1903,7 @@ 8f55a6250f2550e28535b79db43d5f1a
0x08f628c0
0x08f4ea98
-
0x08f623d0
+
0x08f623dc
0x08f3d948
0x08f4e940
0x0878c340
@@ -1933,7 +1935,7 @@ 777e7d674d8908042307994cb75250ff
0x09009860
0x08ff5a38
-
0x09009370
+
0x09009380
0x08fe48e8
0x08ff58e0
0x08833324
@@ -1965,7 +1967,7 @@ 04c3ad13c657f59ba6fc135e156d721d
0x09008880
0x08ff4a58
-
0x09008390
+
0x090083a0
0x08fe3908
0x08ff4900
0x08832328