Help coding a trait / art request

lord_daemonar

Chieftain
Joined
Jul 30, 2013
Messages
9
I'm currently learning how to mod and coding a King David Israelite mod, and I'm not sure how to code the trait properly. The trait is similar to Russia's "Siberian Riches," but I'm not really sure how to make it refer back to the bonus resources. I think I'll be able to handle everything else (since other civs have similar bonuses and I'm not really doing anything too radical), but I want to make sure that I'm getting everything right. I also need help finding the BUILDINGCLASS whatever for the Grand Temple, since the UB is supposed to be a replacement for that...

UA: "Promised Land," +1 faith from improved bonus resources​

UU: "Gibborim," spearman replacement, no bonus v mounted but gets the Siege I promotion and a combat non-upgraded bonus on foreign land​

UB: "Beit Hamikdash," Grand Temple replacement, loses the bonus Pressure, gets +8 culture & +4 science & +2 tourism for each foreign religion in the city​

ALSO: If anyone can do some awesome art for this civ I'd appreciate it.
 
First off, welcome to Civfanatics!!

There's been a couple of Israel incarnations, but probably the best one is Leugi's King David, which is available here. He's done a great job - so much so, I've replaced my own version in Anno Domini with his (for the next release). That's the artwork taken care of.

The building class for the Grand Temple is....BUILDINGCLASS_GRAND_TEMPLE

To do your trait, you'd need to code like this:

<Trait_YieldChangesStrategicResources>
<Row>
<TraitType>TRAIT_PROMISED_LAND</TraitType>
<YieldType>YIELD_FAITH</YieldType>
<Yield>1</Yield>
</Row>
</Trait_YieldChangesStrategicResources>
 
Thanks! I'm glad to be here. This community seems really awesome.

I like Leugi's work, but I want my Israelites to play a little differently. And I'm going to hopefully use this tutorial to make a blue and gold menorah icon, since biblical and modern Israel use it in a lot of their official imagery (see here and here).

Thanks for the building class info! I thought so, but I wasn't sure and wanted to make sure.
<Trait_YieldChangesStrategicResources>
<Row>
<TraitType>TRAIT_PROMISED_LAND</TraitType>
<YieldType>YIELD_FAITH</YieldType>
<Yield>1</Yield>
</Row>
</Trait_YieldChangesStrategicResources>

Why is it YieldChangesStrategicResources and not YieldChangesBonusResources? I want the faith bonus on sheep and stone, not on iron.
 
Why is it YieldChangesStrategicResources and not YieldChangesBonusResources? I want the faith bonus on sheep and stone, not on iron.

Ah...sorry, I'd not realised that. Without lua programming, we need to stick within the boundaries that Firaxis have given us - and they've not done a version of this command with bonus resources, as far as I know. Perhaps one of the other guys can help with lua?

As an XML alternative, Firaxis have done bonuses from improvements, so you could get faith from pastures and quarries, using this set up:

<Trait_ImprovementYieldChanges>
<Row>
<TraitType>TRAIT_PROMISED LAND</TraitType>
<ImprovementType>IMPROVEMENT_PASTURE</ImprovementType>
<YieldType>YIELD_FAITH</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<TraitType>TRAIT_PROMISED LAND</TraitType>
<ImprovementType>IMPROVEMENT_QUARRY</ImprovementType>
<YieldType>YIELD_FAITH</YieldType>
<Yield>1</Yield>
</Row>
</Trait_ImprovementYieldChanges>

This, however, would be all pastures and quarries, once built - not just sheep and stone.
 
Alrighty then. Unless I'm rescued by one of the resident pros I guess I'll have to learn lua programming. :/

I'll update with what I've discovered later
 
Why is it YieldChangesStrategicResources and not YieldChangesBonusResources? I want the faith bonus on sheep and stone, not on iron.

Because Firaxis didn't need that feature/function for either the a core civ/unit/building nor for a scenario so they didn't implement it. Get used to it, it affects most things within the game.
 
I already posted what I want to do. Since you're a more experienced modder than I, could you give me a pointer or two? Do you think that Lua would work?
 
I've come up with a solution that works using XML. By stating above about the improvement yield changes, I was actually well on the way to the answer - which was to set up new improvement types that were unique to the stone and sheep resources, meaning that you could affect those improvements without changing the others.

In the example mod attached, the Celts have been changed to have the "Promised Land" trait - inappropriate for them, I know - but this is purely to demonstrate how to create the trait. I've also updated the beliefs connected to quarries and pastures so that they still get the bonuses; the artwork for the new resource types, though, is the same as the old ones, so there's duplication of icons - which you'd be able to change if that bothered you.

There's some screenshots attached so that you can see what it looks like in-game :).
 

Attachments

  • Promised Land (v 1).zip
    3.7 KB · Views: 59
  • PL01.jpg
    PL01.jpg
    240.5 KB · Views: 77
  • PL02.jpg
    PL02.jpg
    221.4 KB · Views: 69
  • PL03.jpg
    PL03.jpg
    232.2 KB · Views: 66
  • PL04.jpg
    PL04.jpg
    289.1 KB · Views: 36
  • PL05.jpg
    PL05.jpg
    317 KB · Views: 34
  • PL06.jpg
    PL06.jpg
    490.1 KB · Views: 30
UA: "Promised Land," +1 faith from improved bonus resources
While it isn't exactly what you're looking for there is an easy way (xml only) to get something very close. You can get "+1 faith from every bonus resource" (improved or unimproved) by:

1) creating a building no one can construct that gives +1 faith from specific resources. Put all the bonus resources on it.
2) have the civ get this building for free (the same way carthage gets a free harbor in their cities)

UB: "Beit Hamikdash," Grand Temple replacement, loses the bonus Pressure, gets +8 culture & +4 science & +2 tourism for each foreign religion in the city
Except for the +2 tourism part all of that is doable with xml. You may be able to get something similar to the +stuff per foreign religion in the city by mimicking the Indonesia unique building.
 
While it isn't exactly what you're looking for there is an easy way (xml only) to get something very close. You can get "+1 faith from every bonus resource" (improved or unimproved) by:

1) creating a building no one can construct that gives +1 faith from specific resources. Put all the bonus resources on it.
2) have the civ get this building for free (the same way carthage gets a free harbor in their cities)

How do you code an invisible building?

You may be able to get something similar to the +stuff per foreign religion in the city by mimicking the Indonesia unique building.

That was the plan, and where I got the idea from

Rob: I've been trying since last night to figure out everything that you did so I can include the other bonus resources, but I don't really understand it. This might be easier. Thank you for all your help :blush:
 
I had an idea. Would this coding work? I'm basically copying and pasting code from elsewhere in the game, so hopefully everything will reference correctly.

<GameData>
<Traits>
<Row>
<Type>TRAIT_PROMISED_LAND</Type>
<Description>TXT_KEY_TRAIT_PROMISED_LAND</Description>
<ShortDescription>TXT_KEY_TRAIT_PROMISED_LAND_SHORT</ShortDescription>​
</Row>​
</Traits>​
<Trait_ImprovementYieldChanges>
<Row>
<TraitType>TRAIT_PROMISED_LAND</TraitType>
<ResourceType>RESOURCECLASS_BONUS</ResourceType>
<YieldType>YIELD_FAITH</YieldType>
<Yield>1</Yield>​
</Row>​
</Trait_ImprovementYieldChanges>
</GameData>​


I think it would, but I don't know enough to tell.​
 
Top Bottom