RFC Modding Central

is zero one of the numbers that can be returned by getSorenRandNum? ie does getSorenRandNum(3) produce a number between 1 and 3 or 0 and 3?
 
is zero one of the numbers that can be returned by getSorenRandNum? ie does getSorenRandNum(3) produce a number between 1 and 3 or 0 and 3?

IIRC it's the floor of the outcome in a [0,x) interval
So the outcome for getSorenRandNum(x) is between 0 and (x-1)
It should be 0, 1, and 2 in this case
 
does anyone know what causes the "civ x has declared war on civ x" bug? it has appeared in my current project.

the code is:

Code:
szBuffer = gDLL->getText("TXT_KEY_MISC_SOMEONE_DECLARED_WAR", GET_PLAYER((PlayerTypes)getID()).getCivilizationDescription(), GET_PLAYER((PlayerTypes)eTeam).getCivilizationDescription());

which is from SoI, replacing the vanilla code which uses leader names. this gives me x has declared on x.

I can use this:

Code:
szBuffer = gDLL->getText("TXT_KEY_MISC_SOMEONE_DECLARED_WAR", GET_PLAYER((PlayerTypes)getID()).getCivilizationShortDescription(), GET_PLAYER((PlayerTypes)eTeam).getCivilizationShortDescription());

which is from DoC, and it works properly.

the text key is:

Code:
%s1_PlyrName [NUM1:has:has:have:have] declared war on %s2_PlyrName!

any insight appreciated. I remember that it also occurred in the last stable, pre-Kmod version of RFCE++
 
does anyone know what causes the "civ x has declared war on civ x" bug? it has appeared in my current project.

What's the actual bug here?
 
the in-game announcement says that civ x has declared war on itself rather than on the civ it has actually declared war on. thats what I meant by "x has declared war on x".
 
I want to fix a bug in RFCCW whereby capturing a stack of enemy workers when running the slavery civic only gives you 1 worker.

the way it works now is that the workers capture tag is "NONE" and the creation of the slave unit is all python and starts from "onCombatResult". if you aren't running the slavery civic python creates a worker, filling in for the missing capture mechanic. so the python just sees the top worker in the stack losing combat with enemy unit and misses the other workers.

so to fix this I could

1. insert something into CvUnit::kill(bool bDelay, PlayerTypes ePlayer)

like here maybe:

Code:
eCaptureUnitType = ((eCapturingPlayer != NO_PLAYER) ? getCaptureUnitType(GET_PLAYER(eCapturingPlayer).getCivilizationType()) : NO_UNIT);

and say right after that:

"if Civic = slavery and unit = worker then unit = slave" except I have no idea what the syntax would be and the unit types would have to be added to the DLL since they are not there now.

or

2. add an "onUnitCaptured" python method, which afaik doesn't exist in any mod.
 
1. Bring back <Capture>UNITCLASS_WORKER</Capture>

2. In CvUnit:kill, after this:
Code:
	if ((eCapturingPlayer != NO_PLAYER) && (eCaptureUnitType != NO_UNIT) && !(GET_PLAYER(eCapturingPlayer).isBarbarian()))
	{

add this:

Code:
		if (eCaptureUnitType == UNIT_WORKER && GET_PLAYER(eCapturingPlayer).getCivics(2) == CIVIC_SLAVERY)
		{
			eCaptureUnitType = UNIT_SLAVE;
		}

UNIT_WORKER/SLAVE and CIVIC_SLAVERY should be defined as constants somewhere, of course. That should be all.
 
thanks. in case anyone is referencing this, the syntax was slightly different:

Code:
		if (eCaptureUnitType == UNIT_WORKER && GET_PLAYER(eCapturingPlayer).getCivics((CivicOptionTypes)2) == CIVIC_SLAVERY)
		{
			eCaptureUnitType = ((UnitTypes)UNIT_SLAVE);
		}

and for the unit constants I just added them to the #defines at the beginning of CvRhyes.h
 
I've added this:

Code:
			if ((GET_PLAYER(getOwnerINLINE()).getUnitClassCount(eUnitClass)) >= ((pCity->getNumBonuses((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonus())) * 9))
			{
				return false;
			}

to CvPlot::canTrain to limit some units to a number per resource eg 9 horsemen per horse.

it seems to ignore the "*9" and just limit the unit to 1 per resource. I've moved the brackets around to no avail.
 
I'd like to be able to run the autoplay on normal speed and then switch to a slower speed once I spawn. I'm sure other RFC players would like this too. I can do it by opening WB, saving the game, text-editing the gamespeed in that file and reloading, but could it be done within the game?
 
Top Bottom