1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Figuring Out Building Creation

Discussion in 'C2C mod mods' started by Squidimp, Apr 13, 2016.

  1. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,867
    Gender:
    Male
    Location:
    Canberra, Australia
    Basically it just stops XML errors .

    At the moment not very, just good practice. It all depends on the number of active modders and how much they are working on intertwined stuff.
     
  2. Squidimp

    Squidimp Apollonian Chthonian

    Joined:
    Oct 29, 2015
    Messages:
    73
    Location:
    Australia
    Not technically a building related question this time!
    Does anyone have any pointers on adding a new Civic Category?

    I can add/overwrite civics within a category fine. However, I can't seem to add anything to the CivicOptionInfos without causing a crash. The file is very simple; I'm pretty sure it's not just mis-spelling or anything.

    Do I have to add the default civic to the CivilisationInfos?
     
  3. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,731
    Gender:
    Male
    Location:
    Las Vegas
    I'm not sure, as I've never tried to add a new category. However, there are some basic procedural things you can do to try to work out what may be wrong.

    1) If you have any suspicions, such as needing the default civic (which is a probable yes to your question), go ahead and do that and see if it sorts out the problem.

    2) Run the load sequence through the debug dll. It will often let you know if there's an error in the xml and where.

    3) Use grepWin to search through python for anywhere all of the categories may be listed and possibly required to have a new one added to.

    By step 3 you'll probably have it sorted out.
     
  4. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,286
    Gender:
    Male
    Location:
    MN
    There are a few area's if adding a new or deleting a civic.

    If these are the "default" civic, then u need to inform ALL map makers so that they can change the starting defaults also. Coincides with CivInfo below

    Then u need to add/change any buildings that need a preq to it.

    Of course CivicInfo's and adding the correct TXT to the text folder/

    U only need to add it to the CivilizationInfo IF it is a "starting" civic of an area ie : ANARCHISM

    i think thats it . .
     
  5. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    14,963
    Gender:
    Male
    Location:
    Western IL. cornfields
    There is a file that has the Civic categories listed as 14. This file would need changed to 15 If you are adding a new Category to CivicOptionInfos. ATM I can't remember if it is a GlobalDefine or some other file. I have seen it so I know it exists.

    EDIT: Found it. It is in GlobalDefines, this set of lines;
    Code:
    	<Define>
    		<DefineName>MAX_CIVIC_OPTIONS</DefineName>
    		<iDefineIntVal>14</iDefineIntVal>
    	</Define>
    Change the 14 to 15 ( or to total of how many new categories you are adding to the original 14). If using Notepad++ it is lines 342 to 345.

    JosEPh
     
  6. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,731
    Gender:
    Male
    Location:
    Las Vegas
    Nice catch!
     
  7. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,286
    Gender:
    Male
    Location:
    MN
    Going through it now, it has 15, at least thats what CIV4CivicOptionInfos has, so it needs to be changed anyways, right??
     
  8. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,867
    Gender:
    Male
    Location:
    Canberra, Australia
    I think MAX_CIVIC_OPTIONS used to be used by the Python to guess at how big each civic box needed to be to hold all the options for that civic, however I changed the code to be more dynamic and use a size big enough for either the actual number of options or the detail each of the civic options, which ever was biggest.
     
  9. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,286
    Gender:
    Male
    Location:
    MN
    Is this anything in python? DH??

    self.USER_ADJUSTMENT = 15 # default 100
     
  10. pepper2000

    pepper2000 Chieftain

    Joined:
    Apr 14, 2013
    Messages:
    881
    Did you do that recently? When I was working on civics for the space modmod, I found that the boxes adjusted for the detail of the largest option, but not the number of options. I added a few extra features to the Xenosemiotics civic so that all of the language options would be visible.
     
  11. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,867
    Gender:
    Male
    Location:
    Canberra, Australia
    It is used in the Civics screen only. No idea what for as I am deep in some other code at the moment.

    No. I did it all a long time ago. What you suggest means that I made a mistake somewhere.
     
  12. Squidimp

    Squidimp Apollonian Chthonian

    Joined:
    Oct 29, 2015
    Messages:
    73
    Location:
    Australia
    Cheers guys, I seem to have fixed the problem by running a debuger and re-adding the Civilisation starting civics. :goodjob:

    DH's re-route seems to be working fine; I haven't needed to edit the GlobalDefines (although I'm very impressed with your memory JosEPh_II!)


    All going well, I'm probably going to be throwing my hat into the contentious civics ring by the end of next week :cowboy:
     
  13. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    14,963
    Gender:
    Male
    Location:
    Western IL. cornfields
    Your Welcome Squidimp, but....the responses make me wonder if what I found is actually For the Total Civic Categories? But rather for how many line items a specific Civic can have. :hmm:

    More mysteries of C2C coding...........:crazyeye: ;)

    JosEPh :)
     
  14. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,867
    Gender:
    Male
    Location:
    Canberra, Australia
    You mean BtS coding :lol:
     
  15. Squidimp

    Squidimp Apollonian Chthonian

    Joined:
    Oct 29, 2015
    Messages:
    73
    Location:
    Australia
    I have been trying to pin down the source of Pedia errors that I keep running into when using my Wonders. Strangely, it seems to be affected by the cache. The wonders section of the pedia loads differently depending on whether or not the cache has been cleared. This seems to effect loading regardless of what functions the wonder uses. I have also added new buildings, but the common buildings section is never affected.

    Does anyone have any idea what could be causing this?
    I have other C2C folders located on the same hard-drive, but not in the same mods folder, - could this interaction be causing the errors? I presume that it can't be Python (although I do need to further verify my Py code at some point), because the Civilopedia shouldn't be able to access that code in any case. What else might vary for cache-based reasons?
     
  16. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,731
    Gender:
    Male
    Location:
    Las Vegas
    Underlying game cache? This is sounding like a vanilla base exe issue. What are the errors exactly?
     
  17. Squidimp

    Squidimp Apollonian Chthonian

    Joined:
    Oct 29, 2015
    Messages:
    73
    Location:
    Australia
    The Great Wonders section fails to display any Wonders, instead appearing empty. These wonders can still be built in game, and work fine.

    If I don't clear the cache, the pedia entries sometimes appear again, usually with a single empty entry at the beginning. If I go back and clear the cache, the Wonders fail to be displayed again.

    If I don't have my Wonders installed, this doesn't happen, but it happens regardless of which wonders are installed from the set. If I don't clear the cache weird, inconsistent errors sometimes emerge which seem to go away if I remove particular functions, but the functions seem semi-random. E.g. sometimes Help text causes problems and sometimes ObsoleteSafeCommerce causes problems. There never seems to be a reason for this, and cache changes can change the function giving me errors.

    All in all, it's damn confusing
     
  18. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,867
    Gender:
    Male
    Location:
    Canberra, Australia
    A number of XML things can cause this, mostly mismatches somewhere. There are a couple programs AIAndy wrote that can find them something Validate. Sorry I was in hospital last night and the meds are making me a bit vague.
     
  19. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,731
    Gender:
    Male
    Location:
    Las Vegas
    Sounds like you have a better bead on it than I do despite that fact. Hope you're feeling better!

    I would advise to run the debug dll. If you have an XML error somewhere causing that, then it should point out where and what line. Just rename the main dll (I add '.core' to the end) then rename the dll ending with .debug by simply removing '.debug' from the name. Then run the game. Make sure to reverse those changes when you are done with the debugger.
     
  20. Squidimp

    Squidimp Apollonian Chthonian

    Joined:
    Oct 29, 2015
    Messages:
    73
    Location:
    Australia
    Thanks for the assistance guys! I'll definitely try the debugger, and try to locate AIAndy's stuff if that doesn't work out :high5:
     

Share This Page