1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Version 1.3 discussion thread

Discussion in 'Civ4 - Unofficial Patches' started by jdog5000, Oct 30, 2009.

  1. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Changes in this version:

    Spoiler :

    Version 1.30 changes:

    - CvPlayerAI::AI_bestTech - Fixed potential rare crash bug in mods where units with no transport capacity can upgrade to units with transport capacity (thanks Afforess)
    - CvGameTextMgr::getOtherRelationsString - Fixed potential issue revealing names of civs you haven't met yet (thanks Emperor Fool)
    - CvCity::popOrder - Fixed issue introduced by prior attempt to fix handling of buildings with player limits. Building classes which set iMaxPlayerInstances should now work correctly regardless of what iExtraPlayerInstances is set to. (thanks ztjal)
    - CvPlayerAI::AI_civicValue - Fixed crash bug in multi-player simultaneous turns games created by necessary re-timing of AI_doSplit (thanks to TheOnlyDJCat for debugging help)
    - CvPlayer::canDoCivics - Same as above
    - CvUnit::maxCombatStr - Handled very rare case where pointer might not be properly set when loading simultaneous turns game in hotseat
    - CvPlayer::canFound - Fixed several issues for mods using the python callback to allow founding cities on water tiles (thanks Emperor Fool)
    - CvPlayerAI::AI_getHealthWeight - Fixed bug for mods where civics with negative iExtraHealth were evaluated incorrectly (thanks phungus420)
    - CvPlayerAI::AI_getHappinessWeight - Fixed bug for mods where civics with negative happiness effects from troops, largest cities, or war weariness were evaluated incorrectly
    - CvPlayerAI::AI_civicValue - Changes so that civics valuation works properly with above changes
    - CvCity::setBuildingHealthChange - Fixed several copy/paste and logic bugs affecting bonus building health from events, especially after city conquest (thanks Emperor Fool)
    - CvCity::setBuildingHappyChange - Fixed several logic bugs affecting bonus building health from events, especially after city conquest
    - CvPlot::doFeature - Plot feature (Forest/jungle) appearance now scales by game speed
    - CvPlot::doImprovement - Bonus appearance in mines now scales by game speed
    - CvAdvisorUtils.py - Blocked city liberation popup if you haven't met liberation player (reported by r_rolo1)
    - CvPlayer::canTradeItem - You can now ask AI members of your own team to change religion or civics (thanks denev)
    - CIV4EventTriggerInfos.xml - EVENTTRIGGER_SPY_DISCOVERED now requires you have a spy, fixes issue where event would fire with no espionage enabled and your only choice was war
    - CvCity::init - Building a city on floodplains no longer removes floodplains, they'll still be there if city is destroyed (from Mongoose SDK)
    - CvUnit::convert - Fixed potential issue in mods where units with transport capacity might upgrade to units without (from Mongoose SDK)
    - CvUnit::canLoadUnit - Block units which are on another transport from taking on cargo of their own (from Mongoose SDK)
    - CvUnit::shouldLoadOnMove - Fixed issue with all terrain land units moving onto water tiles with transports in them (from Mongoose SDK)
    - CvUnit::canAirDefend - Land units which are on transports can no longer defend against air attacks (from Mongoose SDK)
     
  2. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Great Work Jdog! Looks great!
     
  3. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    I'm curious about this one:

    Code:
    bool CvUnit::canLoadUnit(const CvUnit* pUnit, const CvPlot* pPlot) const
    {
    	FAssert(pUnit != NULL);
    	FAssert(pPlot != NULL);
    
    	if (pUnit == this)
    	{
    		return false;
    	}
    
    	if (pUnit->getTeam() != getTeam())
    	{
    		return false;
    	}
    
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                       10/30/09                     Mongoose & jdog5000      */
    /*                                                                                              */
    /* Bugfix                                                                                       */
    /************************************************************************************************/
    	// From Mongoose SDK
    	if (isCargo())
    	{
    		return false;
    	}
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                        END                                                  */
    /************************************************************************************************/
    
    	if (getCargo() > 0)
    	{
    		return false;
    	}
    
    Is it always going to be the case that transports cannot be put on transports? Suppose I wanted to ... I don't know... load some APCs loaded with infantry on a water-based transport. Wouldn't this logic prevent that? Am I missing something?
     
  4. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    This is from the Mongoose SDK mod, described as follows:

    "Fixes an annoying but harmless vanilla bug where the Load button still appears for a unit already being carried by a transport (though hitting it does nothing)."
     
  5. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Oh of course. I remember seeing that description.

    Anyway, I suppose any modder who wants to change transports would be clever enough to alter that code so it's not a big deal.
     
  6. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    As a consequence of the change to canLoadUnit, you can no longer make chains of transports because you cannot transfer units between transports. Some mightn't appreciate that, but I think it's a good change.

    I wonder if there's any other consequences...
     
  7. GravityWave

    GravityWave Deposed Emperor

    Joined:
    Mar 25, 2008
    Messages:
    290
    Gender:
    Male
    Location:
    England
    Great work, much appreciated. Many thanks. :worship:

    I personally don't mind the changes to loadunit either, and think its the right call.
     
  8. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    Extra overflow production bug is still available.
    There is my sample code to fix it.

    I do not have certainty this is best way, but I hope it may make some help.
     

    Attached Files:

  9. Shurdus

    Shurdus Am I Napoleon?

    Joined:
    Feb 24, 2004
    Messages:
    2,301
    Location:
    Settle in place
    So if I had the previous one installed and I want to update, do I simply overwrite whatever my pc asks me to or do I install the entire game all ovr again?
     
  10. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Overwriting the previous installation should be fine.

    I am assuming you had it installed as a mod. If you overwrote your original game files that would be a :nono: but the same advice would still apply - you'd still just need to overwrite.
     
  11. Elkad

    Elkad Chieftain

    Joined:
    Mar 26, 2007
    Messages:
    977
    No reallocation of guided missiles and tac nukes amongst my fleet. Either to free a ship to go pick up more, or to distribute them to ships that aren't defending or attacking. Big change.

    I guess moving troops off partially-loaded transports (making them defend sooner, or able to leave to pick up more units) is affected as well.

    This seems like a huge naval gameplay change. While I like the idea, I don't think it belongs in the UP.
     
  12. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    If I understand well the code , I have to agree with Elkad. The code you inserted does not make what it was intended for it to do ( block the load button for units that are in a loaded transport inside of another transport ), it simply forbids a unit that is in a transport to be loaded into another transport in the same tile. From what you said, I guess this was not what you meant to do ...
     
  13. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Yep, gameplay change, and should not be in the UP. I also hope it doesn't go in RevDCM (which allows gameplay changes), as this is a change I don't agree with.
     
  14. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Well, fortunately the sdk change you have to avoid is a very simple one, as outlined in my post above. Whether it IMO belongs in the UP or not I won't say, but it it's pretty trivial to change regardless.

    I must say, that while I think many of LunarMongoose's ideas are fantastic, :mischief: the implementation is also fantastic. :p
     
  15. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Alright, I'll roll that one back. It sounded good, but it is not just fixing what was intended.
     
  16. Sephi

    Sephi Chieftain

    Joined:
    Jan 25, 2009
    Messages:
    2,908
    This is from CvCity::init

    Code:
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                       10/30/09                     Mongoose & jdog5000      */
    /*                                                                                              */
    /* Bugfix                                                                                       */
    /************************************************************************************************/
    /* original bts code
    		if (pPlot->getFeatureType() != NO_FEATURE)
    */
    		// From Mongoose SDK
    		// Don't remove floodplains from tiles when founding city
    		if ((pPlot->getFeatureType() != NO_FEATURE) && (pPlot->getFeatureType() != (FeatureTypes)GC.getInfoTypeForString("FEATURE_FLOOD_PLAINS")))
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                        END                                                  */
    /************************************************************************************************/
    
    you sure you want to use GC.getInfoTypeForString and not a GC.getDefineINT for the floodplains feature?
     
  17. LunarMongoose

    LunarMongoose Chieftain

    Joined:
    Jan 29, 2006
    Messages:
    721
    Gender:
    Male
    Location:
    Boston, MA, USA
    My bad on the canLoadUnit() unintended consequences guys, and good job spotting that. I'll see if there's a better way to fix the Load button cuz it really bothers me heh. And... no need to be so harsh PieceOfMind, geez. ;)
     
  18. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    fixed. ;)

    A better load button would be awesome by the way. :goodjob:
     
  19. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    I intend to "Fixes an annoying but harmless vanilla bug where the Load button still appears for a unit already being carried by a transport (though hitting it does nothing)."
    I believe this doesn't change game rules and good for Unofficial Patch.

    Already be carried unit can access to the Load button only when other loadable vassal exists in the same tile (except for in the city because you can unload units in the city.)
    How do you think, everyone?
    Spoiler :
    Code:
    bool CvUnit::canLoadUnit(const CvUnit* pUnit, const CvPlot* pPlot) const
    {
    	FAssert(pUnit != NULL);
    	FAssert(pPlot != NULL);
    
    	if (pUnit == this)
    	{
    		return false;
    	}
    
    	if (pUnit->getTeam() != getTeam())
    	{
    		return false;
    	}
    
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                       10/30/09                     Mongoose & jdog5000      */
    /*                                                                                              */
    /* Bugfix                                                                                       */
    /************************************************************************************************/
    	// From Mongoose SDK
    	if (isCargo()[COLOR="Blue"] && (pPlot->isCity(true) || getTransportUnit() == pUnit)[/COLOR])
    	{
    		return false;
    	}
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                        END                                                  */
    /************************************************************************************************/
     
  20. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    I'm not sure I understand the logic there.

    To me, it looks like you're saying if a unit is cargo and it is either on a city plot (including forts) or it is a transport then it cannot be loaded.

    If I had a unit as cargo in a ship sitting in a city, it should be loadable onto another transport on the same plot.

    Am I misunderstanding?
     

Share This Page