Trying to create a trait, not sure how to do it.

DreadHerring

Chieftain
Joined
Feb 19, 2016
Messages
41
I'm working on a mod that will add Hatshepsut to the game as an alternate leader for Egypt. She was super cool, actually ruled Egypt, and was huge on building projects. Her rule and death oversaw the creation of the Valley of the Kings.

Anyway, I'm looking to create this LA (Leader Ability):

Valley of the Kings -- When Hatshepsut completes a wonder, her empire receives a temporary boost to culture. Completed Wonders generate additional production.

I am looking for the result to be as though I had used a worker to chop something down, but have the yield be culture. Numbers would obviously be subject to change. The second part seems simple enough, but I don't know how to do it yet. Could a wonder generate the aoe effect, as with the Factory?

How do I accomplish this? Will I need LUA, or can I create a new modifier id, modifier, and argument for this effect? I've been looking through the game files, and am using the structure for Montezuma's ability as a starting place, though I don't know if that's even the right thing to do.
Code:
<TraitModifiers>
       <Row>
           <TraitType>TRAIT_CIVILIZATION_VALLEY_OF_KINGS</TraitType>
           <ModifierId>TRAIT_WHATDOIDO</ModifierId>
       </Row>
   </TraitModifiers>
   <Modifiers>
       <Row>
           <ModifierId>TRAIT_WHATDOIDO</ModifierId>
           <ModifierType></ModifierType>
       </Row>
   </Modifiers>
   <ModifierArguments>
       <Row>
           <ModifierId></ModifierId>
           <Name></Name>
           <Value></Value>
       </Row>
   </ModifierArguments>

I did see in the game files that there are entries to create Triggers.
Code:
-- Add triggers.
CREATE TRIGGER OnKindInsert AFTER INSERT ON Kinds BEGIN UPDATE Kinds SET Hash = Make_Hash(Kind) Where Kind = New.Kind; END;
CREATE TRIGGER OnTypeInsert AFTER INSERT ON Types BEGIN UPDATE Types SET Hash = Make_Hash(Type) Where Type = New.Type; END;

Could I use this to set the creation of a wonder as the trigger? I really don't know how to structure any of this, all my experience is with XML. Help and ideas are very appreciated!
 
SQL triggers are not for events that occur during gameplay. They are for causing the game's engine to adjust the game's xml/sql database when certain specified types of changes to the database are made. In other words, when a mod adds a new row to table-X or removes a row from table-X, there might be a trigger to perform any necessary clean-up operations throughout the rest of the game's xml database to ensure there is no leftover mess from these changes. All of these actions are conducted before a player ever gets to the in-game screen where they start a new game or resume their saved game.

What you want to try would be lua probably, and would definitely have been lua in Civ5, but we don't have enough info figured out as yet on the lua "GameEvents", etc., to know how exactly to go about monitoring for a wonder being created, for example. Or at least I haven't figured enough of it out as yet.
 
Thanks! That makes a ton of sense, and I'm glad there's reason for me to be lost.
By the way, I have referred to your guides so so many times. I'm so thankful that I was able to learn from you.

EDIT: Have you checked out the CitySupport.Lua and Civ6Common.Lua? They're under /Base/Assets/UI/
They include a lot of the functions that we can use to monitor a city. I don't know to what extent they can be used to create a civ-specific ability, but I'm sure I and others can learn by looking at some of the better known modded civs that incoporate lua to manipulate the game.
 
Last edited:
Top Bottom