<Nexus>
Traveler of the Multiverse
I didn't. RoM devs did.you mean the one created by Kael? https://forums.civfanatics.com/resources/assimilation.9911/
If yes then how did you get it to work?! The game doesn't even load when I try to load the mod.
I didn't. RoM devs did.you mean the one created by Kael? https://forums.civfanatics.com/resources/assimilation.9911/
If yes then how did you get it to work?! The game doesn't even load when I try to load the mod.
CvPlot* plot = yourPlot;
std::vector<CvPlot*> plots;
for(int x = plot->getX()-1; x<=plot->getX()+1; ++x) {
for(int y = plot->getY()-1; y<=plot->getY()+1; ++y) {
if(GC.getMap().isPlot(x, y)) {
if(yourCondition) {
plots.push_back(GC.getMap().plot(x, y));
}
}
}
}
if(plots.size() > 0) {
CvPlot* randomPlot = plots[GC.getGame().getSorenRandNum(plots.size(), "plot selection roll")];
}
for (int i = 0; i < NUM_DIRECTION_TYPES; ++i)
{
CvPlot* pLoopPlot = ::plotDirection(plot->getX_INLINE(), plot->getY_INLINE(), (DirectionTypes) i);
if (pLoopPlot != NULL)
{
}
}
def doReInit(self):
iPlayer = PyPlayer(CyGame().getActivePlayer())
unitList = iPlayer.getUnitList()
# Loop for all players cities
for ii in range(len(unitList)):
pLoopUnit = unitList[ii]
# get the group the unit belongs to.
pGroup = pLoopUnit.getGroup()
# check if unit is doing air patrol
if (pGroup.getActivityType() == ActivityTypes.ACTIVITY_INTERCEPT):
# remove mission (this one shold be obsolete, but who knows ;)
pGroup.popMission()
pPlot = pGroup.plot()
# add new mission -> fortify
pGroup.pushMission(MissionTypes.MISSION_FORTIFY, 0, 0, 0, false, false, MissionAITypes.NO_MISSIONAI, pPlot, pLoopUnit)
# add new mission -> air patrol
pGroup.pushMission(MissionTypes.MISSION_AIRPATROL, 0, 0, 0, false, false, MissionAITypes.NO_MISSIONAI, pPlot, pLoopUnit)
Thanks, I did this and also set <iDiscoverMultiplier> to 0 also.1. in UnitInfos.xml, set <iBaseDiscover> to 0.
pPlot = caster.plot()
# Set unit to sleep
pGroup = caster.getGroup()
pGroup.popMission()
pGroup.pushMission(MissionTypes.MISSION_FORTIFY, 0, 0, 0, False, False, MissionAITypes.NO_MISSIONAI, pPlot, caster)
Looks to me like this is an action, which will cause out of sync issues in network games unless you make sure it is handled in sync.VOID setActivityType (ActivityType eNewValue)
CyMessageControl().sendModNetMessage(INT iData1, INT iData2, INT iData3, INT iData4, INT iData5)
if (iData1 == 0):
player = gc.getPlayer(iData2)
unit = player.getUnit(iData3)
unit.getGroup().setActivityType(ActivityTypes.ACTIVITY_SLEEP)
Looks to me like this is an action, which will cause out of sync issues in network games unless you make sure it is handled in sync.
if (iData1 = 0):
player = gc.getPlayer(iData2)
unit = player.getUnit(iData3)
unit.getGroup().setActivityType(ActivityTypes.ACTIVITY_SLEEP)
At times it can be tricky, but generally speaking there are two types of code:How do you identify which actions are likely to cause out of sync issues in multi-player (only ever played single player)?
I'm getting a Python stacktrace (screenshot attached just to make sure that we're talking about the same thing; I don't know at all how that popup gets created) if I crash the DLL through a division by 0:What's the best way of finding out which line of Python code makes the call to a DLL API that causes an error? Often I have the problem that I detect an error using the debug DLL and it turns out that the actual cause is a wrong function call from Python. Obviously the call stack in the DLL does not help in finding this out.
My best idea is to throw an error in the DLL (even if it is just temporarily inserted code) that causes a Python stacktrace which allows to locate the responsible call. But how to best throw such an error in C++?
Thanks! It works perfect!@Zeta Nexus: That's done through the multiple command line option of the EXE. So one just needs to edit the shortcut that launches the mod. (Or, for debugging, add it to the LocalDebuggerCommandArguments in Visual Studio.)

You could try using a NULL pointer exception.I'm getting a Python stacktrace (screenshot attached just to make sure that we're talking about the same thing; I don't know at all how that popup gets created) if I crash the DLL through a division by 0:
int xx=0; xx/=xx;
CvUnit *pUnit = NULL;
pUnit->reset();
GC.getUnitInfo(NO_UNIT).getType();
That works for me with a release build.You could try using a NULL pointer exception.
PHP:CvUnit *pUnit = NULL; pUnit->reset();