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

The Modding Q&A Thread

Discussion in 'Rhye's and Fall Modmods' started by Leoreth, Apr 2, 2011.

  1. civ-addicted

    civ-addicted Chieftain

    Joined:
    Aug 8, 2009
    Messages:
    852
    Location:
    The City of the Lion
    I just wondered, as srpt talked about it in his thread:
    How much work is it to make another scenario, starting at a later era?

    It's clear that one would have to a new map, and i know that whether Egypt was playable or not was how python knew in which scenario (3000BC/600AD) you are.
     
  2. Leoreth

    Leoreth Fluffy Boy Moderator

    Joined:
    Aug 23, 2009
    Messages:
    31,703
    Gender:
    Male
    Location:
    Dark World
    That's it, basically. Of course, you need extra methods to prepare the start for all civs that already exist in the later scenario, like starting techs etc.
     
  3. 67brancheswhoa

    67brancheswhoa Chieftain

    Joined:
    Jul 6, 2012
    Messages:
    7
    Location:
    Quezon City, Philippines
    Good evening!

    I want to apply to RFCEurope the birth in capital mechanism implemented by RFC: DoC (only for Byzantium as of the moment) and Sword of Islam (civs such as the Ottomans, the Timurids, the Ayyubids and Mamluks) since most civs have their capitals founded way before their spawn date, and it would not look historical enough if the game simply erases the city on the spawn plot and have the player/AI build a new city. Testing this mechanism on Muscovy, I moved their spawn plot two tiles down and put code in Barbs.py which will preplace Moscow on 1147 AD (the earliest mention about the city); then adapted the code that would flip Dublin to the English to that of Muscovy. However, it still doesn't seem nice that the Muscovite starting units wouldn't appear in Moscow but on two tiles below instead.

    I have the birthInCapital method code from RFC: Dawn of Civilization, but being amateur as I am, I honestly don't know how to adapt the method to RFCEurope. What should I do?

    Thank you very much and God bless us always! :)
     
  4. srpt

    srpt Deist

    Joined:
    May 10, 2010
    Messages:
    2,025
    Location:
    Toronto
    I'm sorry no one has replied before now.

    If you just want to have the city present on the map before the civ spawns, you can just place it there via Barbs.py and let the civ spawn on top of it in the normal tile. they will simply destroy the city when they spawn and then refound it. this causes problems with particular historic cities like holy cities or cities with wonders since they will all be destroyed but in the case of Muscovy in RFCE it should be fine.
     
  5. AbsintheRed

    AbsintheRed Chieftain

    Joined:
    Jul 27, 2009
    Messages:
    8,170
    Location:
    Szeged, Hungary
    Oh, I really should sign up for this thread...
    So you already set that a preplaced Muscovy flips to the Moscow civ as their capital, and only want to move the actual spawn tile, where they get their starting units?
     
  6. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,500
    Location:
    Poland
  7. srpt

    srpt Deist

    Joined:
    May 10, 2010
    Messages:
    2,025
    Location:
    Toronto
    all stability and core/historical areas are 100% python in all these mods afaik. I think the "python callback" ability is how you would make that information available, but I could be wrong and I have never worked with it.
     
  8. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,500
    Location:
    Poland
    Yeah, I know it's Python. I want to reduce gold and science received from noncore cities but I'm rather poor at Python so I thought maybe it's easier to call it by C++. So... any ideas, how to reduce (by 50% percent) the amount of commerce received?
     
  9. srpt

    srpt Deist

    Joined:
    May 10, 2010
    Messages:
    2,025
    Location:
    Toronto
    you could use a dummy building. passing information back and forth between python and C++ is not something I've ever done from scratch.
     
  10. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,500
    Location:
    Poland
    Somehow I have disabled plague. Is there an easy way to check what is wrong? Like calling the plague from the python console (but it works only with functions exposed to Cy- files and that is not the case with plague, doesn't it?)?
     
  11. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,500
    Location:
    Poland
    It seems that plague is working, but Marathon speed made it much weaker. Anyway, I have found an interesting thing: settlerMaps in CvRhyes.cpp. Does anyone know the meaning of numbers there? I guess 3 means core areas of other civs, 500 is the core area of civ and 20 is not important for this civ. But I cannot get what do 150-400 numbers mean.

    And another question: How do I check if a plot is within a big fat cross of a city of iI civilization (and another check if its one tile away from the city, so within 3x3 square)?
     
  12. srpt

    srpt Deist

    Joined:
    May 10, 2010
    Messages:
    2,025
    Location:
    Toronto
    the settler map numbers measure how much the AI wants to settle there. so he will settle on a 150 tile but would prefer a 500. the values also influence wars, I think.

    in python you can check tiles using squareSearch() in RFCCUtils.py.
     
  13. brett0007

    brett0007 Chieftain

    Joined:
    Apr 20, 2012
    Messages:
    130
    Location:
    somewhere
    (DOC)
    how do I give cores to minor civs?
     
  14. EdmundIronside

    EdmundIronside Chieftain

    Joined:
    Jun 27, 2017
    Messages:
    243
    Gender:
    Male
    Location:
    Grand Rapids, MI.
    I'm getting the following error:

    Traceback (most recent call last):

    File "CvWBInterface", line 47, in applyInitialItems

    File "CvWBDesc", line 1624, in applyInitialItems

    IndexError: list index out of range
    ERR: Python function applyInitialItems failed, module CvWBInterface
    Traceback (most recent call last):

    File "CvEventInterface", line 23, in onEvent

    File "CvRFCEventManager", line 99, in handleEvent

    File "CvRFCEventManager", line 110, in _handleDefaultEvent

    File "CvRFCEventHandler", line 450, in onBeginGameTurn

    File "RiseAndFall", line 691, in checkTurn

    File "RiseAndFall", line 1550, in initBirth

    File "RiseAndFall", line 1744, in birthInFreeRegion

    File "RiseAndFall", line 2664, in createStartingWorkers

    File "RFCUtils", line 355, in makeUnit

    RuntimeError: unidentifiable C++ exception
    ERR: Python function onEvent failed, module CvEventInterface


    It caused a crash to desktop on roughly the same turn every time.
    Wondered if anyone might have a clue which is the problem file?
    From the error message it does not seem clear which file is causing the error, or whether it is in the python or the dll.
     
  15. EdmundIronside

    EdmundIronside Chieftain

    Joined:
    Jun 27, 2017
    Messages:
    243
    Gender:
    Male
    Location:
    Grand Rapids, MI.
    If anyone is interested the error was in the RiseandFall file. Took me about 3 hours to fix, but did it in the end! :run:
     
  16. EdmundIronside

    EdmundIronside Chieftain

    Joined:
    Jun 27, 2017
    Messages:
    243
    Gender:
    Male
    Location:
    Grand Rapids, MI.
    I've added a new scenario to RFC Greek World. However for civs which spawn after the start date it is not automatically running through until their birth. The problem appears to be that it is automatically creating a settler and a warrior for the civ at the start of the scenario. If I go into WB and delete the units and then exit out of WB it then automatically runs until the civ spawns. I think the issue is in the RiseandFall.py, probably with the following lines:

    def create4000BCstartingUnits( self ):

    #RFGW
    for iLoopCiv in range(iNumMajorPlayers):
    if (tBirth[iLoopCiv] == 0 or iLoopCiv == utils.getHumanID()):
    utils.makeUnit(iSettler, iLoopCiv, tCapitals[iLoopCiv], 1)
    utils.makeUnit(iWarrior, iLoopCiv, tCapitals[iLoopCiv], 1)
    self.assignTechs(iLoopCiv)


    I wonder if there is a python function I can use to automatically delete the settler and warrior like I am doing in WB manually?
     

Share This Page