Promotions DLL

there maybe is an asserts error in your current version (line marked bold):

Assert Failed

File: CvInfos.cpp
Line: 2514
Expression: false
Message:

Code:
/*****************************************************************************************************/
/**  Author: TheLadiesOgre                                                                          **/
/**  Date: 21.09.2009                                                                               **/
/**  ModComp: TLOTags                                                                               **/
/**  Reason Added: New Tag Definition                                                               **/
/**  Notes:                                                                                         **/
/*****************************************************************************************************/
bool CvPromotionInfo::readPass3()
{
	if (m_aszExtraXMLforPass3.size() < 1)
	{
		[b]FAssert(false);[/b]
		return false;
	}

	m_iCivicPrereq = GC.getInfoTypeForString(m_aszExtraXMLforPass3[0]);
	m_aszExtraXMLforPass3.clear();

	return true;
}
/*****************************************************************************************************/
/**  TheLadiesOgre; 21.09.2009; TLOTags                                                             **/
/*****************************************************************************************************/
 
That's all been peeled out and reworked, I should be updating if not today, tomorrow, so if you can wait just a little while longer...
 
sorry can you help me? (CvUnit.cpp)

what does this do?

Code:
/*****************************************************************************************************/
/**  Author: Xienwolf (Imported by TheLadiesOgre)                                                   **/
/**  Date: 1.10.2009                                                                                **/
/**  ModComp: TLOTags                                                                               **/
/**  Reason Added: Allow bAutoAcquire & bMustMaintain                                               **/
/**  Notes: This is a direct import of code from FallFurther.                                       **/
/*****************************************************************************************************/
		if (isHasPromotion((PromotionTypes)iI) && GC.getPromotionInfo((PromotionTypes)iI).isMustMaintain() && !canAcquirePromotion((PromotionTypes)iI) && !m_pUnitInfo->getFreePromotions(iI))
		{
			setHasPromotion(((PromotionTypes)iI), false);
		}

		if (GC.getPromotionInfo((PromotionTypes)iI).isAutoAcquire() && canPromote((PromotionTypes)iI, -1))
		{
			promote(((PromotionTypes)iI), -1);
		}
/*****************************************************************************************************/
/**  TheLadiesOgre; 01.10.2009; TLOTags                                                             **/
/*****************************************************************************************************/

I have problems with merging it with:

