Results 1 to 12 of 12

Thread: The Mysterious New Faction Problem

  1. #1

    Icon4 The Mysterious New Faction Problem

    Hi everyone, I'd like to put a question to you here as it encompasses a lot of M2TW modding.

    This is my situation: I'm adding a faction to my mod, following DukeOfSerbia and Gigantus's guides. I've done this 5 times already without any problems. I'm basing it on 'france' and, to make it slightly easier to manually add their units to modeldb, I gave this faction the internal name of 'franks'. I'm on Mac so error logs are unavailable to me, but I have some experience with this.
    But, instead of working fine like the 5 times I did this before, this faction is a huge pain to add. I've restarted at least 3 or 4 times and every time I end up with the same problem: CTD at the start.

    Yesterday I finally get a breakthrough! The game opens, the faction is available on custom battles and in the campaign selection screen. However: campaigns get kicked back to menu and custom battles (with AND without the new 'franks' faction) give a full-on CTD.


    I check out all of the files and I find a weird mistake in descr_character.txt! The file starts with 'franks', thereby messing up the whole file and 'disabling' it, so to say.
    I'm elated, I've finally found out what the problem is, I correct it and start the game. Immediate CTD.

    Can't even open the game anymore. Uuugh.


    So I try removing the new faction's entries from descr_character.txt again. Game starts, everything seems normal, except the campaign now CTDs (which is to be expected, after all: the new faction doesn't have any models!). Custom battles work fine if the new faction isn't involved, obviously. If the faction is involved, CTD. This is also to be expected due to captains being references in descr_character.txt


    So what does this mean? I'm assuming something is wrong with the new faction's entries in descr_character? But I've gone over those entries countless times and all they do is copy the entries for 'france' exactly.
    My questions are: 1. has anyone ever had this before? 2. what are all the files that descr_character references? I can think of only modeldb and descr_model_strat. However, mistakes in modeldb result in an immediate ctd at the start, so that can't be it. The new faction has been added to modeldb fully (in the sense that it has all the units the 'france' faction has.


    The cool thing is that now I've got a pretty specific set of files that MUST be the culprit, the weird thing is that it's still a mystery!
    I'm going a bit crazy over this thing, so much so that even the ever-helpful Gigantus told me to step away from it for a day or two! But I'm so close now I can taste victory. Besides, I'm going on vacation and I actually don't want to bring my laptop to distract me =)

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: The Mysterious New Faction Problem

    In Windows you occasionally have the issue that for some weird reason the EOL format changes from windows (CR LF) to Unix (LF) or Mac (CR). It's not visible unless you use an editor like Notepad++ where you trigger the display of those End Of Line symbols plus it lists the format at the bottom of the editor window. Conversely it allows you to change\reapply that format for the whole file so correcting that issue is relatively simple - once you have identified it.

    Typewriter references here:
    CR = carriage return (moving back to the left)
    LF = line feed (new line)
    Last edited by Gigantus; October 23, 2021 at 04:00 AM.










  3. #3

    Default Re: The Mysterious New Faction Problem

    Hey, thanks. Yes, that's something I'm acutely aware of, therefore all my newer entries in, for example, descr_character look like this.

    Code:
    faction			franks
    
    dictionary		2
    
    
    strat_model		IB2_frankish_general
    
    
    strat_model		viking_general
    
    
    strat_model		general_welsh
    
    
    strat_model		elderlyking
    
    
    battle_model	germanic_nobles
    
    
    battle_equip	gladius, chainmail shirt helmet and rectangular shield
    I'm transitioning to a program called 'Visual Studio Code' which does show the EOL stuff.

    I'm pretty sure it's not that, since all the entries in descr_model_strat and sm_factions, are also in this format.

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: The Mysterious New Faction Problem

    The EOL issue usually appears only in a few lines which makes it difficult to spot - but it stops the game from processing the file further, ultimately leading to a crash. I would recommend to convert the whole content\file to Mac or Unix EOL and then convert it back to windows\DOS to rule out the issue.
    Last edited by Gigantus; October 23, 2021 at 06:22 AM.










  5. #5

    Default Re: The Mysterious New Faction Problem

    I've gone over the descr_character, descr_model_strat and modeldb. EOL issues are resolved...

    When I 'disable' descr_character.txt by adding an incorrect first line (this was what I did by accident) I can open the game, see the custom battle menu, go to the campaign faction selection menu but I can't start a battle, that CTDs and I can't start a campaign, that kicks to menu (which is weird!).
    And when I delete the lines referencing this new faction ('franks') from descr_character I can start the game, can do custom battles (if the new faction isn't present) and I get a CTD when I start a campaign.
    When I enter all the relevant references to this new faction in descr_character I can't do anything, the game CTDs after a few seconds of loading screen.

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: The Mysterious New Faction Problem

    Technically you should be able to start a campaign if you only add a 'franks' entry in descr_characters for named character (clone an entry and then clone a faction line for the strat model in descr_model_strat) and restrict the faction to one named character in descr_strat.

    If that works then start adding entries in descr_characters and their counter parts in descr_model_strat in small steps. It could be a simple case of being 'blind' to a minor typo as the mind auto corrects small errors when reading. I had a case once where I kept inverting a letter sequence of two letters that were next to each other on the keyboard, eg r and t. Took a while until the 'dooooh' moment. No more fancy data names from then on for me.










  7. #7

    Default Re: The Mysterious New Faction Problem

    Did you follow the guidelines about how to add new factions into the game on twcenter.net UrienRheged?

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: The Mysterious New Faction Problem

    The duke's and mine, see OP.










  9. #9

    Default Re: The Mysterious New Faction Problem

    Guys! Guys! I found the problem!

    There were a couple of duplicated entries in the admiral section, so when I added mine it went over the limit of 31 (I didn't know that descr_character had that limit too, maybe this can be added to a guide or was I just being an idiot?) and gave a CTD.
    30th faction fully implemented now, and I'm gonna add the 31st as soon as possible. Thank you all so much for the patience and good advice.

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: The Mysterious New Faction Problem

    Well, I suppose it is taken as given as there can only be 31 factions and each faction can have only one entry per agent. Duplicates are usually a sign of disrupted\discontinued work, eg preparation for cloning, so be on the lookout.










  11. #11

    Default Re: The Mysterious New Faction Problem

    Yeah it makes sense, but I didn't read about this in any descr_char guide.

    Well, the original mod had two unfinished factions that I 'completed', so I think that might've been it. Or it might've been the past me, messing around with things he didn't have a clue about =)
    Thanks for sticking with this!

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: The Mysterious New Faction Problem











Tags for this Thread

Posting Permissions

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