DarkScythe
Hunkalicious Holo
- Joined
- May 6, 2014
- Messages
- 804
Do you mean the Trading Post improvement?
Yes, the Trading Post improvement. (Also the Customs House improvement.)
Do you mean the Trading Post improvement?
Speaking of all these hidden and dummy things, I think I have an idea for how to restrict my NW to only handing out its free Spy once, but I'm unsure on my logic, so I will have to test it first..
I have a hidden building with <ConquestProb>100</ConquestProb> which should mean it will always be captured, but for some reason it never survives the city capture.
You haven't inadvertently set NeverCapture=true?
<BuildingClasses>
<Row>
<Type>BUILDINGCLASS_MIDDLEMAN_DUMMY</Type>
<DefaultBuilding>BUILDING_EMPTY_DUMMY</DefaultBuilding>
<MaxPlayerInstances>1</MaxPlayerInstances>
</Row>
<Row>
<Type>BUILDINGCLASS_GIFT_DUMMY</Type>
<DefaultBuilding>BUILDING_EMPTY_DUMMY</DefaultBuilding>
<MaxPlayerInstances>1</MaxPlayerInstances>
</Row>
</BuildingClasses>
<Buildings>
<Row>
<Type>BUILDING_MIDDLEMAN_DUMMY</Type>
<BuildingClass>BUILDINGCLASS_MIDDLEMAN_DUMMY</BuildingClass>
<Cost>-1</Cost>
<FaithCost>-1</FaithCost>
<Description>MiddlemanDummy</Description>
<PrereqTech>NULL</PrereqTech>
<GreatWorkCount>0</GreatWorkCount>
<ArtDefineTag>NONE</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
[B]<ConquestProb>100</ConquestProb>[/B]
<HurryCostModifier>-1</HurryCostModifier>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
<FreeBuildingThisCity>BUILDINGCLASS_GIFT_DUMMY</FreeBuildingThisCity>
</Row>
<Row>
<Type>BUILDING_GIFT_DUMMY</Type>
<BuildingClass>BUILDINGCLASS_GIFT_DUMMY</BuildingClass>
<Cost>-1</Cost>
<FaithCost>-1</FaithCost>
<Description>GiftDummy</Description>
<PrereqTech>NULL</PrereqTech>
<GreatWorkCount>0</GreatWorkCount>
<ArtDefineTag>NONE</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
<NeverCapture>true</NeverCapture>
<HurryCostModifier>-1</HurryCostModifier>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
<ExtraSpies>1</ExtraSpies>
</Row>
</Buildings>
<Building_ClassesNeededInCity>
<Row>
<BuildingType>BUILDING_GIFT_DUMMY</BuildingType>
<BuildingClassType>BUILDINGCLASS_NATIONAL_TREASURY</BuildingClassType>
</Row>
</Building_ClassesNeededInCity>
So, what this code is intended to do:
Construction of an EIC building provides MIDDLEMAN_DUMMY via FreeBuildingThisCity.
MIDDLEMAN_DUMMY is limited to 1 per Player, like a NW, and is set to always be captured. EIC building is set to NeverCapture. Intent is to leave MIDDLEMAN_DUMMY behind upon capture.
MIDDLEMAN_DUMMY then provides an additional building, GIFT_DUMMY, via FreeBuildingThisCity.
GIFT_DUMMY has its own prerequisite of having an EIC building available first -- I am not sure if FreeBuildingThisCity respects this or not.
GIFT_DUMMY is set to NeverCapture, since I don't know if it might continue to provide its effects when it changes hands.
GIFT_DUMMY provides 1 free Spy.
What I am intending for this to resolve is that when the city gets captured, the EIC and GIFT_DUMMY buildings are destroyed, but the MIDDLEMAN_DUMMY remains. Upon recapture of the city, MIDDLEMAN_DUMMY cannot provide its free building because GIFT_DUMMY requires the EIC. Once the EIC is built, it cannot provide another MIDDLEMAN_DUMMY because one already exists, and is limited to a maximum of 1, and therefore should not trigger a second GIFT_DUMMY.
Unfortunately, what appears to be happening is that on capture, and subsequent recapture of my city, all 3 buildings are gone.
The chain itself sounds complicated, but it was random logic I was toying around with in my head trying to see how I could have it give me a Spy once, and only once, regardless of how many times I (re)built the thing.
I wouldn't mind letting you see all the code I have written so far, although I'd rather do it via PM or Steam, as I'm not yet ready to announce my Civ. If you are okay with it, may I add you on Steam?
This last question goes to everyone who has helped me so far; Vicevirtuoso, bouncymischa, LeeS, and whoward69 -- I am incredibly appreciative of your collective assistance in getting me plowing through so quickly on a modding system I've never used before.
Feel free to on Steam or even here. Steam I am "lshipp". I'm not super-selective with who I friend on Steam. I just ignore requests from people I've never had interaction with before...a lot of people seem more interested in collecting friends just to be collecting friends, or else because they want to "help" me "get in on a good deal" for "free" steam wallets.I wouldn't mind letting you see all the code I have written so far, although I'd rather do it via PM or Steam, as I'm not yet ready to announce my Civ. If you are okay with it, may I add you on Steam?
Only way I can think of off the top of my head would be to 1st create a unique replacement version of those for your civ, and give the promotions only to that unique replacement version of the unit. But I'm not really much of an expert on units or promotions...I can read the tables and understand pretty much what most of the commands do, but I haven't built the personal knowledge-base of what will and won't work. Oh! Actually making use of Reading Comprehension skills, I see you were already heading in that direction, says the slow slow turtle.As an aside:
While I really am stuck at the moment regarding the free building chain, I've been working on Promotions. Is there any way to assign Civ-specific Promotions to Great Generals and Great Admirals without having them propagate to every other Civ's GG/GA's as well?
I have no problems with you adding me on Steam -- I'm indebted to you for pointing me in the direction of getting spies before the Renaissance, which helped my most recent Touhou civ come together.
That said, if your goal is to generate the spy once and only once, your best bet may be to use the SaveUtils lua. My Human Village civ uses it to generate Workers when certain buildings are constructed, but only once per city. (You can't sell the building and rebuild it to get another worker.) It does this by using the SaveUtils lua file to keep track of which buildings have been built in which cities. It would probably end up simpler than trying to use an odd chain of dummy buildings to do it...
Feel free to on Steam or even here. Steam I am "lshipp". I'm not super-selective with who I friend on Steam. I just ignore requests from people I've never had interaction with before...a lot of people seem more interested in collecting friends just to be collecting friends, or else because they want to "help" me "get in on a good deal" for "free" steam wallets.
Only way I can think of off the top of my head would be to 1st create a unique replacement version of those for your civ, and give the promotions only to that unique replacement version of the unit. But I'm not really much of an expert on units or promotions...I can read the tables and understand pretty much what most of the commands do, but I haven't built the personal knowledge-base of what will and won't work. Oh! Actually making use of Reading Comprehension skills, I see you were already heading in that direction, says the slow slow turtle.
Ah! The free worker from Watermills!
I remember that Civ.. Didn't realize it was yours. xD
I'm not sure what the SaveUtils.lua is, but I'll look into it.
I am now stuck on multiple fronts.
My Google-fu doesn't appear to be strong enough, as I've been trying for about an hour, but have been unsuccessful at locating any sort of Policy modding guide, much less any information about how to make such a policy hidden and/or make a dummy policy.
I think I can create a policy itself pretty simply if I follow the conventions of the XML used in the Buildings, Traits, etc. files, but I have no idea how to assign it to a Civ or a Leader.
Any pointers here would be appreciated.
On the bright side, all the promotions are working properly, once I told the mod to actually update the database with the new content.
if not(pPlayer:HasPolicy(GameInfo.Policies["" .. p .. ""].ID)) then
pPlayer:SetNumFreePolicies(1)
pPlayer:SetNumFreePolicies(0)
pPlayer:SetHasPolicy(GameInfo.Policies["" .. p .. ""].ID, true);
end
Is there anything special with regard to making the policy that will be referenced, or am I safe just creating a dummy policy by following the Civ5Policies schema, and then just placing that Policy Type name into that LUA?
function MyDummyPolicyFunction(iPlayer)
if iPlayer < GameDefines.MAX_MAJOR_CIVS then
local pPlayer = Players[iPlayer]
if pPlayer:GetCivilizationType() == GameInfoTypes.CIVILIZATION_MY_CIV_HERE then
if not(pPlayer:HasPolicy(GameInfoTypes.POLICY_TEST)) then
pPlayer:SetNumFreePolicies(1)
pPlayer:SetNumFreePolicies(0)
pPlayer:SetHasPolicy(GameInfoTypes.POLICY_TEST, true)
end
end
end
end
GameEvents.PlayerDoTurn.Add(MyDummyPolicyFunction)
Apparently the "SetNumFreePolicies" bit is the trick -- by doing that switch, it allows you to add a free policy without affecting the number of policies the player needs to get to the next one. Or something.