Code:
	//
	// Mongoose PromotionRefundFix BEGIN
	//
	int iLevel = pUnit->getLevel();
	for (int iI = 0; iI < GC.getNumPromotionInfos(); iI++)
	{
		if (pUnit->isHasPromotion((PromotionTypes)iI) && !m_pUnitInfo->getFreePromotions(iI) && ((PromotionTypes)iI != (PromotionTypes)GC.getInfoTypeForString("PROMOTION_AGGRESSION")) && ((PromotionTypes)iI != (PromotionTypes)GC.getInfoTypeForString("PROMOTION_TENACITY")) && ((PromotionTypes)iI != (PromotionTypes)GC.getInfoTypeForString("PROMOTION_SEAFARING")))
		{
			if (isPromotionValid((PromotionTypes)iI) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_COMBAT_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_SHOCK_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_COVER_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_PINCH_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_CITY_RAIDER_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_DRILL_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_CITY_GARRISON_EVENT")) || ((PromotionTypes)iI == (PromotionTypes)GC.getInfoTypeForString("PROMOTION_FLANKING_EVENT")))
			{
				setHasPromotion((PromotionTypes)iI, true);
			}
			else
			{
				iLevel--;
			}
		}
	}
	setLevel(iLevel);
	//
	// Mongoose PromotionRefundFix END
	//
 
you are adding so many things now... you should really merge it with the better bts ai sources. It becomes difficult now for other modders. its hard for me to merge CvUnitAI.cpp
 
compiling error....

1>CvUnit.cpp(11307) : error C2296: '>=' : illegal, left operand has type 'int (__thiscall CvUnit::* )(void) const'

Code:
void CvUnit::changeNoXPCount(int iChange)
{
	m_iNoXPCount += iChange;
	[B]FAssert(getNoXPCount >= 0);[/B]
}


always the () missing :D ........ do you really compile it (a debug dll) yourself? :D
 
sorry for spam but anything seems to be broken with your modcomp. just tried to play your stock modcomp because of game loading errors with my mod and see what happens when I try to start your mod (without any changes/additions) 0.40:

attachment.php


I guess it has something do to with your CIV4UnitSchema.xml or source code related to it.

Please release stable modcomps. :P
 
Icky, Cybah, your DLL is hardcoded? You could just insert a Python callback there and handle it that way. Or generalize the functionality into an XML tag even. It appears that you are trying to make certain promotions NOT advance a unit's level, so a simple <bNoLevelUp> tag would accomplish that. Though such promotions can probably be modeled as bNoXP and AutoAcquire under this new system, just tossing in some Prereq fields to apply them at the proper moments.


Anyway, those snippets you asked about are used to apply or remove promotions which the unit is allowed to gain, or no longer allowed to keep, if the promotions are tagged. Your code would be ideally merged into the same loop over all promotions should you maintain it as written to save a loop, but otherwise they don't really interact much.
 
you are adding so many things now... you should really merge it with the better bts ai sources. It becomes difficult now for other modders. its hard for me to merge CvUnitAI.cpp

rebuilt on BBAI v0.81

always the () missing :D ........ do you really compile it (a debug dll) yourself? :D

I don't believe in pre-emptive strikes, so I've only built one debug, funny thing is, I figured out what was wrong without it

I guess it has something do to with your CIV4UnitSchema.xml or source code related to it.

Please release stable modcomps. :P

It was stable and is still stable, there was a simple two-line error in the schema, sorry, I made a lastminute change, though not throughly enough, it has been corrected.
 
Wow great new stuff i`ll deffinetly find use for some of them:goodjob:. But when I loaded your mod unchanged i got a AIAutoPlay error with a missing file, is it something important or it doesnt matter the error doesnt affect much? :confused:
Once again great job, and like I said i`ll take some of them for my mod:mischief:
 
It seems to be a Warning related to the AiAutoPlay.ini file missing and then it says to check the mod folder
EDIT: The fix you provided in your last post works fine now, thanks.
 
Icky, Cybah, your DLL is hardcoded? You could just insert a Python callback there and handle it that way. Or generalize the functionality into an XML tag even. It appears that you are trying to make certain promotions NOT advance a unit's level, so a simple <bNoLevelUp> tag would accomplish that. Though such promotions can probably be modeled as bNoXP and AutoAcquire under this new system, just tossing in some Prereq fields to apply them at the proper moments.


Anyway, those snippets you asked about are used to apply or remove promotions which the unit is allowed to gain, or no longer allowed to keep, if the promotions are tagged. Your code would be ideally merged into the same loop over all promotions should you maintain it as written to save a loop, but otherwise they don't really interact much.

Well, this is part of mongoose SDK. what the promotion fix does (not sure about this part) is giving free xp if any promotion gets removed through unit upgrade. Now I guess, this part is only needed in HIS (mongoose's) mod cause it only affects the following promotions right?

PROMOTION_AGGRESSION, PROMOTION_TENACITY, PROMOTION_SEAFARING

I don't have those promotions in my mod at all. :lol:



@TheLadiesOgre: thanks for merging :)
 
Correct, and normally hardcoding breaks mods which don't have the hardcoded element, which is why it is to be avoided. This particular part is harmless since the check will never pass if you removed those promos, but should you happen to use those precise names in the future, your new promotions will act a bit odd. Since you don't need it, I greatly advice removing it :)
 
What's up mate? Still alive?

Found another bug in your modcomp (every city starts with +4 celebrity (without real +4 happy)) - do not know, what is causing this (your stock bbai modcomp without additions):

attachment.php
 
What's up mate? Still alive?

Found another bug in your modcomp (every city starts with +4 celebrity (without real +4 happy)) - do not know, what is causing this (your stock bbai modcomp without additions)

Yeah, funny you should ask, caught H1N1 (still alive though, just felt like the walking dead for a little), and my laptop went to hell in a handbasket (thanks to my two year old thinking it needed its hair washed), I've been reduced to checking e-mail and such on either public computers or my cousins. I lost everything, I'll have to see what I can do, but I wouldn't bank on any updates or fixes soon. Sorry.
 
Back
Top Bottom