Page 1 of 6 123456 LastLast
Results 1 to 20 of 103

Thread: Unit editing with Hexeditor

  1. #1

    Default Unit editing with Hexeditor

    This is my first tutorial and it will teach you how to edit the stats of the units like upkeep, armor, attack, number of soldiers and so on.


    Requirements

    PFM 1.5.9 or newer
    A Hexeditor like HxD http://mh-nexus.de/en/hxd/
    The Knowledge to make mods with PFM


    The First steps would be to get these tools.
    Then you need to unpack the files you want to edit like units_tables and unit_stats_land.

    Editing units table

    In this example we change the upkeep of the Hattori Katana Samurai

    Open HxD or a similar programm and load the units file.
    This will look like this



    Then you need to find the unit you are looking for.
    In this case I'am going to edit the upkeep of the Hattori Katana Samurai
    Go to the search tab and and enter and select Hexvalues
    48006100740074006F00720069 which means
    H.a.t.t.o.r.i



    Then search until you find this



    As we know the Hattori Katana Samurai have a upkeep cost of 200.
    So lets convert 200 to hex which equals C8
    If you dont know how to do it use this site
    http://www.statman.info/conversions/hexadecimal.html



    So when you change this to lets say 150 which means 96 in hex


    Save the file and insert it in your modpack


    Editing unit stats land

    Lets continue editing the units. In this example we will change again the Hattori Katana Samurai.
    Open unit_stats_land and search for the following lines. You need to know where the according values are in order to change them.
    So I made this pic to help you locating the according values




    Update

    As requested I will show you how to edit Reloading Skill, Precision and Ammo.
    In this example I took the Takeda Bow Cavalry as I can show almost every stat in this unit.



    Until now this is the only method of changing the stats which will be obsolete when a PFM or DBEditor for Shogun is released.
    I will update this tutorial if requested and please tell me any grammatical error via PM to make this more readable
    Last edited by Agostinos; March 20, 2011 at 04:43 PM.
    Don't smoke the seed

  2. #2

    Default Re: Unit editing with Hexeditor

    Thanks a lot my friend, this is very helpful

  3. #3

    Default Re: Unit editing with Hexeditor

    Thx for this tool Agostinos

  4. #4

    Default Re: Unit editing with Hexeditor

    Thank You a very well written and demonstrated tutorial - the links r a big + too.

  5. #5

    Icon7 Re: Unit editing with Hexeditor

    Thank you, very usefull.

    I've done some changes but I see no changes in the "Encyclopeadia". They units have been changes but not their description. Is this normal?
    Last edited by Gi@nnis; March 19, 2011 at 10:05 PM.

  6. #6

    Default Re: Unit editing with Hexeditor

    Quote Originally Posted by Gi@nnis View Post
    Thank you, very usefull.

    I've done some changes but I see no changes in the "Encyclopeadia". They units have been changes but not there description. Is this normal?
    The encyclopedia is not connected to the game.

  7. #7

    Default Re: Unit editing with Hexeditor

    Nice tutorial!

  8. #8

  9. #9

    Default Re: Unit editing with Hexeditor

    Quote Originally Posted by Swiss Halberdier View Post
    Thanks Agostinos for your useful tutorial! I remember the "old" DOS and HEX days. +rep
    Thanks mate
    Yeah the good old HEX days. Actually I used this method already on Empire to edit units when there wasn't a PFM or DBEditor.
    Don't smoke the seed

  10. #10

    Default Re: Unit editing with Hexeditor

    hello~is there anyway change unit build time?? or art technological time? thanks

  11. #11

    Default Re: Unit editing with Hexeditor

    Great tutorial Agostinos. One question, how did you link values to the hex values? Just by knowing the upkeep was 200, you tried changing that value and then checked in game to confirm?

    I ask because I am editing faction_uniform_colours and the values don't seem to add up to what I would expect. Case in point -

    Under Chosokabe, there are 6 values from what I can determine. This would make sense given the 3 RGB color values for each section on the units. They are FFF4B5 and AAFF10 which would be 255,244,181 and 170, 255, 16. When I view those colors in an image editor, they don't match with any color of Chosokabe. Changing them didn't seem to have an effect in game either (although that could be my misunderstanding of creating pack files which I'll research more.)

    Attachment 150213Attachment 150214

  12. #12

    Default Re: Unit editing with Hexeditor

    I'm try to edit some unit however it isnt working , there must be something wrong in my process

    I'm using a stream retail version and windows 7
    here is my process

    1. download PFM from http://www.twcenter.net/forums/showthread.php?t=433370
    2. run PFM and open data.pack
    3. extract unit_table and unit_stats_land then close PFM
    (I got 2 files somewhere/db/unit_table/unit_table and somewhere/db/unit_stats_land /unit_stats_land )
    4. edit those files with hex workshop then save (unit cost , upkeep , accuracy , armor and something else )
    5. Open PFM , click new , r-click at left frame then choose insert directory then choose somewhere/db
    (so i have untitled.pack ->db -> unit_table->unit_table and untitled.pack ->db ->unit_stats_land->unit_stats_land)
    6. click save as then named "mymod.pack" and place it in SGTWdirectory/data/

    as I mention above my mod is not working
    seem like I've missed some step but I dont know what I've missed
    please help , thank you

  13. #13
    izanagi11's Avatar Semisalis
    Join Date
    Jul 2006
    Location
    Chicago, IL
    Posts
    417

    Default Re: Unit editing with Hexeditor

    Quote Originally Posted by Nazathal View Post
    I'm try to edit some unit however it isnt working , there must be something wrong in my process

    I'm using a stream retail version and windows 7
    here is my process

    1. download PFM from http://www.twcenter.net/forums/showthread.php?t=433370
    2. run PFM and open data.pack
    3. extract unit_table and unit_stats_land then close PFM
    (I got 2 files somewhere/db/unit_table/unit_table and somewhere/db/unit_stats_land /unit_stats_land )
    4. edit those files with hex workshop then save (unit cost , upkeep , accuracy , armor and something else )
    5. Open PFM , click new , r-click at left frame then choose insert directory then choose somewhere/db
    (so i have untitled.pack ->db -> unit_table->unit_table and untitled.pack ->db ->unit_stats_land->unit_stats_land)
    6. click save as then named "mymod.pack" and place it in SGTWdirectory/data/

    as I mention above my mod is not working
    seem like I've missed some step but I dont know what I've missed
    please help , thank you
    2. You want to grab the units and unit_stats_land from patch2.pack now, since they are the latest available.
    5. It is best to rename your units file to something different to the original name like "mymod_units" and "mymod_unit_stats_land" for compatible issues.
    6. Did you save the "mymod.pack" as a pack type movie? right click on pack-> change pack type-> movie or follow http://www.twcenter.net/forums/showthread.php?t=340047 to setup your mod.pack?
    "The shape of you, the shape of me, the shape of everything I see.."

  14. #14
    izanagi11's Avatar Semisalis
    Join Date
    Jul 2006
    Location
    Chicago, IL
    Posts
    417

    Default Re: Unit editing with Hexeditor

    Quote Originally Posted by Agostinos View Post
    Thanks mate
    Yeah the good old HEX days. Actually I used this method already on Empire to edit units when there wasn't a PFM or DBEditor.
    That was long and painful a few years back!
    "The shape of you, the shape of me, the shape of everything I see.."

  15. #15

    Default Re: Unit editing with Hexeditor

    oh patch2.pack havent notice that file
    seem like I have to rename some and save pack type as movie ... okay
    now reading http://www.twcenter.net/forums/showthread.php?t=340047
    I'll try those when I reach my home and see how will it workout
    Thank you

  16. #16

    Default Re: Unit editing with Hexeditor

    Quote Originally Posted by Zane View Post
    Great tutorial Agostinos. One question, how did you link values to the hex values? Just by knowing the upkeep was 200, you tried changing that value and then checked in game to confirm?

    I ask because I am editing faction_uniform_colours and the values don't seem to add up to what I would expect. Case in point -

    Under Chosokabe, there are 6 values from what I can determine. This would make sense given the 3 RGB color values for each section on the units. They are FFF4B5 and AAFF10 which would be 255,244,181 and 170, 255, 16. When I view those colors in an image editor, they don't match with any color of Chosokabe. Changing them didn't seem to have an effect in game either (although that could be my misunderstanding of creating pack files which I'll research more.)

    Attachment 150213Attachment 150214
    To answer your question:
    I already knew where each file should be as I already modded Empire back then with this method. I expected no big changes. Then I searched for the values in a entry of a unit. If there where more matches then I compared this to another unit and looked if there is only on match for the value. Hope you understand what I mean its hard to describe for me in english

    To solve your problem (hopefully):
    I strongly guess that these are the right values. You most likely made an error when you created your modpack. Make sure you saved it as movie to see the changes ingame
    Last edited by Agostinos; March 21, 2011 at 12:01 AM.
    Don't smoke the seed

  17. #17

    Default Re: Unit editing with Hexeditor

    Makes sense to me. Thanks! I figured out the color values by trial and error.

  18. #18

    Default Re: Unit editing with Hexeditor

    ok, I think I'm just trying to count the hexes for this and not doing it right or something, but I'm trying to edit the hattori kisho ninja and for the life of me I can't figure out where its throwing knives and ammo/accuracy/reload are.

    Also, have you found where recruit cost, turns to produce, bonus vs cavalry, range, or speed are?

    P.S.: I've edited a lot of other things for it, such as unit size and upkeep. Does the game not show those changes even when you're just looking at the unit card, not the dictionary, or did I goof up? >_>

    thanks in advance ^^

    edit: i think the PS part is because i wasn't modding the units in the patch2 either. will try that ^^ my mistake! -- though i still can't figure out the rest, although im pretty sure ee02 is cost in "Units" file
    Last edited by Rubeus; March 21, 2011 at 12:22 AM.

  19. #19

    Default Re: Unit editing with Hexeditor

    Yep great tutorial Agostinus

    Every1 should try hex editing if just so they appreciate more the Mod Tools that we have been lucky enough to have made for us by selfless individuals (previously and wip atm)

    so we dont have to hex edit.

  20. #20

    Default Re: Unit editing with Hexeditor

    Quote Originally Posted by Rubeus View Post
    ok, I think I'm just trying to count the hexes for this and not doing it right or something, but I'm trying to edit the hattori kisho ninja and for the life of me I can't figure out where its throwing knives and ammo/accuracy/reload are.

    Also, have you found where recruit cost, turns to produce, bonus vs cavalry, range, or speed are?

    P.S.: I've edited a lot of other things for it, such as unit size and upkeep. Does the game not show those changes even when you're just looking at the unit card, not the dictionary, or did I goof up? >_>

    thanks in advance ^^

    edit: i think the PS part is because i wasn't modding the units in the patch2 either. will try that ^^ my mistake! -- though i still can't figure out the rest, although im pretty sure ee02 is cost in "Units" file
    Quite much to answer
    Actually I dont know about the ninja part as I never edited ninjas. I will take a look at it.
    Again I guess that you didn't save your modpack properly. Save it as movie format. If you dont what this check out some tutorials for making mods in empire or napoleon. This tutorial requires the knowledge of making mods and there already some good tuts.
    Yes ee02 are the costs. If you want to change it for example to 500 try f401
    Don't smoke the seed

Page 1 of 6 123456 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •