Results 1 to 17 of 17

Thread: Editing starting money & "king's purse" succesfully

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Icon7 Editing starting money & "king's purse" succesfully

    Hello,

    I am an quite experienced modder with the TW series, though I didn't try it on NTW, so I am a bit confused now.

    So, I am trying to mod the starting money in S2TW and particularily the Shimazu faction's.
    I have used the ESF editors provided in the tools section, but I can't seem to be able to save the changes that I have made in startpos.esf -file that I extracted from data.pack -file to use in the game.

    So do I need to create a new pack file or wait for another ESF -editor to make the changes succesfully?
    The ESF editor that I use right now is the latest version 1.4.8 but it keeps giving me errors whenever I try to save the changes I made to FACTION_ECONOMICS (changing the starting wealth from 2000 to 200000).

    Another question is that there used to be in the earlier TW series games' descr_strat -file a thing called "king's purse" that was used to buff the faction's economics. I plowed through the ingame economics screens and there seems to be (at least in the Shimazu-clan's) an "other" income source described as "Clan funds" which gives 1200 per turn. So I would like to be able to edit that, but I can't seem to find anything that is related to my faction and has the value 1200.

    Any help would be appreciated, thanks!

  2. #2

    Default Re: Editing starting money & "king's purse" succesfully

    Got the same pb.Successfully extract the .esf but when i want to replace in the .pack file it give me error.

  3. #3

    Default Re: Editing starting money & "king's purse" succesfully

    Add this code in your scripting.lua somewhere empty (ie not inside another function). It will add 200000 cash on the players first turn. It's easy to understand, you could customise it yourself.
    Code:
    events.FactionTurnStart[#events.FactionTurnStart+1] = function(context)
    	if CampaignUI.IsPlayersTurn() == true and conditions.TurnNumber(context) == 1 then
    		effect.adjust_treasury(200000, context)
    	end
    end
    Or just wait until it can be done with an esf editor.
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell

  4. #4

    Default Re: Editing starting money & "king's purse" succesfully

    NEVERMIND I GOT IT TO WORK, thanks! Keeping the original message here for someone else who isn't sure about this scripting:


    Thanks to you T.C., almost there now. I've unpacked the .lua from the pack-file, and made the changes NOT inside another function, but how do I tell the game to use the new .lua -file?
    Should it do it automatically? If it should, it didn't work.

    I am keeping the file in ...\SteamApps\common\total war shogun 2\data\campaigns\jap_shogun

    should I do that or make some changes somewhere? Like in modding Dawn of War 2 you have to put "-dev" to the launch options when you launch the game.

    Though I code sql for work, this is hard! : D




    I got it to work putting the script T.C. provided to the END of the file scripting.lua (not first...)
    Last edited by Dominator131; March 15, 2011 at 03:42 PM.

  5. #5

    Default Re: Editing starting money & "king's purse" succesfully

    Quote Originally Posted by Dominator131 View Post
    Though I code sql for work, this is hard! : D
    Hopefully we'll have no syntax errors then, that's half the problem with getting scripting changes working over a thread

    If you have it left sitting in that folder it should load it without overwriting any vanilla files (99% sure it will).
    If it doesn't, you'll have to create a new mod pack so as not to overwrite vanilla files. I can't offer you any help with that as I'm not sure how up to date the tools are and I still haven't got the game.
    You don't need to append the file itself for this to work, so no worries there

    EDIT: Ok that's obviously worked.
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell

  6. #6

    Default Re: Editing starting money & "king's purse" succesfully

    Hi, I am completely new with modding. Can you please guide me step by step on how to do that? Much appreciated, thanks

  7. #7
    FreeMayk's Avatar Foederatus
    Join Date
    Sep 2008
    Location
    Србија
    Posts
    39

    Default Re: Editing starting money & "king's purse" succesfully

    Quote Originally Posted by soheisohei View Post
    Hi, I am completely new with modding. Can you please guide me step by step on how to do that? Much appreciated, thanks
    Same here...
    I need some guide, step by step, how to mod my empire to have more gold...

  8. #8

    Default Re: Editing starting money & "king's purse" succesfully

    Quote Originally Posted by T.C. View Post
    Add this code in your scripting.lua somewhere empty (ie not inside another function). It will add 200000 cash on the players first turn. It's easy to understand, you could customise it yourself.
    Code:
    events.FactionTurnStart[#events.FactionTurnStart+1] = function(context)
        if CampaignUI.IsPlayersTurn() == true and conditions.TurnNumber(context) == 1 then
            effect.adjust_treasury(200000, context)
        end
    end
    Or just wait until it can be done with an esf editor.
    Hi T.C
    is there any way to do this from a specific turn, for example, im on about turn 30 in my Date campaign atm, so can i script it to give me a nice "lump" sum or even affect my kings purse from turn 31? or will it not take effect and/or corrupt my savegames?

    thx in advance mate
    Last edited by night_0wl; March 22, 2011 at 12:25 AM.

  9. #9

    Default Re: Editing starting money & "king's purse" succesfully

    Any suggestions how to add some units with certain experience level?

    I suppose this can be done in 2 ways, but I can't understand the syntax of command to add experience:
    1. grant_unit:<Unit_name>#capital
    2. scripting.game_interface:create_force etc.

    Also, is there any way for instant activation of script in the game?
    Last edited by Rodrigo The Scarred; March 18, 2011 at 07:22 AM.

  10. #10

    Default Re: Editing starting money & "king's purse" succesfully

    Quote Originally Posted by General111 View Post
    I just checked again and any money modification script casing crash (both TC and husserlTW script)
    but it happend sometimes even without any modification, so maybe its a bug?
    Post the script here, I'll take a look at it.

    I'm going to open up a script-o-rama for S2 soon enough, there'll be lots of advice for getting started with scripting in it. In the mean time, take a look at the NTW script-o-rama. 95% of it's content is still relevant
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell

  11. #11
    Big Pacha's Avatar Campidoctor
    Join Date
    Dec 2008
    Location
    Now in Brussels, Belgium
    Posts
    1,789

    Icon3 Re: Editing starting money & "king's purse" succesfully

    Way more simple thx to mendoksou

    1 Open your new game
    2 Save it
    3 Edit the .save file with the 1.4.6 ESF Editor updated for Shogun 2
    4 Make your changes, Faction_Economics same as in ETW & NTW (+backup of course)
    5 Reload it & crush your enemies!

    This is no rocket science.






  12. #12

    Default Re: Editing starting money & "king's purse" succesfully

    Hello, dear fellows, although I am a Newbie in hard modding any pack files I see some chance for a workaround and I am using my latest Hex Workshop Editor version to modify some entries for my start faction.
    As I often experienced with other games there exists eventually some limitations for any number higher than 32000 Gold as I thought. So I give my Hattori Clan simply 32000 Gold to start with.

    How do you can do it?? Its simple: Load your Start Campaign Savegame.Open the Base Converter Tool and set it on Short and make the following entry if you start on easy Campaign level. Look for the Hex Value for 4000 Gold then if you found it with the related Find option inside the Edit Tab you should only be interested in the first two entries sofar. Now change the decimal entry inside the Base Converter to 32000 and then read the hex value. Now put this value as new entry instead of the old 4000 Gold related Hex Values. Now save the file.
    After this action you can start again Shogun and and load the Start Savegame...And voilá there must be around 32000 Gold in your clan pockets.

    I personally looking for a possibility to either implement the legendary Hattori Hanzo as a young four-star general with some decent Skill points in Reserve to spread in his character tree. But I do not know how I can make that possible.
    Additionally I want to give my starting clan some five well-experienced Koshi Ninjas under the Command of Hattori Hanzo.
    If anyone knows some workaround for that like implementing a totally new general with better experience and some unspread skillpoints and with around five Units under his Command and with a Koshi Ninja Unit as his personal bodyguard, I would be very happy...

    greetings

    Hohenlohe
    I think that I am still living in the wrong timeline...

  13. #13

    Default Re: Editing starting money & "king's purse" succesfully

    Quote Originally Posted by Big Pacha View Post
    Way more simple thx to mendoksou

    1 Open your new game
    2 Save it
    3 Edit the .save file with the 1.4.6 ESF Editor updated for Shogun 2
    4 Make your changes, Faction_Economics same as in ETW & NTW (+backup of course)
    5 Reload it & crush your enemies!

    This is no rocket science.
    Im new with these mod changes, so can i ask you on what to do when i get to faction_economics? i go into Faction_economic > History > then Economics data and in the values all i see are system.Byte[]
    any tips?

Posting Permissions

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