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

RFC Modding Central

Discussion in 'Rhye's and Fall Modmods' started by Linkman226, Aug 29, 2011.

  1. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    For the benefit of new modders, I think the RFC modding community should have some sort of central database for RFC modding resources and to a list of common RFC modding mistakes already made by other modders. This thread is for that purpose.

    Resources

    A Guide to Adding New Civilizations to RFC- by Jarkov (at the bottom of the post)

    Technical Documentation for RFC: Sword of Islam- by EmbryoDead- A great guide if you want to create your own RFC total conversion mod or import SoI features into your mod

    Description of Each RFC Python File

    Overlay Maps Information

    How to Call Python Functions from the DLL- Case Study: Calling Civilization Modifiers from Python

    That's all I have for now. If you guys have anything else, post the link, that'd be greatly appreciated

    Common Mistakes

    Python

    The first thing you should do is enable python exceptions and logging. See this guide.

    -When adding buildings/ units/ civilizations/ techs- you need to make sure you modify the Consts.py value. Moreover, if the building is added before the values for the religious buildings are, you need to modify the generic values iTemple, iCathedral, and iMonastery by setting them equal to the first building of that type. Lastly, if you are adding a new type of religious building, you need to do a search for iReligion*4 in the python files and replace it with iReligion*5

    -I would recommend you go through the Consts.py file and the CvRhyes.h file and find oddities- namely, places where Rhye has given a building more than one name, and mark them via a comment sign to the right so that when you add units/buildings/civs, you know to skip numbers accordingly

    -When adding minor civs, you DO need to increase the CvDefines value for the max number of civs

    If you guys could help with this, that'd be fantastic. Thanks.
     
  2. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Great initiative! Sadly I have no time to contribute right now, but I might revisit the subject at a later date. :)
     
  3. Leoreth

    Leoreth 古典部の会員 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,450
    Gender:
    Male
    Location:
    Kamiyama
    I've also noticed that many people don't know how to properly enable logging and read the log files afterwards. So maybe it's a good idea to include a little guide of what goes where etc.
     
  4. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Cool :)

    A link to such a guide is now in the OP
     
  5. Optical

    Optical The Fall of the Eleventh

    Joined:
    Sep 16, 2010
    Messages:
    5,734
    Location:
    Help me. I don't know where I am.
    I think I know what this [thread] might be based on ;)

    It's a really good idea, though, and I can see it being really helpful :) so subbed.
     
  6. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    On what exactly? I didn't base it off anything
     
  7. Optical

    Optical The Fall of the Eleventh

    Joined:
    Sep 16, 2010
    Messages:
    5,734
    Location:
    Help me. I don't know where I am.
    I thought you might have based it off of S&T Central :D

    The assumption was based off the name, however, and they're definitely very different in terms of content.
     
  8. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Oh oh ok lol

    No it wasn't based off of that, sorry. At least not consciously.
     
  9. Optical

    Optical The Fall of the Eleventh

    Joined:
    Sep 16, 2010
    Messages:
    5,734
    Location:
    Help me. I don't know where I am.
    Just wondered :)
     
  10. BenZL43

    BenZL43 Physician - still can't spell this correctly.

    Joined:
    Sep 25, 2010
    Messages:
    3,198
    Gender:
    Male
    Location:
    Indonesia
    Will anyone create a guide about what each Python file is used to?
    Like what is Victory.py, Const.py etc..?
     
  11. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    I have some spare time this weekend. I'll write a Consts.py guide I suppose.
     
  12. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Easy :D

    Spoiler :
    AIWars - scripting AI war declaration
    Barbs - spawning units and cities for the minor players
    CityNameManager - naming cities according to Civ/geography
    Communications - connects/disconnects contact between players, embassies
    Congresses - World Congresses
    Conts - settings and global values (constants)
    CvEventManager - part of the core game mechanisms
    CvGameUtils - also part of the core game mechanisms
    CvRFCEventHandler - main hub for Python calls in RFC
    CvRFCEventManager - another event management module, not really in use
    Plague - plagues? :rolleyes:
    Religions - spreading of religions, holy shrines
    Resources - scripted spreading of Bonuses and terrain
    RFCUtils - collection of useful Python code for RFC, shared by several modules
    RiseAndFall - central module for main RFC features (like Rise and Fall, secessions, collapse of minor Civs)
    Stabilty - calculation and handling of stability, stability based collapse of Civs
    StoredData - custom stored data for RFC
    UniquePowers - some of the Unique Power code (rest in DLL)
    Victory - Unique Historical Victories
     
  13. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    I was planning on writing a more in-depth guide. However my installation of civ has stopped working- it keeps on hanging at init python- so until I get that fixed I don't plan on doing much else.
     
  14. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Yeah, write a Python guide while you're at it. ;) Otherwise no-one will be able to do much of anything with the information. And anyone who already knows Python can probably read the modules as clear as English. :p

    I once intended to rework all Python in RFC - in order to make the bulk of it more moddable. But of course I don't have the time for anything like that. :lol:
     
  15. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    You're right :lol:

    BTW, edead has reworked a lot of the python already to make it more moddable.
     
  16. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Yeah, but I was thinking like *1000 more reworking. There is a lot of weird stuff in the code, but as long as it works its alright. But it makes modding less accessible, and I'd like RFC modding to be as accessible as possible. Ever heard of PyScenario? ;)
     
  17. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    A lot of work then. Which would require a lot of time.

    Of course I've heard of it. ;)
     
  18. BenZL43

    BenZL43 Physician - still can't spell this correctly.

    Joined:
    Sep 25, 2010
    Messages:
    3,198
    Gender:
    Male
    Location:
    Indonesia
    Thanks to both of you ;)
    IMO the Const.py is quite easy to read, just some information that I missed --
    Looking forward for your guide, Linkman.

    By the way,
    where can I find file that control which one is historical area etc?
    I found the Core area TL BR Coordinates in Const.py but I can't find the one for historical, foreign etc :)

    And Linkman or anyone else could you create a guide how to read AIWars?
    I presume the column and row is a map like in CNM?
     
  19. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    The stability values for each tile are controlled by the Settler Maps, which is in the DLL

    And AIWars works the same way as CNM, but the value of each tile indicates how likely it is that the given civ will go to war with the civ that controls that tile.
     
  20. Leoreth

    Leoreth 古典部の会員 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,450
    Gender:
    Male
    Location:
    Kamiyama
    One important thing to know about AIWars is that it only controls against whom war is declared, not on which area the AI focuses its military efforts during these wars.
     

Share This Page