First post: Step by step instruction for a simple Improvement.
Second post: Library of relevant tags (work in progress)
Alright, here is a quick guide on how to get all those nifty tiles you guys created to be available as build options in your cities.
Basics:
Tile Editor:
The tile editor is pretty self explanatory, the only thing I'd like to point out is that you might want to create two actual tiles per improvement you are planning. The first one should contain the finalized graphic (save this as YourTileName_01), while the second one should contain graphics for the building process (Like some workers, building materials, scaffolding, etc.) of your improvement (save this as YourTileName_Build_01) .
Main:
Example:
As you can see, the Improvement I'm adding has the name Malloreon_Sm_Dirt_Patch. To prevent confusion I'm adding my name at the beginning of each file I'm creating (File names are unimportant to the game, so feel free to do this).
Now, let's give our City Improvement an In-game name and description, and tell it which graphics to use:
A few more necessary tags include:
Let's get to the costs of construction:
Turns until build:
<LaborToBuild>#.#</LaborToBuild> - Replace #.# with numbers (such as 2.0 for 2 turns) the lowest number seems to be 1.0 (even putting 0.0 resulted in building requiring 1 turn to build)
Resource Cost:
<GameModifier>
<ModType>ConstructionResourceCost</ModType>
<Attribute>RESOURCE</Attribute>
<Value>#</Value>
</GameModifier>
Prerequisites:
<PreReq>
<Type>TYPE</Type>
<Attribute>Attribute</Attribute>
</PreReq>
Further Prerequisites can include:
<RequiresCity> - can be True or False
<RequiresResource> - can be True or False
<RequiresCityImprovement>InternalImprovementName</RequiresCityImprovement> - for example 'Malloreon_Sm_Dirt_Patch' is the internal name of the tile I created in my examples. I could use the presence of that improvement as a requirement to build something else.
Ok, it's way past my bedtime, I'll add some more to this later.
Note 1: I did not test A LOT of the following information, so please feel free to post corrections - I will try to incorporate them. I would love to add (or have someone add) this information in a Wiki. Sooooo, feel free to let me know about one that actually gets used.
Note 2: I will only type out the start tag for each command, always properly end each command by adding a / in the beginning of the closing tag, as in: <ImprovementTypes> and </ImprovementTypes>.
Some tags are 'containers' meaning they accept/require several commands with their own individual tags within. I will try to mark each of these tags by marking them Container in the description. An example of a container tag would be <Prereq>. Usage as follows:
<Prereq> <Type>Allegiance</Type> <Attribute>Kingdom</Attribute></Prereq>
Note 3Unless I'm sadly mistaken (and if I am, tell me, so I can burn in shame ... and fix my mistakes) integer numbers are full numbers (e.g.: 1 or 2) and real numbers have fractions (e.g.: 1.3 or 0.5). I will refer to this several times.
Improvement Basics:
<ImprovementTypes> Container. These tags need to be at beginning and end of each file containing one or more improvements
<ImprovementType InternalName="NAME"> Container. These tags are required at beginning and end of each individual improvement
<TileDesign> The internal name of the tile you created in the tile editor. This is not the name of the 'Improvement', but only of the purely graphical tile you created.
<ConstructionTileDesign> This is the internal name of the tile to be displayed while the improvement is under construction. See <TileDesign>.
Improvement Names and Descriptions:
<DisplayName> This determines the visible in-game name of your improvement
<Description> Visible in-game description
<LongDescription> Visible detail description
Requirements and Terrain Types
<RequiresCity> This can be either set to True or False
<ReqCityLevel> Only used if <RequiresCity> is true. Can be set to a value between 1-5
<RequiresResource> Requires control of the named resource (might be useful with shards (K_Fire__Shrine, K_Earth_Shrine, etc., I'd assume empire variants are F_Fire_Shrine and F_Earth_Shrine)
<RequiredImprovement> Accepts internal names of improvements. If the named improvement is not present, the improvement containing this tag cannot be built.
<IgnoreDuplicateImpLimit> When set to True this lets you build multiples of your improvement per city.
<AllowedPerCity> Might be able to restrict the amounts of possible repeat improvements, when you set improvements to non-unique (per above command)
<AllowedPerGame> Accepts any number as parameter. When set to 1, this allows only one improvement of this type in game at any point in time, essentially making it a 'World Wonder'.
<AllowedPerFaction> Accepts any number as parameter. When set to 1, this allows only one improvement of this type in your kingdom, essentially making it a 'National Wonder'.
<Prereq> Container. This lets you add prerequisites that have to be met in order to build the improvement.
<SupportedTerrainType> Can be set to City, Land, Beach
Influence/Zone of Control
<ZOCMinRadius> Adds an influence/zone of control radius to your city. This tag determines the minimum radius. Accepts an integer value.
<ZOCMaxRadius> Adds an influence/zone of control radius to your city. This tag determines the maximum radius. Accepts an integer value.
<ZOCRadiusTurnsBeforeUpdate> Determines the number of turns before the control radius increases.
Construction Cost
<LaborToBuild> Accepts a real number, but I believe it only utilizes the number before the dot. Floor seems to be 1 (I tried 0.0, but it still took 1 turn to build)
There are several ways to add a construction cost, e.g.:
<GameModifier> Container. This is the container in which you add the improvements resource costs.
Resource Production
Enough for now, adding more later.
Excellent Guide. You might want to make a note though, you don't Need to put everything in the "Units" folder for the game to see it. I put my Custom Map Sizes into the "C:\Program Files (x86)\Stardock Games\Elemental\data\English" directory and it works just fine from there.
I'm interested in working on/getting help with a mod to make 'wizard towers' similar to age of wonders.
The idea is to be able to build a tower in high level city (4-5), and have one per faction. This tower would serve as a 'base' for a sovereign, that would give increased Essence as well as essence generation. It would also either a) extend the range of his spells (including being able to cast in combats that your champions are in, like Age of Wonders) a specific amout or B- hopefully- extend the range to anywhere in that nations territory (in this case, NOT be able to cast in battles if champions are in enemy territory)
This ability would ONLY be for the sovereign (maybe direct heirs), and would leave if left the tower- it would give you a good reason to keep your ruler home once a large nation is achieved. it also provides incentive to use your soverign to invade.
as far as i know, this idea has not been implemened in game yet.
I'm pretty sure that will require some python work to pull off anything like Age Of Wonders did with it's towers.
k probably would = a big fat fail in my part due to my lack of experience
Added some more stuff.
ogredpowell: There are definitely ways to make a tower that increases essence and mana regeneration - however, so far I know of no way to give this bonus only when the Sovereign is in the city.
Anyhow, here is the code for the bonus:
<ModType>Player</ModType>
<Attribute>AbilityBonus</Attribute>
<StrVal>A_UnitStat_Essence</StrVal>
<Value>1.25</Value>
This one should add 25% more Essence. However, I didn't try this. Also, in a game file this line was added (for the Temple of Essence):
<Priovides>25% boost to our essence.</Priovides>
including the miss-spelling. Both the miss-spelling and the Conversational type of value make me think that this was more meant as a comment, than as real code.
And I found this tidbit in another improvement file:
<GameModifier> <ModType>Player</ModType> <Attribute>AbilityBonus</Attribute> <StrVal>A_ManaRegeneration</StrVal> <Value>2</Value> <Provides>+2 to Mana Regeneration</Provides> </GameModifier>
Once again, there is this <Provides> tag with conversational text .... I now assume that <Provides> is just like the <Description> tag, except maybe in a different location.
You might want to make a note though, you don't Need to put everything in the "Units" folder for the game to see it. I put my Custom Map Sizes into the "C:\Program Files (x86)\Stardock Games\Elemental\data\English" directory and it works just fine from there.
Raven X: This is definitely correct, however, adding files into the folder you mentioned is unintended (that one is for Core files provided by Stardock) and can lead to update/compatibility issues. You should always put mod files into the /Documents/My Games/Elemental folder. I specified the 'units' subfolder, as frogboy previously mentioned this one as the folder currently intended for mods. This will likely change once we get the full game.
Ahh, thanks for the info, definitely good to know. I guess if putting files into the directory I named can mess up updates maybe I shouldn't put them there. Then again I always make new files for whatever I mod and don't change the core files so they "should" be ignored during an update. I'll do some experimenting with it when we get the full version this weekend. I want to say that soon we'll be able to put all our modded files in the "Mod Folder" as that would make the most sense but I guess we'll have to wait and see if that's how it's going to work.
Oh, if you have an additional, personal, folder in your /data/English directory you are 'probably' OK. It's when you start throwing random files into the core folders that it gets messy (and messy is all it would be, provided you don't accidentally give a file a name stardock is using as well).
But as you just said, launch is around the corner, which will most likely give us a full-fledged mod folder, thereby making this discussion entirely academic.
mallorean, thanks
there probbly is a way to do it- units get upgraded hit points from being in a city, more so when you have city defenses. so....maybe it is worth looking into.
Very helpful!
Ogredpowell: It seems that
<ModyType>City</ModType>
<Attribute>AdjustDefendingUnit</Attribute>
...
Let's you adjust stats of a defending unit in a city. However, the code for this is VERY dirty in the beta, and my game crashes too often for me to test anything before release, so I don't know how well we can use this. You can find the code in KingdomSpecialImprovements.xml.
I want to replace the vanilla improvents with my Robust City designs. How do I overwrite the vanilla withe the chocolate?
Sounds like a Move of the Original files from "/Program Files(x86)/Elemental/data/English/Core Improvements" then replace with your "Robust" version, then run the "ill-advised at this time"
/createxmlbinary"
Actually I just want to have them upgrade to my designs after a city reaches level 4 and then 5.
Actually, now I could be wrong on this but placing mods in the "my documents/my games/elemental/" directory was only intended for the beta as a temporary respite for hungry modders. I think the intent was to add a mods folder in the base game directory.
Which when I installed Elemental there was an empty Mods folder. That is where I have been placing mods an they seem to work fine...
I do know that the xml files don't work in sub folders in the Mods directory however. They have to be all in one folder. Which is ok as long as modders don't use the same xml file names, or unintentional overwrites may occur.
edit: btw I would recommend using Notepad++ instead of windows notepad. It is far superior for code editing to notepad in every way!
Seanw3:
Try finding the Improvement you want to upgrade in the core game folder - then copy its xml code into a new file. Once you copied it into the new file, add the line
<UpgradesToImprovement>INTERNAL_NAME</UpgradesToImprovement>
Where INTERNAL_NAME is the name you will assign to this new city improvement.
You should add this new city improvement in the same file as per the above-stated rules (making sure that you add the proper requirements, such as <ReqCityLevel>4</ReqCityLevel> and maybe some technology requirements.
Is it crazy to think that having a building require a level of 4 and setting it to be an upgrade of a vanilla building that requires a level of one will make the low level building upgrade as the city does? Here is my code:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- **************** --> <!-- ** Arcane Lab ** --> <!-- **************** --> <ImprovementType InternalName="K_Arcane_Laboratory"> <!-- Improvement Data --> <DisplayName>Arcane Laboratory</DisplayName> <Description>Arcane Laboratories increase the Arcane Knowledge produced by the settlement by 1.</Description> <TileDesign>K_Arcane_Lab_01</TileDesign> <ConstructionTileDesign>K_Arcane_Lab_Build_01</ConstructionTileDesign> <SupportedTerrainType>City</SupportedTerrainType> <DrawnIcon>Gfx/TacticalIcons/K_ArcaneAcademy2.png</DrawnIcon> <DrawnIconConstruction>Gfx/TacticalIcons/K_ArcaneAcademy2_C.png</DrawnIconConstruction> <Thumbnail>K_Arcane_Laboratory_01_Thumb.png</Thumbnail> <UpgradesToImprovement>Robust_City_Arcane_Conservatory</UpgradesToImprovement> <ReqCityLevel>1</ReqCityLevel> <AllowedPerCity>1</AllowedPerCity> <!-- Medallion Data --> <Medallions> <All>K_Arcane_Laboratory_01_Thumb.png</All> <Border_All> </Border_All> </Medallions> <!-- Prerequisites --> <RequiresCity>True</RequiresCity> <SupportedTerrainType>Land</SupportedTerrainType> <!-- Cost --> <LaborToBuild>5.0</LaborToBuild> <!-- Costs Lumber to build --> <GameModifier> <ModType>ConstructionResourceCost</ModType> <Attribute>Gold</Attribute> <Value>-10</Value> </GameModifier> <GameModifier> <ModType>ConstructionResourceCost</ModType> <Attribute>Materials</Attribute> <Value>-1</Value> </GameModifier> <GameModifier> <ModType>Resource</ModType> <Attribute>SpellPoints</Attribute> <Value>1.0</Value> <PerTurn>1</PerTurn> </GameModifier> <Prereq> <Type>Allegiance</Type> <Attribute>Kingdom</Attribute> </Prereq> <!--<Prereq> Brad wants this to have not tech requirement (charles 07/09/10) <Type>Tech</Type> <Attribute>Arcane_Research_Amarian</Attribute> </Prereq>--> <!-- AI Info --> <AIData AIPersonality="AI_General"> <AITag>Arcane</AITag> </AIData> </ImprovementType> <!-- ************************* --> <!-- ** Arcane Conservatory ** --> <!-- ************************* --> <ImprovementType InternalName="Robust_City_Arcane_Conservatory"> <!-- Improvement Data --> <DisplayName>Arcane Conservatory</DisplayName> <Description>Arcane Conservatories increase the Arcane Knowledge produced by the settlement by 2.</Description> <TileDesign>K_Arcane_Lab_01</TileDesign> <ConstructionTileDesign>K_Arcane_Lab_Build_01</ConstructionTileDesign> <SupportedTerrainType>City</SupportedTerrainType> <DrawnIcon>Gfx/TacticalIcons/K_ArcaneAcademy2.png</DrawnIcon> <DrawnIconConstruction>Gfx/TacticalIcons/K_ArcaneAcademy2_C.png</DrawnIconConstruction> <Thumbnail>K_Arcane_Laboratory_01_Thumb.png</Thumbnail> <ReqCityLevel>4</ReqCityLevel> <AllowedPerCity>1</AllowedPerCity> <!-- Medallion Data --> <Medallions> <All>K_Arcane_Laboratory_01_Thumb.png</All> <Border_All> </Border_All> </Medallions> <!-- Prerequisites --> <RequiresCity>True</RequiresCity> <SupportedTerrainType>Land</SupportedTerrainType> <!-- Cost --> <LaborToBuild>5.0</LaborToBuild> <!-- Costs Lumber to build --> <GameModifier> <ModType>ConstructionResourceCost</ModType> <Attribute>Gold</Attribute> <Value>-10</Value> </GameModifier> <GameModifier> <ModType>ConstructionResourceCost</ModType> <Attribute>Materials</Attribute> <Value>-1</Value> </GameModifier> <GameModifier> <ModType>Resource</ModType> <Attribute>SpellPoints</Attribute> <Value>1.0</Value> <PerTurn>1</PerTurn> </GameModifier> <Prereq> <Type>Allegiance</Type> <Attribute>Kingdom</Attribute> </Prereq> <!--<Prereq> Brad wants this to have not tech requirement (charles 07/09/10) <Type>Tech</Type> <Attribute>Arcane_Research_Amarian</Attribute> </Prereq>--> <!-- AI Info --> <AIData AIPersonality="AI_General"> <AITag>Arcane</AITag> </AIData> </ImprovementType>
I have thought about adding something like this as a prereq:
<Prereq> <Type>ReqCityLevel</Type> <Value>4</Value> </Prereq>
Any thoughts?
You already have that: <ReqCityLevel>4</ReqCityLevel> is right in the middle of your code.
However, it seems you want your improvement to give you 2 spell research per turn - it doesnt actually give you that though - you left
<GameModifier> <ModType>Resource</ModType> <Attribute>SpellPoints</Attribute> <Value>1.0</Value> <PerTurn>1</PerTurn> </GameModifier>
unchanged.
EDIT: Yeah, as has been pointed out, you need to fix the code so that the upgraded structure confers the right bonus.
in the coreraceconfigs.xml you can find this:
<BuildingStyle>
</BuildingStyle>
But i didn't found it in any other file (except the MainCampaign.xml, but this doesn't matter i think).
From the meaning i think the developers intended to give buildingstyles easily to any factions by this option.
It would be nice if i could add new cityset (and nothing else, only the looks) without creating a new techtree - if the techtree and the building attributes are the same.
Any experience with it?
FYI, I realized that before I posted and fixed it. I was going to edit here, but I thought some of you would enjoy finding the error. Just so you know I was one of the few people to get GalCiv2TA to have Star Wars modded weapons to work. I am actually thinking now that it would be better to not give bonuses to high level buildings as it defeats the purpose of tech advancement, which is why the devs have it the way it is.
I wonder if any have input about this.
A few pair of possibly useful tags.
To change a buildings appearance after your city reaches a certain population:<TileStagePopulation>#.#</TileStagePopulation><TileStageDesign>TILE NAME</TileStageDesign>
TileStagePopulation can be set to any positive number. It's not exact though, in my tax mod, my office upgrades at 100 and 500 citizens, however it usually takes a turn or two for the game to register the upgrade and change the tile. It's not really a big deal though.
TileStageDesign is exactly like the normal TileDesign tag, except that it needs to follow a TileStagePopulation tag.
It seems very difficult to make a nation with its own buildingstyle. (for me)
The <Prereq> can determine the alligance, the techtree and the baserace (men/fallen, and not gilden e.g. i used kingdomofgilde, gilden, ironeers, race_type_ironeers and didn't work)
So there is three option which are practically the same.
Sollution: make a new allegiance, baserace or techtree
The techtree option looks to be the easiest. So i created a totaly new techtree ( only minor changes to see if it works) and it works. But i had to change a lots of file and if a patch affects the trees i have to supervise that lots of file again.
So is there a method which can assign the building to a particular nation?????
And after i give them their own buildings they will build the originals either. So i have to make that buildings unattainable for my nation.
Please help!!!
Thanks
On the topic of interesting possibilities, I noticed in the raceconfigs these tags
<NewCityHubType>Outpost</NewCityHubType> <CapitalHubType>Outpost</CapitalHubType>
which would possibly mean we can have one cityhubtype for our capital and another for our outliers. If possible, this would tie into tile design as well.
Edit: The tag appears not to be functional. Too bad.
There are many great features available to you once you register, including:
Sign in or Create Account