1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Promotions DLL

Discussion in 'Civ4 - Mod Components' started by TheLadiesOgre, Sep 2, 2009.

  1. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Too many files got modified.
     
  2. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    there maybe is an asserts error in your current version (line marked bold):

    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                                                             **/
    /*****************************************************************************************************/
    
     
  3. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    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...
     
  4. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Download and OP updated
     
  5. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    32,429
    Location:
    DE/NL/FR
    And why not with one or two pictures ;)?
     
  6. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Added screenshots of new button art from civilopedia pages, thank you for reminding me J
     
  7. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    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
    	//
    
     
  8. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    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
     
  9. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    compiling error....

    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
     
  10. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    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:



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

    Please release stable modcomps. :p
     
  11. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    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.
     
  12. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    rebuilt on BBAI v0.81

    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

    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.
     
  13. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    All modcomps are stable until someone finds a bug. ;)

    Also, Cybah, I would avoid hardcoding anything. It just causes problems down the road.
     
  14. Castor_Troy

    Castor_Troy Warlord

    Joined:
    Jun 4, 2007
    Messages:
    145
    Location:
    Romania
    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:
     
  15. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    It was related to the path, right?

    If it was here's the fix, dl has been amended as well
     

    Attached Files:

  16. Castor_Troy

    Castor_Troy Warlord

    Joined:
    Jun 4, 2007
    Messages:
    145
    Location:
    Romania
    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.
     
  17. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    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 :)
     
  18. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    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 :)
     
  19. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    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):

     
  20. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    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.
     

Share This Page