Modmodding Q&A Thread

I don't think there is specific code for the former. There also is no deliberate code that keeps barbarians out of specific areas (I wish I had this already because it might be helpful in some cases), but the DLL somewhat controls when barbarians can start entering foreign borders in general.
 
I made a git branch to include the new MacDonald (and change MacDonald and Trudeau's diplomusic). Everything works fine except that MacDonald has pink eyelids. Do you have an idea what might be causing this?
 
I made a git branch to include the new MacDonald (and change MacDonald and Trudeau's diplomusic). Everything works fine except that MacDonald has pink eyelids. Do you have an idea what might be causing this?

I think I read in the MacDonald thread that you need to take the eyelids from another leader. Check the discussion page for MacDonald.
 
That's a common issue.
 
Looking forward to it.
 
Hi, Leo, I made a pull request on the VD repo a month ago, not sure if you've seen it already. Thanks. (PS: Screenshots to follow.)
 
Oh, that might have gotten lost. Will review it later.
 
If I want to change a ocean tile into grassland, should I replace the "PLOT_HILLS" below with "PLOT_GRASSLAND" or some other name? And what are the two parameters "True, True" for?
Code:
gc.getMap().plot(88, 47).setPlotType(PlotTypes.PLOT_HILLS, True, True)
 
first you have to change the plot from PLOT_OCEAN to PLOT_LAND (assuming you want flat land), then change the terrain type to grassland:

gc.getMap().plot(88, 47).setPlotType(PlotTypes.PLOT_LAND, True, True)
gc.getMap().plot(88, 47).setTerrainType(con.iGrass, True, True)

the true/false entries are telling the game to regenerate the graphics and recalculate the tile yields
 
Your answer works, but setTerrainType automatically adjusts PlotType to land/ocean when necessary so setPlotType is not needed here. And optional recalculation is a recalculation of areas (continents/oceans), not of yields.
 
My first modding attempt, adding Israel, is nearing completion. The main missing piece is the UP, which is not trivial to code. Do you have any advice on how/where I should code an effect that gives extra yields to the capital city based on the number of Jewish cities with open borders? Finding the list of these cities seems fairly straightforward, there's similar code in UniquePowers.py, but I'm not sure if I check for the UP each turn, and how to actually change the yields. Any help is appreciated.
 
In my opinion extra yield for capital is best implemented by changing the building yields of the palace building.
 
How do I edit the scenario files? Can I do it through some graphic interface?

I know I can create a new WBsave through WB but it's not the same thing. Or is it?
 
They are the same.

If you edit a scenario with the WB, make sure you are select the first civ in the civ selection screen. Otherwise other civs will do their turn before you. That means that they will build cities and move units, which will be saved in your scenario.

When you are done with the scenario, it is recommended to copy the first part of the original scenario. That is everything from line #1 upto the last entry "EndPlayer". This will keep certain "settings" of the original scenario which are set to some default values when you saved it in the WB.

I am aware that a BPM to scenario file converter exists, but I have no experience with that.

Minor changes are the easiest by editing the current scenario files with a text editor. What changes to you want to make?
 
Some terrain and city placement changes. I guess I'll use the WB.
 
I noticed that some functions that exist in CityNameManager.py also exist in DynamicCivs.py (and probably other Python files for the game) with different arguments. For example, onCityAquired in CityNameManager has the arguments city and iNewOwner while its counterpart in DynamicCivs has the arguments iPreviousOwner and iNewOwner. Should that be always the case?

I tried creating another onPlayerChangeStateReligion function in CityNameManager so that I could implement religion-based renames for Jerusalem (the only thing left for me to do before submitting a pull request with all of my edits for it), and I don't think it makes sense for that function to have different arguments from the version in DynamicCivs (iPlayer and iReligion). However, after I added different print functions for each of them and tried to trigger both versions of said function, only the DynamicCivs version ran successfully. The one in CityNameManager didn't run at all.
 
My first modding attempt, adding Israel, is nearing completion. The main missing piece is the UP, which is not trivial to code. Do you have any advice on how/where I should code an effect that gives extra yields to the capital city based on the number of Jewish cities with open borders? Finding the list of these cities seems fairly straightforward, there's similar code in UniquePowers.py, but I'm not sure if I check for the UP each turn, and how to actually change the yields. Any help is appreciated.

I was reading your post then switched to news and the first headline I read was this: "In A Shocking Announcement Trump Declares Jerusalem As The Capital of Israel". Some things are interesting in life. ;)
 
I noticed that some functions that exist in CityNameManager.py also exist in DynamicCivs.py (and probably other Python files for the game) with different arguments. For example, onCityAquired in CityNameManager has the arguments city and iNewOwner while its counterpart in DynamicCivs has the arguments iPreviousOwner and iNewOwner. Should that be always the case?

I tried creating another onPlayerChangeStateReligion function in CityNameManager so that I could implement religion-based renames for Jerusalem (the only thing left for me to do before submitting a pull request with all of my edits for it), and I don't think it makes sense for that function to have different arguments from the version in DynamicCivs (iPlayer and iReligion). However, after I added different print functions for each of them and tried to trigger both versions of said function, only the DynamicCivs version ran successfully. The one in CityNameManager didn't run at all.

The functions are called from RFCEventHandler.py. There are the inputs defined. Only the relevant arguments are passed down.

For onPlayerChangeStateReligion() to work in the CNM, you have to add a call in RFCEventHandler.py @onPlayerChangeStateReligion().
 
Back
Top Bottom