1SDANi
Sister Lady
- Joined
- Oct 27, 2014
- Messages
- 2,932
Ah, that is an issue. I did not know that. How do I check who owns a wonder then?Why go through wonder builder at all? Can't the wonder change hands so the effect goes to the new owner?
Ah, that is an issue. I did not know that. How do I check who owns a wonder then?Why go through wonder builder at all? Can't the wonder change hands so the effect goes to the new owner?
I was hoping I could avoid having to iterate through that many cities, but seeing as how other wonders use it, I guess I will too.CvPlayer::isHasBuildingEffect() is there precisely for this kind of wonder effect, it checks if the player has at least one building of the specified type and also checks if they already have the obsoletion tech (and returns false in that case).
Guess it's time to set up 100 log statements and see where the trail stops then... Great.That might be a legitimate assertion failing in the base mod, I haven't thoroughly run it through the debug DLL to correct all of them yet.
I wonder if there is a good way not to hard code the overall number of players into the script.Thanks. This is really useful.
EDIT:
I made 2 small modifications. The first is a popup, in which you can type the number of the new civ. (So you don't have to open the script to edit it)
The second an undo-action, which will undo the whole script when Ctrl-Z is pressed.
Code:from Npp import * import re start = int(notepad.prompt(notepad, 'Number of the new civ', "")) - 1 end = 54 editor.beginUndoAction() for i in range(start, end): ii = end + start - i editor.rereplace(r"(Owner=|Reveal=|Player|,|Team=|TeamID=)" + "(" + str(ii) + ")([^1234567890])", r"($1)" + str(ii+1) + "($3)") editor.endUndoAction()
A second popup maybe?I wonder if there is a good way not to hard code the overall number of players into the script.
That might be why. The game suddenly swapped to fullscreen mode a couple hours ago.Context? Python print goes to PythonDbg.log by default. Printing of errors is controlled by a config setting that may reset under some circumstances.
Find what: \t([0,1,2,3,4,5,6,7,8,9][0,1,2,3,4,5,6,7,8,9][0,1,2,3,4,5,6,7,8,9],)
Replace with: ($1)
Find what: (\t[0,1,2,3,4,5,6,7,8,9]),
Replace with: ($1) ,
\t20,
from Npp import *
import re
start = int(notepad.prompt(notepad, 'Number of the new civ', "")) - 1
end = 54
editor.beginUndoAction()
for i in range(start, end):
ii = end + start - i
editor.rereplace(r"(Owner=|Reveal=|Player|,|Team=|TeamID=|AttitudePlayer=)" + "(" + str(ii) + ")([^1234567890])", r"($1)" + str(ii+1) + "($3)")
editor.endUndoAction()