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

Modmodding Q&A Thread

Discussion in 'Rhye's and Fall - Dawn of Civilization' started by Leoreth, Dec 14, 2013.

  1. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,053
    Gender:
    Male
    Location:
    Leblanc
    It seems people are more motivated to create DoC modmods right now, at least I've been getting more messages lately with questions about that. Which is great, but the PM/VM system is a bit impractical to use so I'd rather have a thread for it.

    So I made one.

    You can ask any question regarding DoC and RFC modding here and I try to answer them in a way that helps you. I'll mostly answer questions by saying "You need to go there and there and there to make that happen". I will not teach you how to code Python and C++, how object oriented programming works and how to compile a DLL, because there are already guides for this.

    I also won't answer requests of "could you please do X for me". Most of the time doing it myself would be easier than explaining it, but I don't want to encourage people to rely on me to do their work for them.

    If the question is related to a (Python) error you receive, I can usually only help when I know the exact content of the error message and the line it's referring to. So please make sure to have enabled Python exceptions and logging (see the main mod thread on how to do it) and share the error with me. Both are things you should have enabled by default when you're modding, anyway.

    But feel free to ask if you have anything you want to change.
     
  2. BenZL43

    BenZL43 Physician - still can't spell this correctly.

    Joined:
    Sep 25, 2010
    Messages:
    3,198
    Gender:
    Male
    Location:
    Indonesia
    It's because you're an inspiration for us all :)
     
  3. Mouthwash

    Mouthwash Escaped Lunatic

    Joined:
    Sep 26, 2011
    Messages:
    8,885
    Location:
    Hiding
    You're an awesome guy. I don't know what Python and C++ even are, though.

    I'm currently trying to edit stability maps, but I just see a mess of numbers that I don't know what to do with. I also don't know where to find tCapitals or tBirth.
     
  4. Cosmos1985

    Cosmos1985 Chieftain

    Joined:
    Sep 20, 2008
    Messages:
    631
    Location:
    Aarhus, Denmark
    Those are found in Consts.py , located in \Assets\Python
     
  5. Royal Tenenbaum

    Royal Tenenbaum Pacific Phytopathologist

    Joined:
    Oct 23, 2012
    Messages:
    2,737
    I'm going to make a modmod that takes away everything Leoreth added
     
  6. citis

    citis Chieftain

    Joined:
    Jul 8, 2011
    Messages:
    2,479
    Core areas are in python. Historical areas are in the CvRyes.cpp (tiles with value more than 90). Contested=Historical but foreign core. Credits to Leoreth.
     
  7. BenZL43

    BenZL43 Physician - still can't spell this correctly.

    Joined:
    Sep 25, 2010
    Messages:
    3,198
    Gender:
    Male
    Location:
    Indonesia
    Looks like Rhye already beats you to that :cool:
     
  8. Sanguivorant

    Sanguivorant Submitter

    Joined:
    Jun 26, 2012
    Messages:
    1,375
    Location:
    Calgary, Canada
    How do I give myself the ability to change my civ description in-game?

    Sent by phone.
     
  9. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,053
    Gender:
    Male
    Location:
    Leblanc
    You mean the name of your civ as it appears in the scoreboard?
     
  10. Sanguivorant

    Sanguivorant Submitter

    Joined:
    Jun 26, 2012
    Messages:
    1,375
    Location:
    Calgary, Canada
    Precisely.
     
  11. mrrandomplayer

    mrrandomplayer Potentially back

    Joined:
    Aug 1, 2012
    Messages:
    3,307
    Location:
    A point in the time-space continuum
    Go to the DynamicNames.xml file for the civ you want changed, then edit it there.
     
  12. AtlantaMarty

    AtlantaMarty No longer active

    Joined:
    Jul 9, 2013
    Messages:
    835
    Gender:
    Male
    Location:
    There's no reason for me to stay here
    Well, my question isn't about DoC, It's actually about SoI. But since you said RFC modding, I guess I can ask it.

    How do I change the Byzantine trait to give +1 gold per city in addition to the already existing bonus of espionage points???


    And is there a difference between C++ and DLL
     
  13. Sanguivorant

    Sanguivorant Submitter

    Joined:
    Jun 26, 2012
    Messages:
    1,375
    Location:
    Calgary, Canada
    I don't think my question is relayed to modding. Like, when I go to your details and type my own civ description, it doesn't change to that name. That's really what I want, nothing mod related.
     
  14. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,053
    Gender:
    Male
    Location:
    Leblanc
    I'll try to answer SoI questions if they aren't too detailed. But what you want to do requires a DLL change.

    There is a difference, but it's more a technicality from an external perspective. C++ is a programming language. The C++ code is then compiled to create the DLL file. So both refer to the same part of the game if you want.

    I think you can add your civ description that way, the problem is that the dynamic name script will change it again in a couple of turns. To avoid that, you have to add a line in DynamicCivs.py at the beginning of the checkName() method:
    Code:
            def checkName(self, iPlayer, lPreviousOwners=[]):
    	
    		if utils.getHumanID() == iPlayer: return
            
                    if iPlayer >= iNumPlayers: return
    		
    		if not gc.getPlayer(iPlayer).isAlive(): return
     
  15. mrrandomplayer

    mrrandomplayer Potentially back

    Joined:
    Aug 1, 2012
    Messages:
    3,307
    Location:
    A point in the time-space continuum
    So I have made my scenario and done all of the things that you have told me to do when making a scenario. However, when I load it, on the choose civilization screen, it shows the starting times for the latest possible scenario for each civ (excluding 500AD:mad:) and then, right as the scenario is about to start, the following error occurs:

    Code:
    attribute error: 'module object' has no item tBabylon
    Or something close to that.

    Does anyone know what the problem is and how to fix it?
     
  16. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,053
    Gender:
    Male
    Location:
    Leblanc
    The error should tell you the offending line. I guess it's because you're using tBabylon before defining it first.
     
  17. mrrandomplayer

    mrrandomplayer Potentially back

    Joined:
    Aug 1, 2012
    Messages:
    3,307
    Location:
    A point in the time-space continuum
    I think the problem is that it doesn't fetch the 500AD data properly from C++ or Python. I think that the Babylon listing is a result of that. The game crashes before I can see the line (if it even hypothetically gives the line) or any other error.
     
  18. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,590
    Location:
    The city of the original vlaai
    Could you please add some dummy building slots? As I noticed with my 2nd UB modcomp, you can't just add buildings. They will mess up with the embassy code if you dont change the DLL. So you can't add any building/wonder.

    You can compare these slots with the already hidden buildings, like the Harappan Bath. They do exist in the game, but you can't use them. But they can be used with a little coding.

    This makes it a lot easier for us to add new buildings/wonders. We only have to convert one of the dummy buildings to the new building. It will automatically match with the DLL, as the number of buildings won't change. (15 normal buildings + 10 dummy buildings is the same number of coded buildings as 16 buildings + 9 dummies)

    For most of us I think 10 dummy slots would be enough. But I would be grateful if it could be the amount of 42. So my 2nd UB modcomp can make use of those slots. That means I don't need a new DLL everytime.


    One thing I want to do is creating some kind of wonder module. But as no new buildings can be added, it's currently not really possible. If these dummy slots will be added, many can create there own wonder modules.
     
  19. brett0007

    brett0007 Chieftain

    Joined:
    Apr 20, 2012
    Messages:
    132
    Location:
    somewhere
    how do I give a minor civ a stability map?
     
  20. Mouthwash

    Mouthwash Escaped Lunatic

    Joined:
    Sep 26, 2011
    Messages:
    8,885
    Location:
    Hiding
    Why would you want to?
     

Share This Page