Modmodding Q&A Thread

1. How do you create the 1700 AD scenario? iirc Rhye made the game to differentiate 3000BC and 600AD by checking whether Egypt is playable. What do you use so the game identify it is loading the 1700AD scenario?

2. Is it possible to create a new 4th scenario like say, 1423AD, without involving C++ and such?

3. If not possible, well, is there any way to "convert" a.... 1423AD saves played with China into a 1423AD saves played with India; besides using the Ctrl + Z chipotle cheat mode?
 
1. How do you create the 1700 AD scenario? iirc Rhye made the game to differentiate 3000BC and 600AD by checking whether Egypt is playable. What do you use so the game identify it is loading the 1700AD scenario?

2. Is it possible to create a new 4th scenario like say, 1423AD, without involving C++ and such?

3. If not possible, well, is there any way to "convert" a.... 1423AD saves played with China into a 1423AD saves played with India; besides using the Ctrl + Z chipotle cheat mode?

1. It checks if Byzantium is playable or not.
Spoiler :
Code:
	def getScenario(self):
		if gc.getPlayer(con.iEgypt).isPlayable(): return con.i3000BC
		
		if gc.getPlayer(con.iByzantium).isPlayable(): return con.i600AD
		
		return con.i1700AD

2. It requires python. I don't know if it requires C++ as well.
3. Sortof. You can make a scenario file from a savegame by opening the WB and use the WB-save button. Then, you can start that scenario as India for example. But some data will be lost, like the current production of cities.
 
1. How do you create the 1700 AD scenario? iirc Rhye made the game to differentiate 3000BC and 600AD by checking whether Egypt is playable. What do you use so the game identify it is loading the 1700AD scenario?

2. Is it possible to create a new 4th scenario like say, 1423AD, without involving C++ and such?

3. If not possible, well, is there any way to "convert" a.... 1423AD saves played with China into a 1423AD saves played with India; besides using the Ctrl + Z chipotle cheat mode?

1. Create the WorldBuilder file, then do a ton of work in Python and C++. It's actually not that hard, you just have to find where the scenario is mentioned and edit those sections.
2. No
3. I think you could just save it as a WBS file, but I have no idea if that will work or not.
 
In addition to those that have already been answered:
2. Is it possible to create a new 4th scenario like say, 1423AD, without involving C++ and such?
No, the game behaves different for different scenarios and part of that is done in C++. Most importantly, the autoplay only works correctly if the game knows the starting year of your scenario.
 
Is there any way I can make the SVN Tortoise to automatically notify me whenever a file I'm currently editing is about to be updated in the next revision so I can review whether I want to update or not?
 
As far as I know, it doesn't have such an option.

However, if you don't edit the same part of the file as Leoreth does, the 2 files will merge. So you have the latest version with your updates. Only if the same lines of code are edited by both, it will get conflicted.
 
Except that they spawn once in maybe 10 games before 1800 :mad:. Italy is always controlled by Byzantines, France, or Germany. And of course sometimes, Poland or Tibet.

Spoiler :
and in a youtien game, the Mayans

Italy is now a bit too weak. A small army and two cramped cities. Keep in mind, they should start of as relatively strong, considering that Italy represents Venice as well.
 
Is there any way I can make the SVN Tortoise to automatically notify me whenever a file I'm currently editing is about to be updated in the next revision so I can review whether I want to update or not?
Nope, especially because that change might not even have been committed when you start making your own changes.

That's not that much of a problem however because as merijn said, if it isn't the exact same lines the client should merge the code for you. In case of a conflict you can also always to the merge yourself, especially if you also have WinMerge installed.
 
OK thanks. I'll just watch out then.
Is there any other way to Comment in Python beside using # ?
I saw there's a way of using """ ... """ in one website but when I tried, Notepad++ turn to Orange, not Green as in when commenting using #
 
What Notepad does is irrelevant. And yes that's a valid way to make comments, especially if they span multiple lines.
 
what does color Orange means? If the comments does not spawn through a few lines, can I use it as well? It's just for aesthetic reason, since I already used the # comment in the same line :mischief:
 
Italy is now a bit too weak. A small army and two cramped cities. Keep in mind, they should start of as relatively strong, considering that Italy represents Venice as well.

Well, if you go with my plan, Leoreth, and have Venice be a separate civ, then the Italian peninsula as a whole will be stronger.
 
what does color Orange means? If the comments does not spawn through a few lines, can I use it as well? It's just for aesthetic reason, since I already used the # comment in the same line :mischief:
Well first of all, the colors are a Notepad thing, not a Python thing. They don't mean anything beyond helping you recognize what function a specific line has. Notepad seems to use a different color (orange) for multi-line comments than the usual green for single line comments, but this is rather arbitrary (and configurable). As far as Python is concerned, both symbols mark a comment, and everything behind/inbetween them will be completely disregarded.
 
How would I set up a 'sunset invasion' scenario with the 600 ad start? I've tried switching the old and new world civs in consts.py but that just crashes the game so I suspect there is more at work than that...
 
You would have to code the entire conqueror event yourself. The method onFirstContact() in RiseAndFall.py is a good way to start if you want to look up how the current event is done.
 
Is persecution project python or SDK thing ? I love how it's used here and I'd like to steal it ;)
If python, where ? :)

thanks a lot ! :)
 
The project itself is in XML of course, just make sure that everyone can only have one and that it doesn't do anything.

The effect is done in Python, I think directly in onProjectBuilt() in RFCEventHandler.py. Besides removing the religious buildings along with the religion the important part is to remove the project from the player again so it can be built again.

What I'm not sure about right now is where I check if the project can be built in a city at all (i.e. player needs state religion and a non-state religion in the city). Might be DLL, but could also be Python. I'll tell you when I have access to the code.
 
It's in the DLL, unfortunately: CvCity::canCreate().
Code:
// Leoreth: allow persecution only if you have a state religion and your city has at least one non-state religion
	if (eProject == GC.getInfoTypeForString("PROJECT_PERSECUTION"))
	{
		if (getOwnerINLINE() >= NUM_MAJOR_PLAYERS)
		{
			return false;
		}

		if (!GET_PLAYER(getOwnerINLINE()).isStateReligion())
		{
			return false;
		}

		bool bNonStateReligion = false;
		for (int iI = 0; iI < GC.getNumReligionInfos(); iI++)
		{
			ReligionTypes eReligion = (ReligionTypes)iI;
			if (GET_PLAYER(getOwnerINLINE()).getStateReligion() != eReligion)
			{
				if (isHasReligion(eReligion) && !isHolyCity(eReligion))
				{
					bNonStateReligion = true;
					break;
				}
			}
		}

		if (!bNonStateReligion)
		{
			return false;
		}
	}
 
The project itself is in XML of course, just make sure that everyone can only have one and that it doesn't do anything.

The effect is done in Python, I think directly in onProjectBuilt() in RFCEventHandler.py. Besides removing the religious buildings along with the religion the important part is to remove the project from the player again so it can be built again.

What I'm not sure about right now is where I check if the project can be built in a city at all (i.e. player needs state religion and a non-state religion in the city). Might be DLL, but could also be Python. I'll tell you when I have access to the code.

Effect itself was in RiseAndFall.py (in two places) and CvRFCEventManager.py but it turned out it's way more complicated than I expected and simply copying it to normal RFC doesn't work ;P
Thank you a lot for your time :)
 
Back
Top Bottom