Mod-Modders Guide to Fall Further

Opera: Yes, both require DLL work (basically anything I ever recommend does, on account of me not liking python much :p)

Sephi: You could try something along the lines of GC.getBuildTypeInfo(eBuildType).getDescription(), but I try to avoid these because most of the time I am logging to troubleshoot a crash, and if the crash is an out of bounds enum, then my logging output will cause the crash instead of giving me data just before the crash. For your purposes that might not be an issue.

shoggi: You could try using the Scenario Counter. My personal opinion (warning, see earlier comment about hating python) is that saving information is far easier in the DLL, so you might as well mod there instead, it really isn't that hard.
 
But the DLL is scary, so scary! :cry:
For now, I'm starting to understand everything I read in it... but the step I have to do to mod it is quite hard. I should try to copy a boolean tag, following your thread. It's just scary, scary, scary.
 
Sephi: You could try something along the lines of GC.getBuildTypeInfo(eBuildType).getDescription(), but I try to avoid these because most of the time I am logging to troubleshoot a crash, and if the crash is an out of bounds enum, then my logging output will cause the crash instead of giving me data just before the crash. For your purposes that might not be an issue.
Thanks, great. Some things do cause crashes though, for example getUnitCombatInfo(unit).getDescription() from a Unit that has no UnitCombat, but it will do :-)
 
thanks for the tip with the scenario counter. im using that for now, til i get a good look at what i need to make it work in the dll and compile it.

anyway, one more question from me:
is there an easy way to identify "equipment units"? or do i have to do it one by one, if i want to exclude them from something. I was hoping that you used bMechanized to indicate them, but that seems to be on all vehicles too.

does that do anything in FF anyway? i remember reading that it didn't do anything in vanilla civ. i assume in this mod it makes them "not alive".
 
Equipment Promotions seem to use
<bEquipment>1</bEquipment>
But that doesn't include the new Gear Promotions.
 
I know that the promotions have bEquipment, what i'm looking for is something to identify the equipment units which you can capture that give you the promotions, like orthus axe, the gela and stuff.
Because the civ i am working on does some stuff if their units kill something, and i don't want it to work on the athame for example.
<Combat>None</Combat> sadly doesn't work either since not all of them have it but some other units (like auric or skeletons) do use it.
 
Mechanized is just used as a NotAlive flag in FfH/FF as I recall. Not really an easy way to identify the equipment items, but you could check for NotAlive and BaseCombatStr == 0, that might do it for you (at least well enough)
 
Would it be possible to get the improved code for ranged xp calculation?
I think I have updated my dll to patch N tweaks, but I think this fix is not included. Seems (jundging from the sidar threads) that it is working exactly the same way in FF and Orbis.

I am aiming for a 0.23 release this weekend and would like to include it if you have already fixed it. Prefer not to repeat work already done (especuially that dll still comes hard for me) ;)
 
Vehem's work, so not sure precisely where you need to be, but this ought to be it:

Code:
/*************************************************************************************************/
/**	Vehem Tweak							03/11/09	 											**/
/**																								**/
/**		Allows ranged strikes to grant experience, controlled by global define					**/
/*************************************************************************************************/
/**								---- Start Original Code ----									**
	iUnitDamage = std::max(pDefender->getDamage(), std::min((pDefender->getDamage() + iDamage), airCombatLimit()));
/**								----  End Original Code  ----									**/
	int iInitialUnitDamage = pDefender->getDamage();
	iUnitDamage = std::max(iInitialUnitDamage, std::min((iInitialUnitDamage + iDamage), airCombatLimit()));
	int iXPPercent = GC.getDefineINT("RANGE_COMBAT_XP_PERCENTAGE");
	if (iXPPercent > 0)
	{
		changeExperience(iUnitDamage * iXPPercent, -1, false, false, false);
	}
/*************************************************************************************************/
/**	Tweak									END													**/
/*************************************************************************************************/

In CvUnit::rangeStrike(int iX, int iY)
 
Thanks a lot for posting it :)
Unfortunatelly, it is the current code I have (well, with /100 in the last line) and it still causes ranged attacks to provide more xp if the unit was already wounded. :(
 
if (iXPPercent > 0)
{
/*********************************************************************/
/** ADDON Sephi ERAMOD **/
if (iUnitDamage>iInitialUnitDamage)
{
changeExperience((iUnitDamage-iInitialUnitDamage) * iXPPercent, -1, false, false, false);
}
/** ADDON End **/
/*********************************************************************/
}
 
They are set in CvEventmanager.py
def onBeginPlayerTurn(self, argsList):
 
I did quite a lot of performance debugging the last days and I think most of performance problems are the result of many units not making groups. Demons and other creatures. I am not even sure if the barb groups are real groups.
 
Back
Top Bottom