JFD
Kathigitarkh
Beautiful. Much appreciated and very useful, and should generally benefit the game with leaders that favour the existing strategic resource flavours as well.
#if defined(MOD_BALANCE_CORE_POLICIES)
ResourceTypes eResource = (ResourceTypes)pBuildingInfo.GetResourceType();
if (eResource != NO_RESOURCE)
{
if (getNumResourceTotal(eResource, true) <= 0)
{
return false;
}
}
#endif
I could make a new row for buildings that is similar to the <PolicyType> or <BeliefType> rows in Buildings, in that it looks for the presence of said resource in a player's empire, and if it finds it, it makes the building available. I've considered making such a row anyways, as I might do something fun with Elephant units at some point.
Edit: here's what I've done:
Code:#if defined(MOD_BALANCE_CORE_POLICIES) ResourceTypes eResource = (ResourceTypes)pBuildingInfo.GetResourceType(); if (eResource != NO_RESOURCE) { if (getNumResourceTotal(eResource, true) <= 0) { return false; } } #endif
That'll be tied to a new building row, ResourceType. Should work like PolicyBranchType or PolicyType (in the CP).
G
I notice player:SetCapitalCity() is already in the DLL, so could you expose this function to lua when you get a chance. Also, if a SetOriginalCapital() is possible, too (though I don't think I saw that in the source code to begin with). Thanks.
Just in case it was missed. No rush; just want to know that it's (some part of it) possible. And it would go a long way in preventing my assassination by Sukritact
Great, thanks. Let me know if there's more that I can help with - though the EUI stuff didn't go too well
Some good came out of it then
Hm, I did some testing with TrainedFreePromotion in the Buildings table and it doesn't seem to work for civilian units (when they're in the correct UnitPromotion_CivilianUnitType table). This seems like it could be an oversight (probably intentional) on Firaxis' part. I'd be interested to know whether you can look into the source code and see what's up, Gazebo.
This isn't much of an API request, but I didn't know where else to put it, and if it turns out that the DLL skips civilian units or something, I suppose a request - provided it's easy enough - to have the TrainedFreePromotion column include civilians wouldn't be remiss.
for(int iI = 0; iI < GC.getNumPromotionInfos(); iI++)
{
const PromotionTypes ePromotion = static_cast<PromotionTypes>(iI);
CvPromotionEntry* pkPromotionInfo = GC.getPromotionInfo(ePromotion);
if(pkPromotionInfo)
{
if(isFreePromotion(ePromotion))
{
if((pUnit->getUnitCombatType() != NO_UNITCOMBAT) && pkPromotionInfo->GetUnitCombatClass(pUnit->getUnitCombatType()))
{
pUnit->setHasPromotion(ePromotion, true);
}
}
}
}
Ah, good. So I'm not just messing up. Thanks for the info.
Ok, cool. I'll add support in my mod for the Diplomacy combat class too for where I think it should.
It's just to support my Exploration Continued Expanded mod, which adds - indirectly - secondary effects to resources. A few grant promotions, such as Banana which grants double movement in Jungle for Workers and Settlers (though that's only without my Attrition add-on) to civilian units, and some of those should be extended to diplomatic civilians. So I've created three combat classes for civilians - CIVILIAN (for Workers and Settlers), GREAT PERSON (for Great People), and RELIGIOUS (for religious units) to which, in addition to DIPLOMATIC, these promotions will be granted, which is much easier than doing it through Lua.