Modmodding Q&A Thread

Is there a specific version of python which is compatible?
 
With the game? I think it uses 2.3 but you don't need Python on your system to mod it.
 
No. The plugin has a build-in python console.
I don't know what I'm doing wrong...

I'm pretty sure I don't have the 64-bit version of Notepad++ but I DLed the plug-in and it's not there. I tried some different things but nothing seemed to work, I'm not even sure the things I was trying were related at all.
 
Last edited:
Do you have the 32-bit version of Notepad++ or the 64-bit version? The plugin only works for the 32-bit version. (A plugin for the 64-bit version has never been released)
 
Do you have the 32-bit version of Notepad++ or the 64-bit version? The plugin only works for the 32-bit version. (A plugin for the 64-bit version has never been released)
I'm pretty sure I don't, won't it usually say so right at the top of the program window?

EDIT: Yes, it is 32-bit
 
Last edited:
You can check the version by pressing the F1 key when you have Notepad++ opened.

You might need to redownload and reinstall Notepad++ to make it work. (I had to do this too when I tried to install the plugin)
 
You can check the version by pressing the F1 key when you have Notepad++ opened.

You might need to redownload and reinstall Notepad++ to make it work. (I had to do this too when I tried to install the plugin)
I've still got nothing, is there any particular settings I need to have?
 
Not that I know of. Do you get an error message when you try to install it?
Notepad++ or the python script? Either way, neither had errors when I installed them. Is this what it should look like? Menu > Plugins > Python Script > Scripts > Samples / startup
 
That is how it should look like indeed. It seems you did install it correctly.

To use the mapeditor script, simply create a new script. (Menu->plugins->Python Script->New script) Copy-paste the code you found in this post. And then run it.
 
That is how it should look like indeed. It seems you did install it correctly.

To use the mapeditor script, simply create a new script. (Menu->plugins->Python Script->New script) Copy-paste the code you found in this post. And then run it.
So I opened a new file, I went Menu->plugins->Python Script->New script saved the code as Increment.py in the notepad++ Python Scripts directory... I went back to the 1700AD scenario file I clicked Run>Run...>...>Increment.py>Run nothing appeared to happen, should anything have happened?
 
To execute the script, do Plugins->Python Script->Scripts->Increment.py.

Make sure you are on the 1700 AD scenario file. (Which you did last time)


Here is the latest version of my script. I made some minor changes in the code and added a message box that indicates that the script is finished.
Code:
from Npp import *
import re

start = int(notepad.prompt(notepad, 'Number of the new civ', ""))
end = 75

editor.beginUndoAction()
for i in reversed(range(start, end)):
    editor.rereplace(r"(Owner=|Reveal=|Player|,|Team=|TeamID=|AttitudePlayer=)" + "(" + str(i) + ")([^1234567890])", r"($1)" + str(i+1) + "($3)")
editor.endUndoAction()
notepad.messageBox("Finished", "", 0)
 
To execute the script, do Plugins->Python Script->Scripts->Increment.py.

Make sure you are on the 1700 AD scenario file. (Which you did last time)


Here is the latest version of my script. I made some minor changes in the code and added a message box that indicates that the script is finished.
Code:
from Npp import *
import re

start = int(notepad.prompt(notepad, 'Number of the new civ', ""))
end = 75

editor.beginUndoAction()
for i in reversed(range(start, end)):
    editor.rereplace(r"(Owner=|Reveal=|Player|,|Team=|TeamID=|AttitudePlayer=)" + "(" + str(i) + ")([^1234567890])", r"($1)" + str(i+1) + "($3)")
editor.endUndoAction()
notepad.messageBox("Finished", "", 0)

Thanks!

EDIT: It worked I think, only problem is I didn't realize it also incremented the Begin Team and BeginPlayer so I had to re-do those but that wasn't too much trouble. Excellent!

Also does this work on the 600AD file as well?
 
Last edited:
Yes. It works for all scenarios. It updates all player IDs. It also updates the PlayerReveal data. (But that is only used in 1700 AD IIRC) The only thing you have to do manually is adding a BeginTeam at the top
Code:
BeginTeam
    TeamID=XX, (Name)
EndTeam
and the PlayerData
Code:
BeginPlayer
    Team=XX
    LeaderType=LEADER_XXX
    CivType=CIVILIZATION_XXX
    PlayableCiv=1
    StartingGold=XXX
    Handicap=HANDICAP_REGENT
EndPlayer
 
Spoiler :
With this, we're done with the DLL changes, you only have to compile your code now. It's important to rebuild the entire project because you changed some header files.

Python adjustments

All of these files are in Assets\Python\.


Should compiling the DLL changes be done before or after doing the python adjustments?
 
How do I disable the wonder limit for a one-city challenge?
 
In Assets/XML/GameInfo: Open CultureLevelInfo.xml. There you can set the iWonderLimit for each culture level. If you set it to 99 for each level you get the result you want. (Otherwise you would need to dig deeper in the code I think)

Or enable the option One City Challenge. (You can do this in the WB after you spawn)

(With the new wonders, it is probably necessary to review the max wonders per culture level)
 
Back
Top Bottom