<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>
Yield value in UnitPromotions_YieldFromKills. Is it % of killed unit's CS that killer gets?
<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>
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)AI does not purchase units that have PurchaseOnly flag.
Purchased or hurried? With or without CSD? If the latter, have you enabled the EVENTS_CITY option?GameEvents.CityTrained does not fire when AI purchases units.
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)
Whaaaaat.
Does VMC has that absurdity fixed? Oh my, if it doesn't, here comes more Lua scripts to help the AI...
<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>
-- 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();
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.Purchased or hurried? With or without CSD? If the latter, have you enabled the EVENTS_CITY option?
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?![]()
<!-- 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"/>
From v30:
Code:[B]<!-- GameEvents.PlotCanImprove.Add(function(iX, iY, iImprovement) return true end) -->[/B]
use the PlotCanImprove event - if the desired improvement return "pPlot:GetImprovementType() ~= -1"
Hope this attribute can be written in DLL and used by xmls.![]()
@qqqbbb - SerialEventUnitCreated has nothing to do with the game core DLL
-- How many scouting XPs in a real XP
-- local iScoutingXpDivisor = 6
local iScoutingXpDivisor = 2 -- FOR TESTING ONLY
The iScoutingXpDivisor is still set to 2