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

DLL - Various Mod Components

Discussion in 'Civ5 - Mod Components' started by whoward69, Nov 4, 2012.

  1. biship

    biship Warlord

    Joined:
    Dec 7, 2003
    Messages:
    186
    Ah, already addressed, nice.
     
  2. Lord DGP

    Lord DGP Chieftain

    Joined:
    May 3, 2016
    Messages:
    1
    Hi there,
    I recently found your DLL Composition and while I managed to get CivIV Diplomacy working with 43 Civs, I fail to include the "YnAEMP DLL Leader fix for BNW".

    Is there any way to play with your DLL composition without having to play with 22 blank Leaders?

    EDIT: I managed to combine them by copying the "override" folder from the "YnAEMP DLL Leader fix for BNW (v 2)" mod into your mod folder and then adding the following lines to your modinfo:

    Code:
        <File md5="43F56A16939C6CF473B0BDE83E164923" import="1">Override/DiploTrade.xml</File>
        <File md5="7FE7682AD400ABCC7DB1A728B634207D" import="1">Override/DiscussionDialog.lua</File>
        <File md5="AE30ACE9EC879335B1313A30C96E9FE2" import="1">Override/DiscussionDialog.xml</File>
        <File md5="9EF472FCF4D70B240F1BC6EB0BBD0D7A" import="1">Override/LeaderHeadRoot.lua</File>
        <File md5="56170A3A9DCEB6E77B9B97927D7DA7EF" import="1">Override/LeaderHeadRoot.xml</File>
        <File md5="0B79CAD0E7D373ADF1E80CD5A6581C07" import="1">Override/TradeLogic.lua</File>
    
    Seems to do the job, hope there won't be any conflicts.
     
  3. qqqbbb

    qqqbbb Prince

    Joined:
    Sep 25, 2010
    Messages:
    494
    Yield value in UnitPromotions_YieldFromKills. Is it % of killed unit's CS that killer gets?

    And a couple of bugs I noticed:
    AI does not purchase units that have PurchaseOnly flag. This one is fixed in CP.
    GameEvents.CityTrained does not fire when AI purchases units.
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    RTFM ;)

    Code:
    	<Table name="UnitPromotions_YieldFromKills">
    		[B][COLOR="Red"]<!-- Refer to Beliefs/Traits.FaithFromKills, Policies/Traits.CultureFromKills, Units.GoldenAgeValueFromKills and Unit_YieldFromKills, 
    Yield is percentage of combat str of killed unit -->[/COLOR][/B]
    		<Column name="PromotionType" type="text" reference="UnitPromotions(Type)"/>
    		<Column name="YieldType" type="text" reference="Yields(Type)"/>
    		<Column name="Yield" type="integer"/>
    	</Table>
    
     
  5. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    It won't, because the AI doesn't purchase anything, it only hurries things currently in production (and due to the PurchaseOnly flag, the AI will never have it in production)

    Purchased or hurried? With or without CSD? If the latter, have you enabled the EVENTS_CITY option?
     
  6. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    Whaaaaat. :cry::cry:
    Does VMC has that absurdity fixed? Oh my, if it doesn't, here comes more Lua scripts to help the AI...
     
  7. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    It sits in the realm of "a smarter AI" - a direction I have decided not to go in.

    If/When Smart AI v3 is stable, I'll look at what can be borrowed from that.
     
  8. Cvv

    Cvv Chieftain

    Joined:
    Mar 9, 2013
    Messages:
    56
    Location:
    Rus
  9. Lynnes

    Lynnes King

    Joined:
    Aug 23, 2015
    Messages:
    886
    +1

    Noooo!
    I've never noticed this, but this is a real shame, since I'm also using a mod that adds more units that can only be purchased! :o

    Isn't SmartAI stable already? I thought it was..
    However I really hope that inconsistency can be fixed via PNM!
     
  10. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    As suggested by bane_, variable range/effect of GG/GA auras, coming in v83





    Spoiler :

    Code:
    <GameData>
    	<CustomModOptions>
    		<Update>
    			<Where Name="PROMOTIONS_AURA_CHANGE"/>
    			<Set Value="1"/>
    		</Update>
    	</CustomModOptions>
    	
    	<Defines>
    		<Replace Name="GREAT_GENERAL_MAX_RANGE">
    			<!-- Default 2, only needed if increasing the range of GG/GAs, needs to be GREAT_GENERAL_RANGE + max(AuraEffectChange) -->
    			<Value>2</Value>
    		</Replace>
    	</Defines>
    
    	<UnitPromotions>
    		<Row>
    			<Type>PROMOTION_COLONEL</Type>
    			<Description>TXT_KEY_PROMOTION_COLONEL</Description>
    			<Help>TXT_KEY_PROMOTION_COLONEL_HELP</Help>
    			<Sound>AS2D_IF_LEVELUP</Sound>
    			<PortraitIndex>59</PortraitIndex>
    			<IconAtlas>ABILITY_ATLAS</IconAtlas>
    			<PediaType>PEDIA_ATTRIBUTES</PediaType>
    			<PediaEntry>TXT_KEY_PROMOTION_COLONEL</PediaEntry>
    			<CannotBeChosen>true</CannotBeChosen>
    			<AuraRangeChange>-1</AuraRangeChange>
    			<AuraEffectChange>-10</AuraEffectChange>
    		</Row>
    	</UnitPromotions>
    
    	<Language_en_US>
    		<Row Tag="TXT_KEY_PROMOTION_COLONEL">
    			<Text>Colonel</Text>
    		</Row>
    		<Row Tag="TXT_KEY_PROMOTION_COLONEL_HELP">
    			<Text>Colonels have a reduced aura range and effectiveness compared to Great Generals (or Admirals).</Text>
    		</Row>
    	</Language_en_US>
    </GameData>
    
    UI changes in EnemyUnitPanel.lua (4 occurrences)
    Code:
    		-- Great General bonus
    		local bNear, iModifier = pMyUnit:IsNearGreatGeneral()
    		if (bNear) then
    			iModifier = iModifier + pMyPlayer:GetGreatGeneralCombatBonus();
    --		if (pMyUnit:IsNearGreatGeneral()) then
    --			iModifier = pMyPlayer:GetGreatGeneralCombatBonus();
    			iModifier = iModifier + pMyPlayer:GetTraitGreatGeneralExtraBonus();
    
     

    Attached Files:

  11. qqqbbb

    qqqbbb Prince

    Joined:
    Sep 25, 2010
    Messages:
    494
    I tested it with vanilla dll on diety. I declared war on AI player and surrounded his capital city with my units. Every turn a unit spawned in the city but GameEvents.CityTrained did not fire. It looked a lot like AI was purchasing units but when I tested it again on lower difficulty level no units spawned in the city. So AI just gets free units on diety if his city is surrounded with enemy units.
     
  12. CCWB

    CCWB Chieftain

    Joined:
    Sep 25, 2015
    Messages:
    23
    I want to creat a Improvement with "NoFeature" (can't be bulit on a tile with Feature), but the Table of "Improvements" only has "RequiresFeature".
    Could you add this in your future version of DLL? ;)
     
  13. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    From v30:
    Code:
        <!--   GameEvents.PlayerCanBuild.Add(function(iPlayer, iUnit, iX, iY, iBuild) return true end) -->
        [B]<!--   GameEvents.PlotCanImprove.Add(function(iX, iY, iImprovement) return true end) -->[/B]
        <!--   GameEvents.PlayerBuilding.Add(function(iPlayer, iUnit, iX, iY, iBuild, bStarting) end) (v46) -->
        <!--   GameEvents.PlayerBuilt.Add(function(iPlayer, iUnit, iX, iY, iBuild) end) (v46) -->
        <!-- See also: "Improvement - Pontoon Bridge" -->
        <Row Class="3" Name="EVENTS_PLOT" Value="0"/>
     
  14. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    @qqqbbb - SerialEventUnitCreated has nothing to do with the game core DLL, it is triggered by the UI dll, and we have no detailed knowledge (ie no source code for) that.

    @CCWB - as bane_ suggests, use the PlotCanImprove event - if the desired improvement return "pPlot:GetImprovementType() ~= -1"
     
  15. CCWB

    CCWB Chieftain

    Joined:
    Sep 25, 2015
    Messages:
    23

    Thanks.

    Hope this attribute can be written in DLL and used by xmls. :mischief:
     
  16. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    There is a generic, extensible, multi-use-case solution available with Lua, so a specific, single-use-case xml option is NOT going to happen. Firaxis are the kings of "single use modding", it's something I try to avoid!
     
  17. qqqbbb

    qqqbbb Prince

    Joined:
    Sep 25, 2010
    Messages:
    494
    I meant GameEvents.CityTrained.
     
  18. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    V83 on my web-site and GitHub

    • TRAITS_GG_FROM_BARBARIANS and PROMOTIONS_GG_FROM_BARBARIANS: Permits units to earn GG/GA points from killing barbarians - see "Global - Commander Points From Barbarians"
    • PROMOTIONS_AURA_CHANGE: Permits variable great general and admiral aura ranges - see "Promotions - Colonels", "Global - Commander Influence Borders" and post #1711 above
    • Additions to GameEvents.TileRevealed and GameEvents.NaturalWonderDiscovered of the unit (if any) revealing the tile - see "Global - XP For Scouting" (another bane_ suggestion)
    • Bug fixes for upgrading units that can/will hover - should now work for any upgrade over any terrain
    • Bug fix for land unit with the Cross Ice promotion that insisted on embarking into the ice-floe as opposed to walking out onto it!
    • New Player API methods for altering research overflow - SetOverflowResearch(iResearch) and ChangeOverflowResearch(iResearch)
    • New Player API methods for changing influence/tourism on players - ChangeInfluenceOnAllPlayers(iBaseInfluence, bApplyModifiers, bModifyForGameSpeed) and ChangeInfluenceOnPlayer(iPlayer, iBaseInfluence, bApplyModifiers, bModifyForGameSpeed)

    There are also some internal changes in prep for v84 ...
     
  19. Lynnes

    Lynnes King

    Joined:
    Aug 23, 2015
    Messages:
    886
    Very good update, thanks for fixing the hover upgrades! :)

    Now I'm curious about the upcoming features of v84! Do you mind sharing the secret plans?


    edit:

    The iScoutingXpDivisor is still set to 2:

    Code:
    -- How many scouting XPs in a real XP
    -- local iScoutingXpDivisor = 6
    local iScoutingXpDivisor = 2 -- FOR TESTING ONLY
     
  20. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    It's only really an example (see the comment at the top of the same file), but I'd already spotted it and was using it to test something I'd broken in my automated site uploader - which I've now fixed so v2 is up with the divisor set to 6

    :)
     

Share This Page