Zlatko
CIW
Thank you Platy. 

Platyping had it right. It's only that second bit (the part that I expressed in code blocks on my last post) that is completely irrelevant and should just be removed.@Thunderbrd
Thanks for answer,
How i am understand you:
1) This code
PHP:/*************************************************************************************************/ /* UNOFFICIAL_PATCH 06/02/10 LunarMongoose */ /* */ /* User interface */ /*************************************************************************************************/ // Mongoose FeatureDamageFix else if (iDamage < 0) { szString.append(CvWString::format(SETCOLR, TEXT_COLOR("COLOR_POSITIVE_TEXT"))); szString.append(NEWLINE); szString.append(gDLL->getText("TXT_KEY_PLOT_DAMAGE", iDamage)); szString.append(CvWString::format( ENDCOLR)); } /*************************************************************************************************/ /* UNOFFICIAL_PATCH END */ /*************************************************************************************************/ } /*****************************************************************************************************/ /** Author: TheLadiesOgre **/ /** Date: 15.10.2009 **/ /** ModComp: TLOTags **/ /** Reason Added: Display information regarding terrain damage **/ /** Notes: **/ /*****************************************************************************************************/ if (pPlot->getTerrainType() != NO_TERRAIN) { int iDamage = GC.getTerrainInfo(pPlot->getTerrainType()).getTurnDamage(); if (iDamage > 0)
replace with your in answer:
PHP:/*************************************************************************************************/ /* UNOFFICIAL_PATCH 06/02/10 LunarMongoose */ /* */ /* User interface */ /*************************************************************************************************/ // Mongoose FeatureDamageFix else if (iDamage < 0) { szString.append(CvWString::format(SETCOLR, TEXT_COLOR("COLOR_POSITIVE_TEXT"))); szString.append(NEWLINE); szString.append(gDLL->getText("TXT_KEY_PLOT_DAMAGE", iDamage)); szString.append(CvWString::format( ENDCOLR)); } /*************************************************************************************************/ /* UNOFFICIAL_PATCH END */ /*************************************************************************************************/
in this case just live UNOFFICIAL_PATCH.
Please correct me if I don't understand you correctly
That's what it appeared to me to need yes.2) First ("ORIGINAL:") comes before Second ("NEW CODE, MUST MERGE WITH ORIGINAL:"), after last line of First, i must add all from Second.
Yeah, one segment at a time there and I can be of more assistance.3) I hate CvUnitAI.cpp, i really understand you because you unable to help me about this #3 problem, if is necessary i will merge this file one week, step by step, post part by part how i merge this, you or some other (if help come) will rectify me.
That's correct. The order of the functions as they are declared in the .h file does not require that the order the functions are written in the .cpp file match. I can declare 'getSomething()' then 'getSomethingElse()' in the .h file but put 'getSomethingElse()' before 'getSomething()' in the .cpp file and it won't cause problems.You say:"Interestingly enough, the order in which functions are delivered into the code is unimportant - only that they are all declared properly in the header files."
If in .h files are OK, it is not important which code come first, which later?
Yeah, that file is usually tough due to it being one of the more complex files. WinMerge tries to be helpful but sometimes its able to match up too much that throws its assumptions out of whack causing it to assume an intent to merge code that isn't at all similar.And i am use WinMerge to merge this. But CvUnitAI.cpp is really hard to merge via this way.
if (AI_load(UNITAI_ASSAULT_SEA, MISSIONAI_LOAD_ASSAULT, NO_UNITAI, -1, -1, -1, -1, MOVE_SAFE_TERRITORY, 1))
{
return;
}
if (AI_heal())
{
return;
}
if (AI_guardCity(false, true, 2))
{
return;
}
if (AI_load(UNITAI_ASSAULT_SEA, MISSIONAI_LOAD_ASSAULT, NO_UNITAI, -1, -1, -1, -1, MOVE_SAFE_TERRITORY, 1))
{
return;
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 20.10.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Try to ensure AI_barbAttackMove doesn't choose to heal on damaging terrain **/
/** Notes: **/
/*****************************************************************************************************/
if ((GC.getTerrainInfo(plot()->getTerrainType()).getTurnDamage() == 0) || (plot()->isCity()))
{
if (AI_heal())
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 20.10.2009; TLOTags **/
/*****************************************************************************************************/
if (AI_guardCity(false, true, 2))
{
return;
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 20.10.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Try to ensure AI_attackMove doesn't choose to heal on damaging terrain **/
/** Notes: **/
/*****************************************************************************************************/
if ((GC.getTerrainInfo(plot()->getTerrainType()).getTurnDamage() == 0) || (plot()->isCity()))
{
if (AI_heal(30, 1))
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 20.10.2009; TLOTags **/
/*****************************************************************************************************/
if (!bDanger)
{
if (AI_group(UNITAI_SETTLE, 1, -1, -1, false, false, false, 3, true))
{
return;
}
if (AI_group(UNITAI_SETTLE, 2, -1, -1, false, false, false, 3, true))
{
return;
}
}
if (AI_guardCityAirlift())
{
return;
}
if( !(plot()->isOwned()) || (plot()->getOwnerINLINE() == getOwnerINLINE()) )
{
if( area()->getCitiesPerPlayer(getOwnerINLINE()) > GET_PLAYER(getOwnerINLINE()).AI_totalAreaUnitAIs(area(), UNITAI_CITY_DEFENSE) )
{
// Defend colonies in new world
if (AI_guardCity(true, true, 3))
{
return;
}
}
}
if (AI_heal(30, 1))
{
return;
}
if (!bDanger)
{
if (AI_group(UNITAI_SETTLE, 1, -1, -1, false, false, false, 3, true))
{
return;
}
if (AI_group(UNITAI_SETTLE, 2, -1, -1, false, false, false, 3, true))
{
return;
}
}
if (AI_guardCityAirlift())
{
return;
}
if( !(plot()->isOwned()) || (plot()->getOwnerINLINE() == getOwnerINLINE()) )
{
if( area()->getCitiesPerPlayer(getOwnerINLINE()) > GET_PLAYER(getOwnerINLINE()).AI_totalAreaUnitAIs(area(), UNITAI_CITY_DEFENSE) )
{
// Defend colonies in new world
if (AI_guardCity(true, true, 3))
{
return;
}
}
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 20.10.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Try to ensure AI_attackMove doesn't choose to heal on damaging terrain **/
/** Notes: **/
/*****************************************************************************************************/
if ((GC.getTerrainInfo(plot()->getTerrainType()).getTurnDamage() == 0) || (plot()->isCity()))
{
if (AI_heal(30, 1))
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 20.10.2009; TLOTags **/
/*****************************************************************************************************/
if (!bDanger)
{
if (AI_group(UNITAI_SETTLE, 1, -1, -1, false, false, false, 3, true))
{
return;
}
if (AI_group(UNITAI_SETTLE, 2, -1, -1, false, false, false, 3, true))
{
return;
}
}
if (AI_guardCityAirlift())
{
return;
}
if( getGroup()->getNumUnits() < 4 )
{
if (AI_choke(1))
{
return;
}
}
/*************************************************************************************************/
/** BETTER_BTS_AI_MOD END */
/*************************************************************************************************/
}
if (AI_goody(3))
{
return;
}
if (AI_anyAttack(1, 70))
{
return;
}
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 16.09.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Implement AI_paradrop for other UNITAI's now that it is potentially available **/
/** Notes: 14.10.2009-- Moved higher and added bCity check **/
/*****************************************************************************************************/
bool bCity = plot()->isCity();
if (bCity)
{
if (AI_paradrop(getDropRange()))
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 16.09.2009; TLOTags **/
/*****************************************************************************************************/
{
PROFILE("CvUnitAI::AI_attackMove() 2");
if (bDanger)
{
if (AI_cityAttack(4, 30))
{
return;
}
if( getGroup()->getNumUnits() < 4 )
{
if (AI_choke(1))
{
return;
}
}
if (AI_cityAttack(4, 30))
{
return;
}
Why should terrain damage check be == 0 when it should be < 1, since previously it is already stated it could be negative resulting in healing terrain.
It is still possible that the terrain damage is low enough that the territory heal rate + promotions will outheal the damage.
No considerations given to fort either
Code:if (pPlot->getTerrainType() != NO_TERRAIN) { int iDamage = GC.getTerrainInfo(pPlot->getTerrainType()).getTurnDamage(); if (iDamage > 0) { szString.append(CvWString::format(SETCOLR, TEXT_COLOR("COLOR_NEGATIVE_TEXT"))); szString.append(NEWLINE); szString.append(gDLL->getText("TXT_KEY_PLOT_DAMAGE", iDamage)); szString.append(CvWString::format( ENDCOLR)); } else if (iDamage < 0) { szString.append(CvWString::format(SETCOLR, TEXT_COLOR("COLOR_POSITIVE_TEXT"))); szString.append(NEWLINE); szString.append(gDLL->getText("TXT_KEY_PLOT_DAMAGE", iDamage)); szString.append(CvWString::format( ENDCOLR)); }
He meant this...
The second portion is more or less redundant unless you have terrains that actually heal rather than damage
if (bDanger)
{
if (AI_pillageRange(1, 20))
{
return;
}
if (AI_cityAttack(1, 35))
{
return;
}
if (AI_anyAttack(1, 45))
{
return;
}
if (AI_pillageRange(3, 20))
{
return;
}
if( getGroup()->getNumUnits() < 4 )
{
if (AI_choke(1))
{
return;
}
}
if (AI_cityAttack(4, 30))
{
return;
}
if (AI_anyAttack(2, 40))
{
return;
}
}
if (bDanger)
{
if (AI_pillageRange(1, 20))
{
return;
}
if (AI_cityAttack(1, 35))
{
return;
}
if (AI_anyAttack(1, 45))
{
return;
}
if (AI_pillageRange(3, 20))
{
return;
}
/*************************************************************************************************/
/** BETTER_BTS_AI_MOD 02/11/09 jdog5000 */
/** */
/** Unit AI */
/*************************************************************************************************/
if( getGroup()->getNumUnits() < 4 )
{
if (AI_choke(1))
{
return;
}
}
/*************************************************************************************************/
/** BETTER_BTS_AI_MOD END */
/*************************************************************************************************/
}
if (AI_goody(3))
{
return;
}
if (AI_anyAttack(1, 70))
{
return;
}
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 16.09.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Implement AI_paradrop for other UNITAI's now that it is potentially available **/
/** Notes: 14.10.2009-- Moved higher and added bCity check **/
/*****************************************************************************************************/
bool bCity = plot()->isCity();
if (bCity)
{
if (AI_paradrop(getDropRange()))
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 16.09.2009; TLOTags **/
/*****************************************************************************************************/
{
PROFILE("CvUnitAI::AI_attackMove() 2");
if (bDanger)
{
if (AI_cityAttack(4, 30))
{
return;
}
if (AI_anyAttack(2, 40))
{
return;
}
}
if (!isEnemy(plot()->getTeam()))
{
if (AI_heal())
{
return;
}
}
if (!isEnemy(plot()->getTeam()))
{
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 20.10.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Try to ensure AI_attackMove doesn't choose to heal on damaging terrain **/
/** Notes: **/
/*****************************************************************************************************/
if ((GC.getTerrainInfo(plot()->getTerrainType()).getTurnDamage() == 0) || (plot()->isCity()))
{
if (AI_heal())
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 20.10.2009; TLOTags **/
/*****************************************************************************************************/
}
if (AI_protect(35, 5))
{
return;
}
if (AI_offensiveAirlift())
{
return;
}
if (AI_protect(35, 5))
{
return;
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 16.09.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Implement AI_paradrop for other UNITAI's now that it is potentially available **/
/** Notes: 14.10.2009-- Added bCity check **/
/*****************************************************************************************************/
if (bCity)
{
if (AI_paradrop(getDropRange()))
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 16.09.2009; TLOTags **/
/*****************************************************************************************************/
if (AI_offensiveAirlift())
{
return;
}
if (bHostile)
{
if (AI_choke(1))
{
return;
}
}
if (AI_heal())
{
return;
}
if (AI_retreatToCity())
{
return;
}
if (bHostile)
{
if (AI_choke(1))
{
return;
}
}
/*****************************************************************************************************/
/** Author: TheLadiesOgre **/
/** Date: 20.10.2009 **/
/** ModComp: TLOTags **/
/** Reason Added: Try to ensure AI_paratrooperMove doesn't choose to heal on damaging terrain **/
/** Notes: **/
/*****************************************************************************************************/
if ((GC.getTerrainInfo(plot()->getTerrainType()).getTurnDamage() == 0) || (plot()->isCity()))
{
if (AI_heal())
{
return;
}
}
/*****************************************************************************************************/
/** TheLadiesOgre; 20.10.2009; TLOTags **/
/*****************************************************************************************************/
if (AI_retreatToCity())
{
return;
}
Haven't had much time to take a look but I haven't forgotten ya. Will return to review when I can here.
hey friend,
i see you work hard on the sdk,
why not use what i already did and about to release?
this is what it includes:
1. jculture and j improvement mods (its instead of super forts - u can replace it with super by compare )
2. hated civs/favorite civs
3. fresh water mod - water from improvements + no fresh water from lakes or ocean
4. extended mountains mod - aloow pass on mountains, improvements tags and resources.
5. free tech from building tag
6. city unit and city size prereq
7. terrain health good/bad
8. unit prereq civic
9. specialist hsppiness/unhappiness
10. 50 civs on a map
11. woc tga index
12. unique civ project
13. project free unit
14. project help tag
15. kmod 1.41
16. slavery mod
17. extra pillage - 1.6
18. replaceble buildings
19. tlo promotion tags
20. native route mod
21. Civic Specialist Yield & Commerce Chan
22. platyping user interface / or bug interface (u can choose)
@Thunderbrd and @God-Emperor:
I will post here source files + mod (this is not CiW mod, this is only my test for this new files, because i am not merge this files with my mod) mod name is "PROVERA_JEZGRA", unpack it and test. And tell me everything where i am wrong, i want to learn how to fix this types of problems.
And one question about XML Schema, Schema have rules for more than one XML files, how i can know where which file start, and how to edit schema where add new tags? I give tag name which i want, or tag name from SDK files?