Trait_SpecialistYieldChanges

trystero49

Prince
Joined
Apr 30, 2012
Messages
515
I am look at making a civ that gives + Faith and + Culture for every specialist in the city. I have modeled my code after the code from the Korea trait.

Code:
<Trait_SpecialistYieldChanges>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_CITIZEN</SpecialistType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_ARTIST</SpecialistType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_SCIENTIST</SpecialistType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_CITIZEN</SpecialistType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_ARTIST</SpecialistType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_SCIENTIST</SpecialistType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_UNIVERSAL_PRIESTHOOD</TraitType>
			<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>2</Yield>
		</Row>
	</Trait_SpecialistYieldChanges>

The database.log files doesn't give any irregularities, and I've looked at the database file with mySQL viewer, and everything appears to be in order, but nothing happens in game. I have linked the trait to my leader as well. I am really confused. Does this table not work, or something?
 
How are you determining that the trait is not working? The specialist text does not exactly update correctly with traits like these (this is even so with Korea). I'd suggest you look at the city yield table on the left side of the city screen. Your trait yields should show up there.
 
The reason I say that it isn't working is because the city yield table doesn't list the addition, neither does the bar on the top screen, and I can see that the extra yields aren't being added properly.
 
Odd, as there's nothing actually wrong with your code as far as I can see.
Spoiler :
This is from a mod I made and, as far as I know, it works (except for the specialist text thing I mentioned above).
Code:
<Trait_SpecialistYieldChanges>
		<Row>
			<TraitType>TRAIT_ARCTIC_HUNTERS</TraitType>
			<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>3</Yield>
		</Row>
</Trait_SpecialistYieldChanges>
Is the addition listed in the hover-over tooltip on the city bar?
Does the city have specialists (non-citizen) in it? (I know its a bit basic, but it's really all I can think of)
 
The code appears okay. I see no reason why it shouldn't work, unless you haven't published the mod through ModBuddy (again, basic). Try the tooltip and see if it registers.
 
Yeah, I've checked that ModBuddy built it properly (like I said, the values show up in the database), text shows up properly as well. The tool tip shows nothing. I've tried it with every different specialist type, and faith and culture are never added like the mod says they should.

I tried making a building that gave +2 culture and +2 faith to all specialists and giving that building to my civ for free (i.e. <FreeBuilding>), but that had this weird effect where +2 Faith and +2 Culture would show up in the hover-over tooltip for specialists, but not in the city yield screen. Also, the faith and culture added this way didn't actually add to anything, it merely appeared in the city screen.

I can't imagine what is going wrong either. I'm using placeholder art from in game as well as placeholder text for civilopedia entries. Other than that, this mod is basically done (except the wonky trait business). So I really am totally at a loss. The database shows that the tables are all updated the way they should be, with the specialist changes, the new civ, the new leader, the new leader for the civ, the trait the trait for the leader....I really see nothing that should be causing a problem. I've also deleted the cache and moduserdata and built and rebuilt, but I can't figure it out.
 
Are the specialist slots "filled"?
 
Yeah. I get all the other benefits from each specialist (e.g culture for artist, gold for merchant), but I'm not getting the benefits that I've coded (+ faith, + culture). I'm pretty sure I have all the bases covered on this one.
 
Yeah. I get all the other benefits from each specialist (e.g culture for artist, gold for merchant), but I'm not getting the benefits that I've coded (+ faith, + culture). I'm pretty sure I have all the bases covered on this one.

Unless there's something extremely obvious that we missed, then the XML probably references some hardcoded values. The XML must be there, but it must also agree with the hardcoded material to work. That is probably just Firaxis's way of getting you to buy more DLC. It's the same reason we cannot create custom sounds at the moment, Firaxis has fallen to the level of wanting us to pay $4.99 just for ONE civilization (which could have been made by the community with incredible ease).
 
If it references hardcoded values, why even put this table in the game? Wouldn't it be easier to just hardcode the whole trait? h_Griff0n says that his +food for merchant works ok.

Anyway, this is a real mystery. I'll fool around with this some more, maybe I'll get something out of it.
 
Faith and Culture don't always count as Yields and can't be used in the XML for some of the yield tags (you'll notice even the buildings XML has separate tags for a lot of the Faith and Culture stuff, especially modifiers). See if your XML works when adding the base yields of food/hammers/gold. If so, then this is just one of those cases where it doesn't count Faith and Culture as yields. (Also, since Faith and Culture aren't standard yields and they added that code pre G&K, they probably never updated it to include Faith).

Firaxis has fallen to the level of wanting us to pay $4.99 just for ONE civilization (which could have been made by the community with incredible ease).

Well, you're mostly paying for the art assets which the community can't actually make with incredible ease (leaderheads).
 
Well, you're mostly paying for the art assets which the community can't actually make with incredible ease (leaderheads).

Still not worth it. If Firaxis has 33 leaderheads in vanilla + G&K, does it really warrant an extra $4.99 for another leaderhead or two? No. All people who bought G&K should get the DLC, as G&K was itself overpriced given that it, too, was mostly DLC with the religion mechanic thrown in there but not playing an extremely important role.
 
Faith and Culture don't always count as Yields and can't be used in the XML for some of the yield tags (you'll notice even the buildings XML has separate tags for a lot of the Faith and Culture stuff, especially modifiers). See if your XML works when adding the base yields of food/hammers/gold. If so, then this is just one of those cases where it doesn't count Faith and Culture as yields. (Also, since Faith and Culture aren't standard yields and they added that code pre G&K, they probably never updated it to include Faith).

I think you might be right about this one. I guess I'll have to lua it.
 
I changed the yields to give extra science and production (just to test it out) and it works; I guess this table just doesn't want to co-operate with Yield_Faith and Yield_Culture.
 
Shame. The trait sounded very interesting (if a bit OP).
 
Did you check Faith and Culture separately? There might not be a problem with both of them, but just one. I know I would be interested in knowing if one of the two could still be used.
 
So food, production, gold, and science work OK, but not faith or culture? That sucks. There goes a few good ideas for UAs.
 
Instead of the <Trait_SpecialistYieldChanges> tag, try making a dummy building for the capital that uses the <Building_SpecialistYieldChanges>. It's possible the building tag counts culture or faith as a yield while the trait tag does not. (However, I'm just brainstorming here and haven't tested it myself).
 
EDIT: nm, don't know how I missed your own remark regarding this in the first post. :blush:

Do you have logging turned on and if so does any error(s) relating to this problem show up in Database.log?
 
Back
Top Bottom