Harvest Moon - A new beginning => Scripts etc in Plain Text

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by ChrisX930, Feb 26, 2015.

  1. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Hey Guys,

    right now, I wanted to get a 3d-Banner (cgfx?) to test it for a Homebrew and I decided to decrypt "Harvest Moon - A new beginning" for it to get a example.
    But now, I found many MAAAANY ".nut"-files in the decrypted romfs.
    the nut-files are all scripts of this game in Plain Text, which means, I'm able to edit ANYTHING code-related of the game (which is fantastic!) :D

    Here's a example:

    [​IMG]
    [​IMG]




    I Just wanted to share this with you :)
     


  2. Sliter

    Sliter GBAtemp Addict

    Member
    2,990
    781
    Dec 7, 2013
    Brazil
    ᕕ( ᐛ )ᕗ
    looks interesting :v so the gae is easly moddable with this: like chaging npc place and texts?
     
    Margen67 likes this.
  3. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    yes, that should be possible.
    There are more interesting things in the files, like this:
    Code:
    PlayerMoney <- {
        Init = 500,
    }
    or

    Code:
    //    アバターのデフォルト設定(男)
    PlayerAvatarDefaultBoy <- {
        Body = "M_UNIFORM_1",
        Head = "PLAYER_HEAD_0",
        Hair = "M_HAIR_FARM_STYLE",
        EyeColor = 0,
        HairColor = 0,
        EyeShape = 0,
        Skin = 0,
    }
    or Spawning Locations of Items
    Code:
    function InitFieldItemAdvanced()
    {
        InitFieldItemCommon()
     
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_1", 6, 95.80, -185, 5, 1 );//森マップ
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_STONE_1", 80, 95.80, -146, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_STONE_1", 145, 56.79, 89, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_MOON_DROP", 90, 56.79, 40, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_MOON_DROP", 31, 56.79, 31, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_1", -40, 56.79, 23, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_1", -45, 56.79, 40, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_STONE_2", -27, 56.79, -80, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_3", 200, 0.79, 167, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_STONE_3", 211, 56.79, -17, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_STONE_3", 175, 59.71, 25, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_2", -300, 30.79, -4, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_2", -103, 12.51, 28, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_1", -145, 12.51, 58, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_MOON_DROP", -142, 12.51, 102, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_3", -98, 0.79, 200, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_MOON_DROP", -212, 0.80, 254, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_3", 64, 0.79, 214, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_BRANCH_2", 36, 0.79, 224, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_STONE_3", 225, 0.79, 200, 5, 1 );
        FieldItemManager.Get().Place(FieldData.GetID("MAP_FOREST"), "ITEM_MOON_DROP", -24.18, 56.79, 32.59, 5, 1 );

    also I found the Shop-Items
    Code:
    function InitShopCommon() {
     
        //雑貨屋
    /*    ShopData.AddShopItem("SHOP_ITEM_ONION_SEED");
        ShopData.AddShopItem("SHOP_ITEM_TOMATE_SEED");
        ShopData.AddShopItem("SHOP_ITEM_SPINACH_SEED");
        ShopData.AddShopItem("SHOP_ITEM_CARROT_SEED");
        ShopData.AddShopItem("SHOP_ITEM_WHITE_RADISH_SEED");
        ShopData.AddShopItem("SHOP_ITEM_BROCCOLI_SEED");
        ShopData.AddShopItem("SHOP_ITEM_SUN_FLOWER_SEED");
        ShopData.AddShopItem("SHOP_ITEM_RED_ROSE_SEED");
        ShopData.AddShopItem("SHOP_ITEM_PINK_SEED");
        ShopData.AddShopItem("SHOP_ITEM_SNOWDROP_SEED");
    */    ShopData.AddShopItem("SHOP_ITEM_FOOD_GRAPE_WINE");
        ShopData.AddShopItem("SHOP_ITEM_RISE");
        ShopData.AddShopItem("SHOP_ITEM_RISE_FLOUR");
        ShopData.AddShopItem("SHOP_ITEM_FLOUR");
        ShopData.AddShopItem("SHOP_ITEM_BREAD_FLOUR");
        ShopData.AddShopItem("SHOP_ITEM_OIL");
        ShopData.AddShopItem("SHOP_ITEM_SPICE");
        ShopData.AddShopItem("SHOP_ITEM_CURRY_FLOUR");
        ShopData.AddShopItem("SHOP_ITEM_COFFEE_PACK");
        ShopData.AddShopItem("SHOP_ITEM_COCOA_PACK");
        ShopData.AddShopItem("SHOP_ITEM_TORYUFU");
     
    Margen67 and Sliter like this.
  4. SonicHyuga

    SonicHyuga Member

    Newcomer
    36
    32
    Jan 10, 2015
    United States
    Back when this game released I ran into a lot of this: (phone quality incoming)

    Warning: Spoilers inside!

    It looked like this game used basic HTML, now I see I wasn't too far off from that assumption...
     
    Margen67 likes this.
  5. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany

    I had this too ^^
    Yea, the Strings seems to be saved in the xbb-file "Msg.xbb".
    the xbb seems to be a compressed, not strong encrypted file format, but I'm not able to decompress it (because idk how to do it).
    Is there someone who can handle this for me?
     
    Margen67 likes this.
  6. nosklo

    nosklo Member

    Newcomer
    49
    14
    Oct 16, 2010
    Brazil
    Hmm very interesting. Maybe we could write a tool to convert rpgmaker-style games into animal crossing mods?
     
    Margen67 likes this.
  7. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Harvest Moon =/= Animal Crossing, lol xD
    But yea, I thing I should be able to create something own with it when i know how to decompress the xbb files :)

    Additional Info:
    The Code seems to be in Squirrel Language
     
    Margen67 likes this.
  8. Gryphon93

    Gryphon93 GBAtemp Regular

    Member
    145
    13
    Nov 30, 2008
    Hm... Interesting. It seems like the scripts for the game is written in Squirrel (http://www.squirrel-lang.org). That's my guess based on the syntax and the file extension. I love it when developers do things like this. It makes it really fun to go through the contents of the game. Nice work finding it, ChrisX930!

    I've kind of reverse engineered the XBB file format back when HM: IoH came out. I made a small tool in Ruby which extracted files from the XBB file, but it can't put it back together (even though it's a pretty straight forward job). The format is simple, but I haven't figured out what type of compression (I assume the data is compressed) is used for the files in the XBB file. I don't have much time to work on a proper tool right now, even though I promised another GBATemp member I would create one last summer... Anyways, if you have some programming skills you will easily be able to put a simple un-/packer together. The format is quite simple, as I mentioned earlier.

    [Edit: I assume the format is the same in HM: AnB as it was in HM: IoH and HM: SI, but I don't know]
    [Edit 2: I didn't see that you already had mentioned Squirrel in your previous post. Sorry about that.]
     
    Margen67 and ChrisX930 like this.
  9. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany

    Thank you for the answer :)
    I'm already trying to write some un-/packer and I hope I get it to work :)
     
    Margen67 likes this.
  10. Gryphon93

    Gryphon93 GBAtemp Regular

    Member
    145
    13
    Nov 30, 2008
    If you need the "documentation" I will gladly share it with you. I don't remember if it is totally up-to-date though.
     
    Margen67 likes this.
  11. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Would be cool :)
     
    Margen67 likes this.
  12. Gryphon93

    Gryphon93 GBAtemp Regular

    Member
    145
    13
    Nov 30, 2008
    Margen67, RainThunder and ChrisX930 like this.
  13. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Margen67 likes this.
  14. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Okay, I have one more Question!

    I've modified some thing in the code and want to rebuild the rom. How to do it exactly?
     
    Margen67 likes this.
  15. Wekker

    Wekker GBAtemp Fan

    Member
    382
    68
    Aug 4, 2007
    Netherlands
    haha, the comment are in japanese xD
     
  16. Sliter

    Sliter GBAtemp Addict

    Member
    2,990
    781
    Dec 7, 2013
    Brazil
    ᕕ( ᐛ )ᕗ
    oh the chgaracter visual, it's awesome xD we can make an character apearence editor o3o(or this have to be done on the save file?)
     
  17. andibad

    andibad Soon™

    Member
    701
    90
    Sep 14, 2009
    Indonesia
    hospital
    xbb file is not compressed, is plain archive format without any compression on 3ds version (not like on ds, is compressed on second generation of engine). is same as xbb format on Island of Hapiness format , but is have extra byte on it. most of text is stored on Msg.xbb, but name of item/character/etc is stored on individual file on data setting iirc, and is stored on special format pp (magic header : PAPA)

    you can check it on https://gist.github.com/andibadra/2632d06a7066224ae08d#file-9_format_xbb_3ds-md .
     
  18. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Finally I got it to work to rebuild the romfs.bin AND the rom with changes on the scripts!
    Here's a example that shows new options in the male avatar creation! (added female options to it)

    [​IMG]
     
    Margen67 and king_leo like this.
  19. king_leo

    king_leo Real Hero

    Member
    827
    619
    Sep 12, 2009
    De RigueurMortis
    Can you give the Girl or Guy clothes from other characters? Like use the body id of the harvest goddess or something.
     
    Margen67 likes this.
  20. ChrisX930
    OP

    ChrisX930 Banned

    Banned
    788
    317
    Sep 3, 2013
    Gambia, The
    Germany
    Sure, it should possible!
    I only need to find the right values for it (ID of Harvest Goddess Body)
     
    Margen67 and king_leo like this.