Results 1 to 19 of 19

Thread: Fixing Takeda Great Guard Bug

Hybrid View

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

    Default Fixing Takeda Great Guard Bug

    Sorry I'm kinda new, I used to mod Medieval total war a bit and rome but I skipped empire and napoleon and need a little help as the data is no longer in easy to edit files:::

    My problem:-

    Takeda cannot recruit either Great Guard or their faction unique Takeda Great Guard. In the faction unique entry they have Takeda Great Guard set to "true" and normal great guard set to false...

    I've not found anything in db/units*** that looks resposible for this bug

    However, I have found that db/building_units_allowed_tables is missing entries for a building to build the Takeda's version of great guard...
    If you look at the pic, this is the bottom of the file and the Takeda Great Guard are missing...



    I think all that needs to be done is to duplicate the last two lines of the building_units_allowed_table and rename the unit to cav_spear_great_guard_takeda and it will fix it.... But I don't know what the numbers are at the end... they look like unique identifiers, they could just be line entries or something... are they anything important or linked to other files... / entires elsewhere.

    Anyone know the answer?

  2. #2
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: Fixing Takeda Great Guard Bug

    The Takeda Great Guard is disabled via the scripting.lua of the campaign with a restricted record entry. Not sure why.

  3. #3

    Default Re: Fixing Takeda Great Guard Bug

    Well unfortunatly I cannot test this properly yet as I don't have a campaign save where I have the necessary tech / buildings. But I started a new campaign and tried dropping in the fix. Without the pack files, the great guard does not show up, but when the takeda.pack file is in the data folder it suggests they will be available when I upgrade...




    In pic they appear bottom left (not there if I remove the pack)

    which lua file were you referring to, in case this doesn't work...

    can someone test the attached pack...

  4. #4

    Default Re: Fixing Takeda Great Guard Bug

    I have removed this pack file as it required a second table

    this is a wip at the moment...
    Last edited by Jace11; April 17, 2011 at 03:06 PM.

  5. #5
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: Fixing Takeda Great Guard Bug

    I don't have the game installed right now, but in the data.pack, it think its somewhere like here: campaigns -> jap -> scrpting.lua

    You'll notice at the very top of the script, there is a reference to the Takeda Great Guard unit, it gets locked on the start of every campaign, so I'm unsure where in the script it is unlocked, probably when the player become Shogun.

  6. #6

    Default Re: Fixing Takeda Great Guard Bug

    it is not locked in a script

    Jace11 is correct, it is just a missing line in building_units_allowed

    but this not new, check this thread
    http://www.twcenter.net/forums/showthread.php?t=440070

  7. #7

    Default Re: Fixing Takeda Great Guard Bug

    yes, i didn't understand that when i was reading about the bug in the tech support forums. some people mentioned becoming shogunate. that is a trigger to release production...? However Tak Great Guard do NOT have a building that can produce them for Takeda in vanilla, there is no entry. Maybe the trigger fires but the error is in the building... the problem is in my game now I have the required buildings, they showed up in the pic above, but they are not available in my queue in Kai (even greyed out), then again I am nowhere near triggering shogunate so maybe I haven't fired the trigger...

    This is why I was desperate for a save game where all the conditions are met for me to work with.. I posted a request in general discussion but got no replies.

  8. #8

    Default Re: Fixing Takeda Great Guard Bug

    Right looking a the lua I'm even more confused... not because I can't work out the trigger, but because I cannot work out what CA were intending to happen here. The script restricts the Tak_Great_Guard and Mori_Nihon_Maru so they can't be made... Then you become shogun and it fires and gives you a gift of normal great guard and yari cav, and the boat? Yet every other faction is allowed to recruit great guard from level 3 stables... the restriction stops this for Takeda only. So are great guard supposed to be a single unique unit for the shogun only? or should everyone be able to recruit them and the one are gifted is just that: "an extra unit"...?

    Either way its easy to fix, either remove the restriction line and add lines to building table so everyone can recruit...
    Or add an extra limit to the restrictions stopping everyone from being able to recruit normal great cav... then the one you get given as shogun is unique
    Last edited by Jace11; April 17, 2011 at 12:11 PM.

  9. #9

    Default Re: Fixing Takeda Great Guard Bug

    also because the restriction is put in place at the start of a new campaign annoyingly I have to start a new takeda campaign again to test the fix!!! damn!! Damn!!!

    p.s

    units_to_exclusive_faction_permissions - i saw nothing wrong in this file when I looked
    units_to_groupings_military_permissions - what does this do?
    Last edited by Jace11; April 17, 2011 at 12:06 PM.

  10. #10
    Ralendil's Avatar Semisalis
    Join Date
    Oct 2005
    Location
    France
    Posts
    426

    Default Re: Fixing Takeda Great Guard Bug

    no you don't have...

    check the 2 tables I've said to you
    if the unit is not in these tables, it will never appear...

    see http://www.twcenter.net/forums/showthread.php?t=443856
    Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god.
    Jean Rostand

    Current Mod for S2TW: Sengoku Unit Cards

  11. #11

    Default Re: Fixing Takeda Great Guard Bug

    Ok i'll take a look at the units_to_groupings_military_permissions table though it worked without it...

    As it stands now...

    By removing the restriction line in scripting.lua and by adding two new lines for level 3 and level 4 stables the Takeda can now recruit Takeda Great Guard.



    I can recruit them fine, they should be unique to Takeda as the entry in units_to_exclusive_faction_permissions is correct already.

    I had to start a new campaign as having tried this approach in an old campaign that was started when the scripting.lua was:

    local function OnNewCampaignStarted(context)
    new_game = true
    becoming_shogun_advice = true
    scripting.game_interface:add_restricted_building_level_record("SHO_Port_3_Nanban_Trade_Port")
    scripting.game_interface:add_restricted_unit_record("Cav_Spear_Great_Guard_Takeda")
    scripting.game_interface:add_restricted_unit_record("Heavy_Ship_Nihon_Maru_Mori")

    They did not appear at all. Just removing the line didn't matter as it had already been written into the save game somewhere.

    When I started a new campaign on easy it did work, they appeared, can be recruited and moved etc, I haven't fought with them yet though...

    However there is still an issue. When the level 3 stable that enabled their recruitment finished, the game crashed to desktop. I reloaded and it was fine, the turn had saved, the stable was completed and Takeda Great Guard were available for recruiting but I found it worrying, as I don't know why it happened. When I went back to an old save and ran it through to complete the stables again it did not crash... very weird! but may be something to do with the table you mention.

    I have uploaded the current pack and the savegame if you want to try it... not sure if saves are compatible between players but worth a try. The save game is one turn before the building completes.
    Last edited by Jace11; April 18, 2011 at 10:41 PM.

  12. #12

    Default Re: Fixing Takeda Great Guard Bug

    units_to_groupings_military_permissions

    I've looked at it. It doesn't contain unique units...??? There are no Date No dachi, no chosokabe bows, so i'm not sure its as relevant as the faction permissions. As for the unexplained crash, I can't recreate it. My game isn't completely stable so could have been erronious

    Btw this fix, while now working will only affect new campaigns then, not old ones... maybe you can use the esf / save editor to find the offending line and remove it. havent looked into that...
    Last edited by Jace11; April 17, 2011 at 03:28 PM.

  13. #13
    Ralendil's Avatar Semisalis
    Join Date
    Oct 2005
    Location
    France
    Posts
    426

    Default Re: Fixing Takeda Great Guard Bug

    You need to modify these 3 tables:
    building_units_allowed_table
    units_to_groupings_military_permissions
    units_to_exclusive_faction_permissions
    Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god.
    Jean Rostand

    Current Mod for S2TW: Sengoku Unit Cards

  14. #14
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: Fixing Takeda Great Guard Bug

    You are correct in assuming that the scripting.lua gets saved into ESF when saving, hence why you need to start a new campaign for all mods that alter scripting. I'v never seen the actual scripting within the savegame anywhere, at least not looking in the ESF editor, perhaps the ESF2XML can display it.

    Anyway, good job.

  15. #15

    Default Re: Fixing Takeda Great Guard Bug

    Quote Originally Posted by .Mitch. View Post
    You are correct in assuming that the scripting.lua gets saved into ESF when saving
    It doesn't (or at least didn't for etw/ntw), the only things that gets saved to the esf are the variables explicitly saved. You can't see it with the esf editor because it's not there. The scripting file is loaded at runtime, so you can exit to the main menu, make changes, resume your campaign and your changes will take effect. At least in etw/ntw.
    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

  16. #16
    Ralendil's Avatar Semisalis
    Join Date
    Oct 2005
    Location
    France
    Posts
    426

    Default Re: Fixing Takeda Great Guard Bug

    my god, I feel stupid now ^^

    Glad you finally did it
    good work Jace11
    Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god.
    Jean Rostand

    Current Mod for S2TW: Sengoku Unit Cards

  17. #17

    Default Re: Fixing Takeda Great Guard Bug

    Where is teh download fix link??

  18. #18

    Default Re: Fixing Takeda Great Guard Bug

    So did anyone actually manage to turn Great Guard recruitment back on for the Takeda Clan?

  19. #19

    Default Re: Fixing Takeda Great Guard Bug

    The encyclopeadia entry for the Takeda Great Guard is gone in latest patch? I guess they have been removed on purpose...

Posting Permissions

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