The Modding Q&A Thread

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.
 
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.
 
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! :)
 
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.
 
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?
 
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.
 
you could use a dummy building. passing information back and forth between python and C++ is not something I've ever done from scratch.
 
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)?
 
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.
 
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.
 
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:
 
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?
 
Does anyone know how can I create civ that can be playable but starts later in the game?
I have been looking through the RiseFall py files but i'm not sure how can I create one.
 
Top Bottom