 |
|  |
 |
|
Allard HS
|
My guide with everything about hex-editing from a while ago has just finished a great update. All forum posts about new discoveries since then have been added, the newest version of Jorrit's guide on map-hex-editing has been completely copied, and some very useful info on resource editing (for DLL and EXE files) has been added.
Be sure especially not to miss that last thing. (It's in chapter A, near the end of the document).
It's all written using Word XP, but I think you can also read it in older versions of Word.
Attachment: hex editing.zip
This has been downloaded 171 time(s).
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
The 17th byte of the TECHNOLOGIES & MONEY part of each civ holds NumberOfAcquiredTechs+1 (starting techs are not included).
(works with MGE)
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
quote: Originally posted in HEX-EDITING (hex-edit.rtf)
byte nr. 20
...1 .... cheat penalty/warning
.1.. .... scenario file (no effect really) |
I think there is an effect: techs are open (scenario) or one third is rotately made impossible (standard game).
|
|
|  |
 |
|
SCDARS
|
Do you think it would be easy to eliminate all huts by a program? Since all huts are set by the seed, it would seem likely to me that the status of all huts (tipped -or active) is collected in some part of the file and not attached to each of the map tiles' entries, right?...
|
|
|  |
 |
|
SCDARS
|
Of course you can, but I was asked by some people if there is an easier way to do this for multiplayer (having the host enabling the cheat menu is not what everybody likes). But the cheatmenu option should make it easy to find the location of those bytes.
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
quote: Originally posted by Henrik
I thought you could allready eliminate all huts simply by using the cheat menu? |
Do you mean to go in the scenario mode, to turn huts off, then save into a .sav file? I tested it (for Early Landing Comparison Game #1 ), but if I remember correctly, I had a problem with that byte 20 (I think the cheat mode was left) and I had to hexedit it manually.
|
|
|  |
 |
|
SCDARS
|
If you use "turn huts off", obviously in the 2nd data block of the map 0F is replaced by 00 in one entry each 6 bytes. My first uneducated guess is: All tiles are set to have been owned by the Barbarians and a hut is considered tipped if one civ owns its tile (in the 6th byte).
Moving a roman warrior to one tile changes its respective value to 10, using a Babylonian unit switches it to 20 etc. -- which seems to support this theory.
Can someone more experienced comfirm this?
Last edited by SCDARS on 23-02-2003 at 20:30
|
|
|  |
 |
|  |
 |
yaroslav
 |
Madrid, Spain, Europe
Jun 2001 time: 06:37
|
|
quote: Originally posted by SCDARS
Do you see any obvious mistakes in this part of code? (handle is a java RandomAccessFile-object). After some testing, at least it does remove the huts and it doesn't have any side-effects as obvious as turning the whole map into river (which was the result of my first attempt ).
code:
int fertility;
final int owner=0;//240 = no owner; 0 = barbarians;
for(int i=0; i < SURFACE ; i++){
handle.seek( OFFSET_MAP_BLOCK2+6*i+5 );
fertility = handle.read() % 16;
handle.seek( OFFSET_MAP_BLOCK2+6*i+5 );
handle.write( owner + fertility );
}
|
Hi! I'm also using Java for my Civ2 related utility, Civ2PBEM Diplomacy, and in the first version, I also used RandomAccessFile! If you are interested, we can share code or whatever you want ...
(BTW, a good idea would be issue the handle.write when owner<0 && owner>7. This way, you can use this program in any turn of the game, without changing the civ's owner of the tile. For example, if there is a city, I think that your code put the owner city's tile to barbarian, and I'm not sure if that makes sense )
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
SCDARS, did you finish the program that removes huts?
|
|
|  |
 |
|
SCDARS
|
You can get it here: http://www.civ2.de/pages/liga/misc2...ttachmentid=581 Since I did not expect much interest, I have not written any documentation. It should be fairly easy to use, though. For installation (java required), simply unzip it into some new folder.
For use, put your save into that folder, rename it to "save.net" and run the batch file.
Last edited by SCDARS on 22-11-2003 at 17:47
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
You need to know number of units (to get the size of 'unit information block') and number of cities if you want to be able to browse cities by a program.
I found nothing in the 'Hex-edit.rtf' document...
Yaroslav, Xin Yu, you probably know it?
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
Yaroslav, thank you very much.
Another question:
Does anybody know where is agglomerate work of settlers stored? I would like a utility that shows that...
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
Thank you, yaroslav.
I am inclined to believe there are 'units of work' stored in that byte. So Settlers increase the value stored in this byte by 1 every turn of work, but Engineers by 2. Reason: a Leonardo upgrade don't double the aggregate work.
I plan to incorporate aggregate work of settlers in 'Beakers counter'. After that I will confirm or deny my hypothesis.
|
|
|  |
 |
SlowThinker
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:37
|
|
quote: Originally posted by Hex-edit.rtf
Enemy ... units that are lost out of sight, will remain marked on their last seen location (?), |
Only until they move. The move is seen, but then they are lost of sight completely.
quote: Originally posted by SCDARS
If you use "turn huts off", obviously in the 2nd data block of the map 0F is replaced by 00 in one entry each 6 bytes. My first uneducated guess is: All tiles are set to have been owned by the Barbarians and a hut is considered tipped if one civ owns its tile (in the 6th byte).
Moving a roman warrior to one tile changes its respective value to 10, using a Babylonian unit switches it to 20 etc. -- which seems to support this theory.
Can someone more experienced comfirm this? |
Nooo...
You confuse two different bytes. The sixth byte is the byte that controls huts:
quote: Originally posted by Originally posted by Hex-edit.rtf
The fifth byte represents "visibility", indicating which of the civilizations have explored
that particular square. 00 means none of the civilizations (including the barbarians,
who are the "0th" (red) civilization) have uncovered that square so far
...
E.g. A square discovered by the Barbarians, Romans, Germans and Sioux will have the
code:
20 + 21 + 23 + 27 = 1 + 2 + 8 + 128 = 139 = 8B
The sixth byte is generally F0, not always though. I strongly believe that this byte has
to do with fertility. Normally all squares end with F0, except Plains and Grassland,
which mostly (if not always) end with something else. |
But I don't know which values clear huts and which don't. 00H clears them, F0H don't, but others should be tested.
|
|
|  |
All times are GMT. The time now is 05:37. Apolyton Time is 00:37. |
top of page
|
| |
|
|
|
|