Dummy Techs

Uighur_Caesar

Comandante en Jefe
Joined
Mar 14, 2015
Messages
1,227
Location
Florida
Ok so the Taino are supposed to get +1 Faith from Farms. I thought the easiest way to do this was to make a dummy tech that changes farm yields and have them start with it. The problem is that any civ can research it which defeats the purpose of it being unique. Can I make the tech inaccessible to other civs?
 
Dummy policies would work. Also, Machiavelli has some code for dummy buildings. Though there should be an easier way, don't ask me, I've never coded abilities.
 
If it's going to be a global bonus without any conditions to when they need to be given or removed, two alternatives you may consider are a dummy policy using the <Policy_ImprovementYieldChanges> table, or using the pTeam:ChangeImprovementYieldChange() method. Whether those are better than using a Dummy Tech, I'm not sure, but those are your alternatives. Personally, I've used both of these methods for Holo in the past, though I've settled on the dummy policy since she gets one anyway, so it was trivial to simply add on to that.

Otherwise, I believe the techs have a column you can specify to disable them, and then you can simply give it to your Civ via a Free Tech or something.

Edit:
I don't believe the Buildings table has anything available for increased Improvement yields, so dummy buildings wouldn't quite work. It'd allow you to "fake" the yields, but then you'd have to go around counting Farms and ensuring you aren't counting any twice in overlap zones, which is way more effort than is necessary. It'd also not show up on the 'main map' on the Farm plots themselves, since the building yields would be added directly to the City's yields.
 
You could just use Trait_ImprovementYieldChanges.
 
You could just use Trait_ImprovementYieldChanges.

Does this work for yields other than what Firaxis needed it to do for Japan? There are a few other things that were weirdly hardcoded that I ran into (like Morocco's trait,) so I'm not sure if I wrote that off as an assumption of that being the case or not.
 
They actually used it for the Huns, and as far as I've experimented with it, it works for pretty much everything.
 
Interesting. Thanks for bringing that up, I'll keep that one in mind for my future projects. It's kind of pointless to move Holo's effect there at this point since there'd be no noticeable difference and she'd still need that dummy policy for other effects anyway.
 
There's a lot of useful tags you can use in XML that do the job of a really complicated Lua for you. It's very handy.
 
Yeah, I'm quite aware of the numerous unused columns and tables in the various XML files. I check the schema quite often (especially since I have Sublime open to those folders for extremely quick find-in-all-files functionality.)

The problem is some of them have weird restrictions / hardcoded logic and some aren't even hooked up, so each of those generally has to be tested on a case-by-case basis.

For example, Morocco's trait dealing with their trade route yields is hardcoded to only accept Culture and Gold; nothing else works. For Improvements, <Improvement_FreshWaterYields> is listed as a valid table, but it doesn't actually do anything from my testing.
 
Yeah, some are really weird. For that one, you can use the one that enables +1 Food from Farms after Civil Service and specify that it's for Agriculture.
 
Yeah, some are really weird. For that one, you can use the one that enables +1 Food from Farms after Civil Service and specify that it's for Agriculture.

Oh, I know. I've already worked around most restrictions for Holo; I was simply providing those as examples I remember of why I generally have to test everything, even if it technically exists and is available. Asking about that trait column was simply me trying to avoid extra work while I'm trying to work out new unit animations at the moment.
 
So far everything I've tried in Trait_ImprovementYieldChanges has worked so far as YieldType is concerned. With, of course, the usual exceptions of Happiness and Tourism as those are not 'Yields' of any stripe.

And, no, the Buildings Schema has no Building_ImprovementSomething table of any kind, so Buildings cannot make a change based on Improvements. The closest you can come is <Building_ResourceYieldChanges>, but that table does not actually require the resource to have been improved. Only the restrictor tables for when a building can be constructed (<Building_LocalResourceAnds> and <Building_LocalResourceOrs>) require there to be the improvement completed on a tile with the specified resource.
 
Back
Top Bottom