Things I Can't Do

abandag

Warlord
Joined
Jun 24, 2012
Messages
120
I'm mainly looking at the traits section (base game, no Gods and Kings for me yet :sad:.), but I suppose the things I'm asking would apply all across the board. I would like some confirmation from more experienced modders about some of the things I CANNOT do, or at least I'm pretty sure I can't do.

1. I CAN'T create a new table. For example, if I want a trait that allows me to move faster on roads, I can't just create a new table called Trait_RouteMovementChanges or whatever and have it do anything except crash the game. Right?

2. I CAN'T add a new column to an existing table. Even if the column exists in a different table somewhere. For example, if I want the trait to give me additional happiness for each trade route, I can't just add this column to the Traits table:

Code:
<Column name="HappinessPerTradeRoute" type="integer" default="0"/>

Even though this column is found in another table (Policies). Right?

3. I CAN'T add an additional qualifier to a table by adding in an additional column. This is related to #2, might not even need it's own question, but here I go anyway. If I want a trait to add 1 gold to each river tile for my civ, I couldn't add an additional

Code:
<Column name="FeatureType" type="text" reference="Features(Type)"/>

column to the Trait_YieldChanges table. Right?

4. I CAN'T add a Trait that does something other than what's listed in the pre-existing tables and columns for Traits without driving myself crazy by trying to learn Lua (maybe not even then?) Right?

I'm just about 100% sure about #1, maybe 75% for #2. But #4 can be worked around with some creativity.

For example, going back to the moving faster on roads example in #1, I COULD create a unique unit for the civ that replaces the worker. It would do everything a normal worker would do, except it wouldn't build "roads." It would build "highways" or whatever I decide to call the new thing I create to replace roads. And these highways would have a better movement rate attached to them than roads. For this I would need:

Civilization_UnitClassOverride (HIGHWAY_WORKER)
Unit_Builds (with UnitType of UNIT_HIGHWAY_WORKER and BuildType of BUILD_HIGHWAY
Builds (BUILD_HIGHWAY with all the needed info, including RouteType of ROUTE_HIGHWAY
Routes (new ROUTE_HIGHWAY with my movement changed to whatever I want)

As this would be my "trait" or Unique Ability (or part of it, at least), I can still add another Unique Unit and/or Unique Building. Actually I suppose I could add as many unique units/buildings as I want, but I like to keep it as 1 each of UA, UU, UB.

Further working around of #4 would be the example in #3, with rivers plots adding 1 extra gold. This would be pretty easy, doing it similar to the Highway, except using a building. I COULD create a new BuildingClass and give that to the civ in Civilizations_FreeBuildingClasses. I'm actually not sure if that would give it to all cities for free, or just the first one. (I'm thinking all, because the only reason that the Palace isn't given to all cities is that its "instances" is limited to one. That's why you get a new Palace if your Capital gets taken, it's free to all cities, but you can only have one. Does that make sense?) If not to all, then just make it very cheap to build. The trick in this case would be having it available only to your civ. I would attach it to a made-up tech and give that tech to the civ for free. I'd have to play around with how to make it non-researchable so no one else can get that tech, but you get the point. There are work-arounds.

Not sure how to work around the example from #2, with happiness from trade routes as a trait. I'm willing to take suggestions.


Sooo...

If anyone who has a lot of modding experience can answer my questions, I'd really appreciate it. Are numbers 1-4 above really things I just cannot do? Are the work-arounds I suggested for the different examples doable? Are there easier ways to do what I want? Are there any suggestions for a work-around for the example in question #2?

Thanks for your help!
 
If it helps any, I'm a complete noob when it comes to XML and modding, never had any experience with either. I'm figuring a lot out though. So keep that in mind when responding. Thanks.
 
You can add new tables, and new columns to existing tables. But the things you add simply won't work, because there is no code that makes them work. In some cases, you can code these things in LUA (see here), but some things are impossible to do until we get access to the DLL code.
 
For example, going back to the moving faster on roads example in #1, I COULD create a unique unit for the civ that replaces the worker. It would do everything a normal worker would do, except it wouldn't build "roads." It would build "highways" or whatever I decide to call the new thing I create to replace roads. And these highways would have a better movement rate attached to them than roads. For this I would need:

Civilization_UnitClassOverride (HIGHWAY_WORKER)
Unit_Builds (with UnitType of UNIT_HIGHWAY_WORKER and BuildType of BUILD_HIGHWAY
Builds (BUILD_HIGHWAY with all the needed info, including RouteType of ROUTE_HIGHWAY
Routes (new ROUTE_HIGHWAY with my movement changed to whatever I want)

As this would be my "trait" or Unique Ability (or part of it, at least), I can still add another Unique Unit and/or Unique Building. Actually I suppose I could add as many unique units/buildings as I want, but I like to keep it as 1 each of UA, UU, UB.

This should work, although I'm not sure if adding new route types to the game can cause problems or not.

Further working around of #4 would be the example in #3, with rivers plots adding 1 extra gold. This would be pretty easy, doing it similar to the Highway, except using a building. I COULD create a new BuildingClass and give that to the civ in Civilizations_FreeBuildingClasses. I'm actually not sure if that would give it to all cities for free, or just the first one. (I'm thinking all, because the only reason that the Palace isn't given to all cities is that its "instances" is limited to one. That's why you get a new Palace if your Capital gets taken, it's free to all cities, but you can only have one. Does that make sense?) If not to all, then just make it very cheap to build. The trick in this case would be having it available only to your civ. I would attach it to a made-up tech and give that tech to the civ for free. I'd have to play around with how to make it non-researchable so no one else can get that tech, but you get the point. There are work-arounds.

Adding a free building that gives the desired effect should work, I'm going to do it in my mod to give some civs different yields from some terrains and features.

Edit: Happiness from trade routes can be a hidden policy that is given to that civ at the beginning of the game. Should be doable with LUA.
 
Back
Top Bottom