Results 1 to 14 of 14

Thread: Faction specific traits & completely replacing a faction

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Faction specific traits & completely replacing a faction

    Hey there

    I have a theoretical question... Let's say I want to replace every mention of Sicily in the text/xml files with Sweden and every mention of Sicilian with Swedish. Is this doable? I mean, is it going to work? Obviously, it's possible to add new factions to the game, so it should be possible to entirely replace one with another.

    There's a trait called "Fearssicily" with an antitrait named "Hatessicily". These are both editable, and I can change "Effect Combat_V_Faction_Sicily -1" to "Effect Combat_V_Faction_Sweden -1"... I think. But what about the trait's name itself? Will it still work if I change it to "Fearssweden"?

    Also, there word "Sicilian" occurs in a lot places. Is there a text file where "Sicilian" and "Sicily" are somehow connected, or is this hardcoded somehow, that anything "Sicilian" is related to the faction Sicily? That shouldn't be the case, since it would be very hard to add new factions then.

    Does anyone have experience with this, anyone who knows whether it's at all possible, or of another thread where these issues are discussed? Please help.
    Last edited by Beiss; February 26, 2009 at 04:29 PM.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  2. #2
    Moon's Avatar Centenarius
    Join Date
    Oct 2008
    Location
    The dark side
    Posts
    878

    Default Re: Faction specific traits & completely replacing a faction

    It would be far simpler to edit Data\Text\expanded.txt.strings as this is the only file you need to edit. You will need alpaca's MTW2 .strings.bin converter to change it to an editable version.

    http://www.twcenter.net/forums/downl...o=file&id=1006

    In order to use the tool above, you need to download and install Python 2.5 Windows installer, they have later versions too but this one definately works. Scroll down and find this one Python 2.5.4 (December 23, 2008)

    http://www.python.org/download

    You can only edit the text outside of the brackets, do not edit anything inside the brackets as it will cause the game to crash.
    Last edited by Moon; February 26, 2009 at 06:36 PM.

  3. #3
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Re: Faction specific traits & completely replacing a faction

    Aha. But these brackets do contain faction names a lot of the time. Does this mean that whatever uses brackets can't be used with new, added factions not already present in vanilla? I realize changing extended would be easier, but would it be at all possible to change everything? Has anyone ever tried?
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Faction specific traits & completely replacing a faction

    See my sig: Creating a World - Adding a new Faction
    It doesn't cover the traits but should otherwise give you an idea.
    Traits: you don't have to change the name of the trait (you should do it for reference purposes maybe) as long as you change the conditions.










  5. #5
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Re: Faction specific traits & completely replacing a faction

    I did read that document, but, as you said, it doesn't cover traits. I will have to convert all of the strings.bin files and see if there's another mention of the Hatessicily or Fearssicily traits in them.

    EDIT: Nope, nothing. Any chance they could be in the non-convertable strings.bin files? Are there still any CA people around that I could ask about things like this, and that might be able to send me the non-convertable files in .txt format, or has this already been done?

    EDIT2: Errr... I found these two lines in medieval2.exe (yes, the exe!): "SMALL_FACTION_LOGO_SICILY" and "FACTION_LOGO_SICILY". Talk about hardcoded.

    EDIT3: Aha! Found this in export_descr_character_traits.txt
    Code:
    Trigger hate_n_fear_15
        WhenToTest PostBattle
    
        Condition IsGeneral
              and not WonBattle
              and BattleSuccess >= clear
              and I_ConflictType Normal
              and BattleOdds >= 0.5
              and BattleOdds < 1.5
              and GeneralFoughtFaction sicily
    
        Affects Hatessicily  1  Chance  40
    This should mean this can be replaced entirely. There's one more problem though (I think):
    Code:
    ;This file is generated from the Spreadsheet VnV,txt
    ;Please modify the spreadsheet and re-xport the data, rather than editing this file directly
    What is the "Spreadsheet Vnv,txt"? What's the filename? Is it editable by mortal modders like us or do you need to be a CA god?
    Last edited by Beiss; February 27, 2009 at 05:52 PM.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Faction specific traits & completely replacing a faction

    EDIT2 refers to the lines in the data\ui\SD files. It is not hardcoded as you feared and related to the Coat of Arms of the faction.

    VnVs.txt is actually data\text\export_vnvs.txt (after converting the string.bin version with this tool)










  7. #7
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Re: Faction specific traits & completely replacing a faction

    Aha. But why would these things be mentioned in the game executable? Do you think this can still be edited in the sd files without problems or would that require editing the exe itself as well?

    About export_vnvs.txt, there is absolutely no way all of this (bolded, from export_descr_character_traits):
    Code:
    Trait Hatessicily
        Characters family
        NoGoingBackLevel  3 
        AntiTraits Fearssicily
    
        Level Dislikes_Sicilians
            Description Dislikes_Sicilians_desc
            EffectsDescription Dislikes_Sicilians_effects_desc
            Threshold  1 Effect Combat_V_Faction_Sicily  1 
    
        Level Hates_Sicilians
            Description Hates_Sicilians_desc
            EffectsDescription Hates_Sicilians_effects_desc
            Threshold  2 
    
            Effect Combat_V_Faction_Sicily  2 
    
        Level Loathes_Sicilian_Scum
            Description Loathes_Sicilian_Scum_desc
            EffectsDescription Loathes_Sicilian_Scum_effects_desc
            Threshold  4 
    
            Effect TroopMorale -1 
            Effect Combat_V_Faction_Sicily  3
    could have been generated from this (export_vnvs.txt):
    Code:
    {Hates_Sicilians}Hates Sicilians
    {Hates_Sicilians_desc}Most men deserve an honourable death, but that is because most men aren't Sicilians.
    {Hates_Sicilians_effects_desc}+2 Command when fighting against Sicilians
    Has anyone managed to convert the few strings.bin files not converted with Alpaca's tool yet? The one you linked isn't even the newest version, by the way (0.72).
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Faction specific traits & completely replacing a faction

    1. If you have read my tutorial, then you might remember the part about the Coat of Arms. That's where the SD files are mentioned which I thoughtfully provided as XML files for easier modding. (You still need both types for regeneration after modding the xml file)
    2. VnVs = Vices 'n Virtues. the first file is the description for the traits whereas the second file is the data reference file for the in-game display. They are not generated from each other, I simply think that some guru at CA has got himself a fancy spreadsheet where all the stuff is neatly linked.
    3. Download for the missing string.bin conversions
    4. Never thought it necessary to update as the converter has been working like a charm for me in that version.










  9. #9
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Re: Faction specific traits & completely replacing a faction

    1. Me lazy. Sorry. Will read it more carefully. Is there a non-modified version of these XML files (shared.sd and strategy.sd)? What about an XML version of battle.sd?
    2. Ok.
    3. I had a little trouble finding the file after clicking the download link, but I found it eventually. Thanks. But what about battle_ed.txt? I seem to already have battle.txt for some reason, but I can't find battle_ed.txt.
    4. Ok.
    Last edited by Beiss; February 28, 2009 at 11:30 AM.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Faction specific traits & completely replacing a faction

    1. You won't really need the battle.xml, but I have attached it.
    3. That's the text file for the battle editor, don't think you will need that one.










  11. #11
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Faction specific traits & completely replacing a faction

    Wait, so you just want this trait to work for your Sweden faction? Silly Beiss, you're making this way more complicated than it is.

    About the comments on the top of files. CA has spreadsheets which generate the text files that you see. These were never released to us, and the comments at the top of the file are intended to communicate to other CA Devs who may be modifying the files that they shouldn't edit them by hand. We have to edit them by hand, unless of course you know how to find the Trivium tools which EB and other mods have used to make the process infinitely easier, but I've not seen them around anywhere since the TTO disbanded some years ago.

    To answer your question, it's possible to replace every instance of a faction with another faction. Our mod doesn't have any references to the vanilla cultures or factions, with the exception of the papal_states simply because we didn't need the slot and I wanted to rule out it causing errors(but you should be able to remove it as well, SigOne has for Paeninsula Italica). Replacing a faction is no different than adding a new one, just do a search in the files in your data directory(Windows search function) for "sicily", and it should come up with 20 or so files. Just take a look at the files and cross-check with the DukeOfSerbia or gigantus tutorial, understand what it's doing, and then replace it with the faction you want. Some things like imagery you'll need to do more than edit text with, but most of it can be removed pretty easily.

    If you're making a big TC mod you might be better off using alpaca's stripped down files and building out than gradually stripping and replacing. If you're just adding Sweden to the game, and you have open faction slots, don't remove another faction and just make them unplayable and give them no cities on the campaign. Only if you have full slots should you need to directly replace Sicily with Sweden.

    As for your trait example, it should work as "Combat_V_Faction_Sweden" if you have sweden in your mod. That trait parameter like most files is dependent on the descr_sm_factions.txt for what it considers a valid faction name.

  12. #12
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Re: Faction specific traits & completely replacing a faction

    Right. So it is possible to replace every mention of Sicily with Sweden and the game should still work - I just wanted to make sure I have every file that mentions Sicily, otherwise I'm sure it won't work

    It's not just that I want to have this trait work - I really want to try to replace Sicily with Sweden in the text files, as an experiment more than anything else. The reason is I'm in a mod team where the vanilla factions haven't been replaced at all - just given new names in extended.txt, which makes things really confusing, and what I really wanted to know was whether this could be done properly. Also, I imagine that the text files should be smaller and easier to handle if all unnecessary data can be removed (e.g. units no longer used in the mod can be removed from the edu), and this should be much easier to do when everything goes by its proper name in the text files as well as elsewhere. It really is too bad the vanilla version has so many bugs in it, so that the system log is cluttered with things that aren't my fault even before I start modding. This makes it a lot harder to track down the problems I cause myself.

    Of course, once I've done all of the above, I'll need to edit the sound text files too or there won't be any sound (or at least Sweden won't have any). That I can handle on my own, however
    Last edited by Beiss; March 01, 2009 at 04:45 AM.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  13. #13
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Faction specific traits & completely replacing a faction

    Yup, it's much easier to work with when you aren't relying on Vanilla. I never even considered just renaming them, to me that's lazy and unnecessary. It only took like 3 days to strip every file down to just england/papal_state/slave + catholic/heretic + southern_european and build it back up with all the new culture, religion, and faction names and data(and then remove england). alpaca has stripped down files around here somewhere, so use them as reference for how far each file can be stripped. Many can be completely blank(guilds, traits, ancs, advice, etc.). And remember, Find+Replace is your friend for the strings files. And google Bulk Rename Utility for renaming image files en masse.

  14. #14
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,100

    Default Re: Faction specific traits & completely replacing a faction

    3 days?? I'm not going to strip them down, I'll leave that the coders on the team, but I'll find+replace the factions in the slots we're using. Gotta love notepad++. Thanks for telling me about the bulk rename utility.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

Posting Permissions

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