View Full Version : [TUT] skin and add new Bonus Resources and add Improvements
Master Lexx Jan 12, 2006, 12:25 PM Tuturial: how to skin and add new bonus resources and improvments to the game
I am the creator of GreenMod, I already included 9 new resources there. I want to share my knowledge and give instructions on how to do this for your own. How to alter the skins of existing resources to re use them for new ones, how to add new improvements and how to setup the xml files CIV4BonusInfos.xml , CIV4ImprovementInfos.xml , CIV4ArtDefines_Bonus.xml , CIV4ArtDefines_Improvement.xml , CIV4BuildInfos.xml , CIV4UnitInfos.xml .
If you have any ideas or corrections regarding my guide, please send them to me via personal message!
(or maybe you want some extra pics or description to something, simply pm me!)
Here I will take the most difficult example on how to add a bonus resource, other bonus resources may be more simply but if you can make this difficult one, you will also be able to make all the simple ones. You can always look into GreenMod if you want to see it working. This tutorial is made for mod makers, who have some basic knowledge about graphics painting and know how to alter xml files. Don´t even try to ask here how to begin an own mod or where to get the xml files from and other basic things!
I don’t speak native English, so please forgive me my sometimes worse word selection.
You need Paint Shop Pro (http://www.zdnet.de/downloads/prg/s/l/de0DSL_is-wc.html, shareware)
Also get a hex editor (HexWorkshop, http://bpsoft.com/ , shareware)
A xml editor (notepad++, http://notepad-plus.sourceforge.net/uk/about.php , freeware)
A dds converter (DDSConverter 2.1, http://eliteforce2.filefront.com/file/DDS_Converter;29412 , freeware)
And make sure that in the DDSConverter options “save alpha if any” is activated!
Also extract all the game resources with the pak extractor (there are w2k and wxp versions). The folder where you extracted your ingame art directory with this, will be refered by me as “exart”. (http://forums.civfanatics.com/showthread.php?t=137265)
Other abbreviations:
dir = directory
pic = picture
ddsc = dds converter
impr = improvement
mymod = dir of the mod (Civ4\Mods\Mymod)
First some basic knowledge about selections and alpha channels with Painst Shop Pro.
The alpha channel is just second picture in a picture. This alpha channel can only use grey scale colours, a black pixel at a sertain position in the alpha channel means that the same pixel in the real pic will not be visible (0%) outside the graphics programm. White means complete visible (100%). All colours between black and white represent a different transparency for the real pic between 0% and 100% visible.
There are three possibilities to edit the alpha channel in PSP. First go into the menu – selection – selection (load/save) – load selection out of alpha channel. Now you see a new selection, this represents any not complete black colour in the alpha channel. So you can´t know if this is nearly invisible or complete visible.
http://myrror.net/civ/tut/sel_loa.jpg
One way to make this visible is to go in the menu – selection – edit selection , now you can see the alpha channel represented with red colour on top of your real pic. With a black color you can remove the visible parts, with a white colour you can add new visible parts to the selection.
http://myrror.net/civ/tut/sel_add2.jpg http://myrror.net/civ/tut/sel_sub2.jpg
Another way is to go menu – selection – selection (load/save) – save selection as file , the new file can be edited like every other pic. But only use greyscale colours there, because you want to use it again as selection/alpha channel later.
http://myrror.net/civ/tut/sel_add3.jpg http://myrror.net/civ/tut/sel_sub3.jpg
A cheap although easy way to edit the alpha channel is to just let it be a selection. If you hold shift pressed while working with the selection tool you can add a new selection to the existing one (like complete white) and if you hold ctrl pressed you can remove something from the actual selection (like complete black). This is my preferred way to alter the alpha channel, but remember that the existing selection may not be all white, it can be every value between black and up to white.
http://myrror.net/civ/tut/sel_add.jpg http://myrror.net/civ/tut/sel_sub.jpg
After you edited the selection or loaded it from a file, you need to save this again into the alpha channel of this file. Menu – selection – selection (load/save) – save selection into alpha channel, as name use the same name the existing alpha channel already has or it may add a second alpha channel but not all formats support more than one alpha channel (like dds).
http://myrror.net/civ/tut/sel_sav.jpg
Remember after this you still need to save the file itself!
Master Lexx Jan 12, 2006, 12:46 PM Okay let´s start, you have your own mod and want to include the resource “lemon” into it.
The ingame texture artwork:
First open google, maybe wikipedia and search for lemons, see how the plant really looks. Lemons can grow on rather small bushes but also on big trees. Now start the game and place all resources and look, if any of the 3d models are useable to change their skins to make a new resource with one of them. The resource “spices” is very nice, it looks like many small bushes that have some fruits hanging down on them. So you chose this. The new resource doesn´t has to look really realistic, the most time players will not zoom in, so it just has to look good from a far distance.
Go into exart and search for the spices dir, you can find it in exart\terrain\resources\spices\ . Now copy over the dir to mymod\art\terrain\resources\spices\ . With this the game simply uses the new spices dir instead of original one, so you can easily make changes to it and see how they look without any xml work to do. Of course this just replaces the resource instead of adding a new one, but you will later make a real new resource out of it.
Now use ddsc and convert all the dds files in the spices dir into psd. Do never use jpg or bmp because they don´t support a alpha channel. Tga, png and psd are fine. Make a backup of all the psd files into a sub dir for the case that you need the originals later. No fear, if you delete the dir, the original spices out of the pak files will be used again by the game.
http://myrror.net/civ/tut/ddsc.jpg
Of couse you can´t know how the 3d model of this looks so try this, paint all the parts in the psd files into one color each, then select everything and save the selection into the alpha channel. So with everything selected, go into menu – selection – selection (load/save) – save selection into alpha channel, name the new alpha channel exactly like the old one, so it overwrites the old alpha channel instead adding a second one (which wouldn´t work for dds). Do remember that you still have to save the file itself after you saved the new alpha channel into it. For this case you modify the file spices_l.psd, and after all paintings are made you convert it back to dds and start the game to see how it looks.
http://myrror.net/civ/tut/tex_ori.jpg http://myrror.net/civ/tut/tex_col.jpg
On my ingame pic you can see on the top left the unworked spices, in the middle the unworked spices with the plantation improvement, and in the lower right the worked (with citizen) spices plantation. Now you see which parts in the psd files are used for which part of the 3d model. What you can´t see here is, that the blue part is layed on top the yellow part, because we made the whole pic visible with the new alpha channel. You could also not alter the alpha channel and then you will see a bit better which texture part is for which 3d part. But eg if you want to use the dye 3d model it is really helpful to see all the 3d model parts. Make a screenshot of this and make notes on a sheet of paper so you don´t forget how the 3d model looks and what textures are layered on what 3d model parts.
http://myrror.net/civ/tut/ing_col.jpg
http://myrror.net/civ/tut/ing_col2.jpg
Maybe you have noticed that there are two files: spices_L.dds and spices.dds. Sometimes there are even more files, each for one purpose. Here the spices_L.dds is used for the ingame textures and the spices.dds is used for the civilopedia textures. The dye resource eg has 4 files, steam.dds (this is appearing over the round container, if you don´t want steam, simply make the alpha channel all black), dye.dds for civilopedia textures, dyeL.dds and dye_Lsystem.dds are maybe for the case with plantation and without. You should simply make your changes to the ingame one file and if you think that it´s finished, copy over the changed texture parts to the other files. Sometimes the textures aren´t shown in game, then it can be that you have to write the L in the filename uppercase. This happened once for me, and was fixed by an uppercase L.
Now you know that the blue and yellow parts are used for the fruits in the case that there is no plantation or that there is a plantation and it is worked. The red part is used if it has a plantation but is not worked. The textures for the fruits are spread into all 4 directions. I can´t help you with painting the new textures, with this you are on your own. But make it simple and alter only the blue part and copy this over to the yellow part because there are two levels of leaves with fruits and no player will be able to distinguish if they are the same. And because you want the fruits to be shown in any case you also copy it over to the red part.
http://myrror.net/civ/tut/lemL_sel.jpg http://myrror.net/civ/tut/lem_alp.jpg
Of course you still don´t have the fitting alpha channel. The simple way is, to load the original one as selection and repaint the alpha channel around your new fruits. For this simply have the original alpha channel loaded as selection, zoom in and hold shift pressed for adding areas to the selection or have ctrl pressed for subtraction from the selection. If you repainted the selection for one of the parts, you can save the whole selection as file, open this alpha file and copy over the ready made alpha part to the other alpha parts, save it and load the selection from this alpha file into your real texture file. In the alpha file, all black areas mean that the textures will not be visible, whereas white means that this texture area is visible, a grey means that this texture area will be half transparent.
Note that each part has it´s own dimensions, you can´t see the borders. The texture file itself is 256x256 in size, each of the yellow, red and blue parts is 128x64 pixel in size. You can always paint borders in the file by yourself, it doesn´t matter in the case they aren´t shown because of black alpha or if you will overwrite them later. PSP shows in the status bar which dimensions your current selection has and over which pixel your mouse pointer currently is, this really helps. Also note that the colours may not be converted completely, eg a real red in the psd may be shown in the game as a little darker red, remember this in your colour selection.
Save the loaded alpha selection into the alpha channel, save your file, copy over all the changed parts (coloured and alpha) to the other file and convert both files into dds again, finished. The best thing is, always to save the alpha channel of both files as file, and copy over the parts in the ready made alpha file to the other alpha file. If you save a slection into an alpha channel, remember that the alpha channel name has to be identical with the existing alpha channel name so it replaces the existing one.
All resources have different dds files for different puposes. Eg. my sulphur resource was made out of the silver resource, but I had to change a little dds file which was used for the shimmering effect on the silver, I had to make it complete grey to get a solid yellow for sulphur. You need to find out for what purpose all the dds files are.
Also note, all the resources with plantations need extensive modifications to the CIV4PlotLSystem.xml because they extensively use the Lsystem. This system is used for placing all the little bushes and the plantation building so that roads run between them and not through them. All the silver/stone/… resources can be easily modified, you just need to change the dir name of them. Rice has shimmering water and this cannot be removed, also it has three textures, they are switched depending on if it has a farm on it or if it is worked. You cannot change this. The wheat resource also always changes if it has a farm on it. The best modifiable resources are dye and spices. In GreenMod I used dye for “tea”, marble for salt, wheat for potatoes, spices for coffee, silver for sulphur, clam for pearls, spices for lemons, dye for cotton, and the chichen itza wonder for ancient temple.
Master Lexx Jan 12, 2006, 12:52 PM The ingame icons artwork:
There are four icons for each resource. Two are the little icons in city screen and if you scroll over the resource on the map, two others which are basically the same are the bigger icons which are shown in civilopedia and in the game if you press ctrl-R. First you need to open google and search for lemon, switch to picture search, size small for this. You need a pic with size between 50x50 up to 300x300. The important fact is, that is has to look good after you resized it to 50x50, the overall size used is 64x64 but there is a border included.
I found this one: http://myrror.net/civ/tut/lemon.gif
So let´s get the icon for spices. You can find it here exart\interface\buttons\worldbuilder\spices.dds , copy it over to mymod\art\interface\buttons\worldbuilder\spices.dd s and convert it to psd. Open it, paint all the spices art black, and only let the borders untouched. Now open the picture of lemon you found (you can also paint your own), be sure to have a black background, for this it is always good if the existing background is solid or transparent, it´s hard work to get the pic out of a varying background. If the background is of a solid colour, simply select everything, copy it, change the second colour in the colour palette panel to the background colour of the pic and paste the selection into a new pic as transparent selection. With this, the background colour of the pic is seen as transparent colour in PSP. If your lemon file already has a transparent background, you have simple work.
The new lemon pic now has the lemon with a black background. Get rid of all the black borders, cut them off, so you have the lemon art in the middle and a few pixel of black as border on all four sides. Now resize the pic, copy everything, have black as transparent and paste it as transparent selection into the spices.psd pic. If it fits well in it between the borders you completed the first step. There should always be around 4 pixel space between the original borders and the lemon art, if it is too big, start over, undo the resize change in the lemon pic and restart resizing it and again copy it over to the spices.psd.
http://myrror.net/civ/tut/but_spi.jpg http://myrror.net/civ/tut/but_emp.jpg http://myrror.net/civ/tut/but_lem_sel.jpg
So now your spices.psd is well made, you have the original borders and you have the lemon art in it. But again, you need to repaint the alpha channel. So load a selection out of the existing alpha channel, deselect all the original art alpha selections, nothing but the borders should left. Remember that the current selection can mean any colour but black, so you can´t know if the current selection is fully transparent or barley visible. Then add the whole area of the lemon to the existing selection and make it one pixel bigger, so you get a black border around you lemon. Save the selection into the alpha channel and save the file, convert it to dds, finished.
Of course you can also save the alpha selection as file and there add the one pixel border around the lemon as grey instead of white so you would get a smoother transition between the lemon and the outside area. And then again reload the alpha and save it into the spices.psd file.
That´s everything you have to do to get a button for the worldbuilder working. But you could be nice and do some more work. The game can load those pictures out of the single spices.dds and out of the unit_resource_atlas.dds. So if you go into the game and want to see if your new spices.dds is working, you will still see the old one because the game doesn´t load it from this single file. The big atlas.dds has all the pics of the units and resources in it, it is a big pic which can be loaded into the ram easily. I think the use of a single dds file for each resource wouldn´t be that memory efficient for the game as the big file is.
So you make your own big file in which you can put all your resources, units, buildings and all other graphics. Convert the unit_resource_atlas.dds to psd, rename it to mymod_atlas.psd. Open it, make everything black, open your spices.psd and copy the whole graphic as selection in the top left of your mymod_atlas.psd. Load the alpha channel of mymod_atlas.dds and save the selection as file. Open this alpha file, make it all black. Save the alpha channel of your spices.psd as file, open this alpha file too. Copy over all the graphics out of the spcies alpha pic into the top left corner of your mymod_atlas alpha pic. Save your big alpha pic and load it into your mymod_atlas.psd file, save this selection into the alpha channel and save the pic itself. Now you have your own big atlas file, with one little resource graphic (including border) and a working alpha channel for this whole file.
You must not resize this mymod_atlas.psd. I tried it and the game wasn´t able to load any graphics out of it then. It should stay on it´s original size. Also make sure, that the alpha channel is placed correctly, a one pixel mistake can make a visible difference.
The ingame mini icons artwork:
So there are still two small icons used by every resource, we have to add them. And again copy over Assets\Res\Fonts\GameFont.tga and GameFont75.tga to mymod\Res\Fonts\ .
Those two tga files each have a set of all the miniicons, each graphic in GameFont.tga has to be 21x20 in size and GameFont75.tga needs all graphics in size 16x16. Of course you still have the lemon pic with the lemon art and black background. Now again try to resize it to, but to 21x20 and there should be one pixel space between all borders, so the lemon should be 18x19 in size. Copy it all over into the next empty square, just next to movies icon. Paint a black border around this lemon art. But make the rest in the box white. Load the alpha channel as selection and add the new lemon art including the black border to the existing selection and save the new selection into the alpha channel.
There is no need to add the selection pixel by pixel, just add the icon box (without the pink borders) to the whole selection and then use the magic selection staff, hold ctrl pressed and deselect the white areas around the new lemon art, that´s much faster and easier.
Now look on the movies resource square, it has a light blue/green dot on the right side on the pink grid. Get the colour of this dot and paint the dot at the exactly same position right on your lemon square with this colour. This little dot indicates, that this square is used. If you don´t place it, the game will simply start over and take the first resource miniicon. Okay, save the file, and do the same with the GameFont75.tga. But this time you don´t have to convert the files, because they are used as tga by the game.
http://myrror.net/civ/tut/fnt_lem.jpg http://myrror.net/civ/tut/fnt_sel2.jpg
The order in which the resources appear in CIV4ArtDefines_Bonus.xml tell the game which miniicon to use. If there are more resources than minicon sqauares with a blue/green dot on the side, the game will start over at the beginning. If this dot is placed correctly but you can´t see the miniicon in the game, you maybe forgot to repaint the alpha channel or to save it correctly for this new resource icon.
Master Lexx Jan 12, 2006, 01:04 PM The xml art defines part:
Copy over the CIV4ArtDefines_Bonus.xml to your mymod\Assets\XML\Art\CIV4ArtDefines_Bonus.xml. Open it, copy the whole part of the resource you used (spices here) and paste it on the bottom but obey the xml opening and closing tag rules! In type, change the name of the resource to lemon. fScale is the size of it ingame, fInterfaceScale is the size of it in civilopedia. Nif tells which 3d model to use, kfm tells which animations to use. Button tells which icon graphics to use, first it tries the last path, so it will look in Art/Greenmod_atlas.dds, x coordinate 7, y coordinate 3. But if you donīt have a big file for many of those icons, you could just use: <Button>Art/Interface/Buttons/WorldBuilder/Lemon.dds</Button>
This should look like this:
<BonusArtInfo>
<Type>ART_DEF_BONUS_LEMON</Type>
<fScale>0.5</fScale>
<fInterfaceScale>1.5</fInterfaceScale>
<NIF>Art/Terrain/Resources/Lemon/Lemqes.nif</NIF>
<KFM>Art/Terrain/Resources/Lemon/Lemqes.kfm</KFM>
<Button>,Art/Interface/Buttons/WorldBuilder/Lemon.dds,Art/Greenmod_atlas.dds,7,3</Button>
</BonusArtInfo>
Okay, now I have to explain something. This lemon example is a very difficult one. My sulphur was just silver, I modified the files, saved them and renamed the dir to sulphur. So I can use:
<NIF>Art/Terrain/Resources/Sulphur/Silver.nif</NIF>
<KFM>Art/Terrain/Resources/Sulphur/Silver.kfm</KFM>
Think about it. Place roads on a tile, place a mine on another one, and roads with a mine on another one too. Now place silver on all of them, nothing changes, the roads stay the same, the improvement too. So it doesnīt use the LSystem. It is used for the calculation of roads, the resources itself and the improvement and the look of the improvement on different eras.
But all the plantation resources are difficult. So I didnīt only changed the name of the dir, I also changed all the names of the files in it, I renamed them from spices to lemqes. I also opened all the files with a hex editor and renamed all appearances of spices to lemqes, Spices to Lemqes, spice to lemqe and Spice to Lemqe. Stupid name, I know. I just wanted to make sure the overall byte value count stays the same in the file, just for the case that there is some simple error checksum used to validate the file. But I didnīt changed the name if it was used for sound, eg. SOUND:AS3D_IMPROV_SPICE_WORKED because I donīt want to include a new sound. Maybe it will also work if you use a real custom name, but in any case you must not delete or insert a new byte into the file! And remember that there is sometimes a s added to the ending of the name and sometimes not, take this into account, it should not be changed.
So why the hell change all names? Because of the CIV4PlotLSystem.xml . Get it and copy it to mymod\Assets\XML\Buildings\CIV4PlotLSystem.xml . Open it, there you need to search for all appearances of spices. There are around 200 lines you need to change or copy over.
I tried to get it to work without hexediting the resource files and only change the name in the CIV4PlotLSystem.xml , but whatever I did, I couldnīt get it to work. So I went the easy way, I renamed every appearance of Spices to Lemqes, so there was no need to think in depth what to change, simply copy everything of spices in the xml, paste it directly below the spices part and again replace every name in the new lines.
First copy everything from <!-- SPICE crops --> until <!-- SUGAR crops --> . Then change all the names, but do not change the case, so lower and uppercase have to stay lower and uppercase. Do it like:
<!-- LEMON (Lemqes) crops -->
<ArtRef Name="art:lemon_crop">
<!-- when worked by plantation -->
<Attribute_Class="Scalar">NIF:Art/Terrain/Resources/Lemon/Lemqes_LSystem.nif::2x2_01_Lemqe_Worked</Attribute>
<Attribute Class="Improvement">IMPROVEMENT_PLANTATION</Attribute>
<Attribute Class="Bonus">BONUS_LEMON</Attribute>
<Attribute Class="Scalar">bCutTrees:1</Attribute>
<Attribute Class="Scalar">bBonusWorkedOnly:1</Attribute>
<Attribute Class="Scalar">bIsPartOfBonus:1</Attribute>
<Attribute Class="Scalar">szBatchGroup:lemqe_crop</Attribute>
<Scale>0.8</Scale>
<Rotate>+45</Rotate>
</ArtRef>
Do this again and again for all spices parts you find. Later you will find something like this:
<Attribute Class="Bonus">NO_BONUS,BONUS_ALL,!BONUS_SILK,!BONUS_DYE,!BONUS_S UGAR,!BONUS_SPICES </Attribute>
Change it to this:
<Attribute Class="Bonus">NO_BONUS,BONUS_ALL,!BONUS_SILK,!BONUS_DYE,!BONUS_S UGAR,!BONUS_SPICES,!BONUS_LEMON</Attribute>
Go on with this again, if you see ,BONUS_SPICES , change it to ,BONUS_SPICES, BONUS_LEMON .
The same with this: !BONUS_SPICES , change to !BONUS_SPICES, !BONUS_LEMON .
The BONUS_NAME has to be named after the real bonus name you that is used in CIV4ArtDefines_Bonus.xml and CIV4BonusInfos.xml .
So maybe we get a better description if the SDK comes out, but even if this happens, you still would need to add in all those xml entries. I am pretty sure the names of the files in the files are used here too, so the hexedit way is a safe and easy way and maybe the only possible.
Master Lexx Jan 12, 2006, 01:07 PM The xml bonus resources part:
Get this file CIV4BonusInfos.xml and copy it over to mymod\Assets\XML\Terrain\CIV4BonusInfos.xml .
You will have to add a complete new resource, so the best way to start is to copy everything from the resource you used as blueprint and paste it at the bottom of the file. You need to change the first lines before it can work:
<BonusInfo>
<Type>BONUS_LEMON</Type>
<Description>TXT_KEY_BONUS_LEMON</Description>
<Civilopedia>TXT_KEY_BONUS_LEMON_PEDIA</Civilopedia>
<BonusClassType>BONUSCLASS_GENERAL</BonusClassType>
<ArtDefineTag>ART_DEF_BONUS_LEMON</ArtDefineTag>
<TechReveal>NONE</TechReveal>
<TechCityTrade>TECH_CALENDAR</TechCityTrade>
<TechObsolete>NONE</TechObsolete>
<YieldChanges>
<iYieldChange>1</iYieldChange>
<iYieldChange>0</iYieldChange>
<iYieldChange>0</iYieldChange>
</YieldChanges>
<iAITradeModifier>0</iAITradeModifier>
<iHealth>0</iHealth>
<iHappiness>1</iHappiness>
<iPlacementOrder>5</iPlacementOrder>
<iConstAppearance>40</iConstAppearance>
<iMinAreaSize>3</iMinAreaSize>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>60</iMaxLatitude>
<Rands>
<iRandApp1>25</iRandApp1>
<iRandApp2>25</iRandApp2>
<iRandApp3>0</iRandApp3>
<iRandApp4>0</iRandApp4>
</Rands>
<iPlayer>100</iPlayer>
<iTilesPer>0</iTilesPer>
<iMinLandPercent>0</iMinLandPercent>
<iUnique>0</iUnique>
<iGroupRange>1</iGroupRange>
<iGroupRand>50</iGroupRand>
<bArea>1</bArea>
<bHills>1</bHills>
<bFlatlands>1</bFlatlands>
<bNoRiverSide>0</bNoRiverSide>
<bNormalize>1</bNormalize>
<TerrainBooleans/>
<FeatureBooleans>
<FeatureBoolean>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<bFeature>1</bFeature>
</FeatureBoolean>
<FeatureBoolean>
<FeatureType>FEATURE_FOREST</FeatureType>
<bFeature>1</bFeature>
</FeatureBoolean>
</FeatureBooleans>
<FeatureTerrainBooleans>
<FeatureTerrainBoolean>
<TerrainType>TERRAIN_GRASS</TerrainType>
<bFeatureTerrain>1</bFeatureTerrain>
</FeatureTerrainBoolean>
<FeatureTerrainBoolean>
<TerrainType>TERRAIN_PLAINS</TerrainType>
<bFeatureTerrain>1</bFeatureTerrain>
</FeatureTerrainBoolean>
</FeatureTerrainBooleans>
</BonusInfo>
If you donīt want to include a civilopedia description, change the third line to: <Civilopedia/>
But you should already know how to change xml files and know the rules. Everything between <BonusInfo> and </BonusInfo> describes the resource. But you should already know the basic xml rules.
Now I try to give a description of each xml tag:
Type = name of the resource
Description = key of the xml part for the name of the resource in all languages
Civilopedia = key of the civilopedia entries for all languages of the resource
BonusClassType = class of the bonus, there are explicit classes which will disable some options here like iGroupRand, but others like iArea are still taken into account. With the class general all other options are used, all the other classes are used so that this resource is placed equally in the world and maybe the AI also uses this to kow what will give more growth for a city like class grain or what is very important like with both files rush or modern.
ArtDefineTag = the key where it can find all infos about where the files for this resource can be found and which icon it will get.
TechReveal = which tech is needed before this resource is shown on the map
TechCityTrade = which tech is needed before this resource can be used for happy or health or use for units
TechObsolete = which tech makes it invalid for happy or health or trade
<YieldChanges>
<iYieldChange>1</iYieldChange>
<iYieldChange>2</iYieldChange>
<iYieldChange>3</iYieldChange>
</YieldChanges>
This can be a positive or negative change for the resource on this title, first is food, second production, third commerce.
AITradeModifier = bigger sizes mean, the AI will pay more to get this resource in trade but also wants more if you want to get this in trade. (Oil is 20, most others 0)
iHealth = how much health you get in every connected city for this resource
iHappiness = how much happiness you get in every connected city for this resource
iPlacementOrder = the way how the game places this resource on a new created world, so food resources are well spread, marble and stone are further away from civs,
those are different placement orders, just think of where resources are usually placed or start a new game and look how they are placed in the world and how near they are to civ start places.
iron and oil have 0,
copper and horse have 1,
alu and coal and uran have 2,
stone and marble have 3,
food resources have 4,
money resources have 5,
water resources have 6
iConstAppearance = this is a percentage, 100 mens full amount placed, 50 means only the half amount is placed, 200 the double amount. This depends on iPlayer! But it seems to have a limit, even if set to 2000 there are no more than 20 resources placed on a huge map.
iMinAreaSize = I believe, this is the minimum distance from which point of the same resource can be placed again.
iMinLatitude = the minimum latitude from where this resource appears, latitude 0 is a circle around the world exactly between north and south pole.
iMaxLatitude = the maximum latitude up until which the resource will be placed, latitude 100 are two points, the north pole and the south pole. Resources are never placed at latitude over 90. On some maps where there is no north and south pole, the north and south borders are latitude 90.
Rands = Those are percentages, the first is the chance that the resource will be placed one title away from the through iPlacementOrder calculated position, the second is the chance that it again appears one title away from the new position. There is no need for a third and fourth chance, because this will just be overhead because the chance is too low.
iPlayer = a percentage, this is the basic value for determining how many resources to place, 100 means one per player, 50 one per two players, 200 two per player. 0 has a special meaning, all food resources have this, the game then places as they fit
iTitlesPer = I believe this is the minimum amount of titles needed for placing one of this resource.
iMinLandPercent = if the resource will be placed on water and land, this is the percentage of how many of this will be placed on land.
iUnique = this sets how the AI thinks about the resource, so higher means more important, so the AI is more likely to start a war because of it and sees this as primary target.
copper, alu, marble, stone and the most others have 0,
all water resources have 1,
banana and deer have 2,
coal has has 4,
horse and uran have 6,
iron and oil have 7
iGroupRange = if iGroupRand is used, this sets how far away a more of this resource will be placed
iGroupRand = this is the percentage, how likely it is that there is another resource of this placed next to this one
bArea = if this is set and the map has more than one continent this resource will only be placed on one continent instead of all over the map
bHills = if set, the resource can be placed on a hill
bFlatlands = if set, the resource can be placed on flatlands
bNoRiverSide = if set, the resource will not be placed next to a river
bNormalize = means it is used for starting location normalization (extra resources that are added to even out starting locations)
<TerrainBooleans>
<TerrainBoolean>
<TerrainType>TERRAIN_SNOW</TerrainType>
<bTerrain>1</bTerrain>
</TerrainBoolean>
<TerrainBoolean>
<TerrainType> TERRAIN_GRASS </TerrainType>
<bTerrain>1</bTerrain>
</TerrainBoolean>
</TerrainBooleans>
<FeatureBooleans>
<FeatureBoolean>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<bFeature>1</bFeature>
</FeatureBoolean>
</FeatureBooleans>
<FeatureTerrainBooleans>
<FeatureTerrainBoolean>
<TerrainType>TERRAIN_GRASS</TerrainType>
<bFeatureTerrain>1</bFeatureTerrain>
</FeatureTerrainBoolean>
</FeatureTerrainBooleans>
TerrainBooleans tell on which terrain the resource can be placed. FeatureBooleans tell on which features in connection to the terrain of FeatureterrainBoolean[/B] the resource can be placed. FeatureTerrainBooleans tell on which terrain that also has one of the specified features the resource can be placed. The above example tells, that the resource can be placed on snow or grass or grass with jungle. If you want to make only terrains valid, use TerrainBooleans, if you want it to be placed on a terrain that also has a certain feature you need to use FeatureBooleans and FeatureTerrainBooleans, if you also want it to appear on a terrain but also on the same terrain with a certain feature you have to specify it in all three Booleans.
bUseLSystem = if it should use the L System, I am sure this means that it should use a standard generic L-System, because those resources which doesnīt use the lsystem here are very simple and donīt need it or they have all lsystem informations stored in the CIV4PlotLSystem.xml .
Master Lexx Jan 12, 2006, 01:22 PM The xml improvements part:
Of course you also need to tell the game which improvement really activates the effects of the resource. Get CIV4ImprovementInfos.xml and copy it over to mymod \Assets\XML\Terrain\CIV4ImprovementInfos.xml . If you just modified an existing resource like spices (which needs a plantation) and want to add this to the plantation improvement, search for spices, copy this xml parts and paste it below the existing one, you only need to change the YieldChanges and the name of this resource. Like this:
<BonusTypeStruct>
<BonusType>BONUS_LEMON</BonusType>
<bBonusMakesValid>1</bBonusMakesValid>
<bBonusTrade>1</bBonusTrade>
<iDiscoverRand>0</iDiscoverRand>
<YieldChanges>
<iYieldChange>1</iYieldChange>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
</YieldChanges>
</BonusTypeStruct>
BonusType = name of the resource
bBonusMakesValid = the improvement can always be built on this resource.
bBonusTrade = if it is allowed to trade this resource
iDiscoverRand = the chance in 1/x per turn, that this resource can appear on this title if this improvement is built on this title. This makes no sense for all resources whose improvements cannot be built without them. But a mine can be built without gold, so there is a random chance that you can find gold later on this title.
YieldChanges = this changes food, production, commerce if this improvement is built on this resource, this is added to the terrain yields and the bonus yields.
Now the new ressource should basicaly work.
http://myrror.net/civ/tut/ing_lem.jpg
The descriptions and civilopedia xml part:
You should note although you now have a new resource, it has no ingame name and no civilopedia entry. The easiest thing is, to get this file: CIV4GameTextInfos_Objects.xml and copy it over to mymod\Assets\XML\Text\CIV4GameTextInfos_Objects.xm l . But the Texts used for descriptions and civilopedia are special. If you have this file in your mod dir, the game will use this instead of the existing one. But if you rename this file to MymodGameTextInfos_Objects.xml the game will still use all the entries in this file instead of the existing one, but you don´t have to include all the entries here, you can simply delete all entries in this file and just add your new ones, so the game loads those as additional entries. So delete every not needed xml entries in there but let one stay and alter the tags. Like this:
<TEXT>
<Tag>TXT_KEY_BONUS_LEMON</Tag>
<English>Lemons</English>
<French>
<Text>Citrons</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</French>
<German>
<Text>Zitronen</Text>
<Gender>Female</Gender>
<Plural>0</Plural>
</German>
<Italian>
<Text>Limoni</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Italian>
<Spanish>
<Text>Limones</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Spanish>
</TEXT>
The text key has to be the same that you specified in CIV4BonusInfos.xml in the Description tag. For the translation you can use this: http://freetranslation.com/ it is good enough for a few words, keep your words simple and never try to translate a real text! It would be unreadable.
If you also specified a civilopedia key in CIV4BonusInfos.xml, do the same thing, get CIV4GameText_Civilopedia_Bonuses.xml , copy it to Mymod\Assets\XML\Text\CIV4GameText_Civilopedia_Bon uses.xml and rename it to MymodGameText_Civilopedia_Bonuses.xml. Delete everything but one entry in it an alter this. The civilopedia text is really just a nice addon, you can´t translate the text into languages which you don´t speak. But it´s easy, go to http://wikipedia.org/ and search there. So you can include the English text (most people can talk English nowadays) and if you speak more languages, search the wikipedia in another language for this subject and include some text from there too for another language. For all languages where you can´t get a good text, simply let them empty. Now the resource should be working.
Master Lexx Jan 12, 2006, 01:29 PM The extended xml improvements part:
Maybe you don’t simply want to add a resource to an existing improvement but rather want to make a complete new improvement. So try to add a desert windmill.
First again you need to specify how this improvement looks. Get CIV4ArtDefines_Improvement.xml and copy it over to Mymod\Assets\XML\Art\CIV4ArtDefines_Improvement.xm l . Copy one of those parts and paste it at the bottom and change it like you did with the CIV4ArtDefines_Bonus.xml . It should look like this:
<ImprovementArtInfo>
<Type>ART_DEF_IMPROVEMENT_DESERTWINDMILL</Type>
<bExtraAnimations>0</bExtraAnimations>
<fScale>1.3</fScale>
<fInterfaceScale>0.6</fInterfaceScale>
<NIF>Art/Structures/Improvements/WindMill/WindMill_Mod.nif</NIF>
<KFM>Art/Structures/Improvements/WindMill/WindMill_Mod.kfm</KFM>
<Button>,Art/Interface/Buttons/Builds/BuildWindMill.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,5 ,8</Button>
</ImprovementArtInfo>
The NIF file is the 3d model file, it auto loads the textures, you can let the kfm empty if it has no animations or shouldn’t have.
Of course you can simply look through all the atlas dds files which have all the icons in them and simply set the icon path to one of them.
Type = the name of this improvement art, you need this in another file
bExtraAnimations = only the farm has this set, so use this if you add a new farm
fScale = the size of the improvement ingame
fInterfaceScale = the size of this improvement in the civilopedia
NIF = the 3d model of the improvement
KFM = the infos for the animations of this improvement
Button = which icons to use for this, it first tries the last one out of a big file
So you also need to add a new improvement, open CIV4ImprovementInfos.xml and copy one of the improvements and paste it at the bottom. It should look like this:
<ImprovementInfo>
<Type>IMPROVEMENT_DESERTWINDMILL</Type>
<Description>TXT_KEY_IMPROVEMENT_DESERTWINDMILL</Description>
<Civilopedia>TXT_KEY_IMPROVEMENT_WINDMILL_PEDIA</Civilopedia>
<ArtDefineTag>ART_DEF_IMPROVEMENT_DESERTWINDMILL</ArtDefineTag>
<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>0</iYieldChange>
<iYieldChange>4</iYieldChange>
</YieldChanges>
<bHillsMakesValid>0</bHillsMakesValid>
<bFreshWaterMakesValid>0</bFreshWaterMakesValid>
<bRiverSideMakesValid>0</bRiverSideMakesValid>
<bNoFreshWater>0</bNoFreshWater>
<bRequiresFlatlands>0</bRequiresFlatlands>
<bRequiresRiverSide>0</bRequiresRiverSide>
<bRequiresIrrigation>0</bRequiresIrrigation>
<bCarriesIrrigation>0</bCarriesIrrigation>
<bRequiresFeature>0</bRequiresFeature>
<bWater>0</bWater>
<bGoody>0</bGoody>
<bPermanent>0</bPermanent>
<iTilesPerGoody>0</iTilesPerGoody>
<iGoodyRange>0</iGoodyRange>
<iUpgradeTime>0</iUpgradeTime>
<iAirBombDefense>5</iAirBombDefense>
<iDefenseModifier>0</iDefenseModifier>
<iPillageGold>5</iPillageGold>
<TerrainMakesValids>
<TerrainMakesValid>
<TerrainType>TERRAIN_DESERT</TerrainType>
<bMakesValid>1</bMakesValid>
</TerrainMakesValid>
</TerrainMakesValids>
<FeatureMakesValids/>
<ImprovementPillage/>
<ImprovementUpgrade/>
<TechYieldChanges/>
<RouteYieldChanges/>
<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>
Type = the internal name of this improvement
Description = the key of the entry which holds all names for this improvement
Civilopedia = the key for the entry which holds the civilopedia texts
ArtDefineTag = this is the tag you specified in CIV4ArtDefines_Improvement.xml as Type
PrereqNatureYields = the amount of food, production, commerce that already has to be on the title before the imp can be built there, note that a river adds one commerce and that a forest adds one production
YieldChanges = food, production, commerce changes if this improvement has been built on a title
bHillsMakesValid = if set, the impr always can be built on a hill, regardless of anything else
bFreshWaterMakesValid = if set, the impr always can be built next to a river or a lake
bRiverSideMakesValid = if set, the impr always can be built next to a river
bRequiresIrrigation = if set, the impr needs an irrigated title next to it before it can be built
bCarriesIrrigation = if set, the impr will count as irrigated so you can irrigate titles next to it
bRequiresFeature = if set, the impr needs the specified feature existing or it will be removed
bWater = if set, the impr needs water to be built on
bGoody = if set, the impr gives a goody if somebody enters it´s title (like the goody hut)
bPermanent = if set, the impr cannot be destroyed, it stays for the rest of the game
iTitlesPerGoody = for every this many titles there is one of this goody placed
iGoodyRange = the distance from which this goody can be seen by a unit
iUpgradeTime = the time in turns that is needed on standard gamespeed until it upgrades to another impr
iAirBombDefense = the defence of this impr against attacks by air units, it seems that if the strength of the air unit is equal to the airbombdefense, there is a 1 to 1 chance that it get´s destroyed on attack
iDefenseModifier = the defence percentage added to all units on the title of the impr
iPillageGold = the base gold value that a unit get´s if this impr is pillaged
TerrainMakesValid = here you can specify on which terrains this impr can always be built
FeatureMakesValid = here you can specify on which features this impr can always be built
BonusTypeStructs = the bonus resources that make the impr valid to be placed on
ImprovementPillage = this is the impr to which this one is downgraded if it is pillaged
ImprovementUpgrade = the impr to which this one is upgraded after the iUpgradeTime
TechYieldChanges = food, production, commerce changes for this impr after the specified tech has been researched
RouteYieldChanges = food, produktion, commerce changes if a road or railroad was built on the impr title
bGraphicalOnly = this is only set for land and water worked, you should let this 0
So, the art defines are correct and the improvement also, next get CIV4BuildInfos.xml and copy over to mymod\Assets\XML\Units\CIV4BuildInfos.xml . Open it and add a new buildtype. Simply copy one and paste it at the bottom. But you need to change the values.
<BuildInfo>
<Type>BUILD_DESERTWINDMILL</Type>
<Description>TXT_KEY_BUILD_DESERTWINDMILL</Description>
<Help/>
<PrereqTech>TECH_ELECTRICITY</PrereqTech>
<iTime>800</iTime>
<bKill>0</bKill>
<ImprovementType>IMPROVEMENT_DESERTWINDMILL</ImprovementType>
<RouteType>NONE</RouteType>
<EntityEvent>ENTEVENT_BUILD</EntityEvent>
<FeatureStructs/>
<HotKey>KB_W</HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>1</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Builds/BuildWindMill.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,5 ,8</Button>
</BuildInfo>
Type = name of this build type
Description = text key for the entry with all names of this, it´s the same like with all other text xml files, copy over the Civ4GameTextInfos.xml, rename to MymodGameTextInfos.xml and modify it, let just one entry with the name you specified here.
Help = Again a key to a text file, text that is displayed if you move your mouse over the build button. Maybe you should just let this empty.
Prereqtech = this tech is needed before the button is showing up in the worker menu. You can also set this to NONE.
iTime = the time needed to build this, the standard worker has a speed of 100, so if the time here is et to 1000 it will need 10 turns on standard gamespeed.
bKill = if set, the unit will be killed after this has been built
ImprovementType = the name of the type you spciefied in CIV4ImprovementInfos.xml for the new improvement
RouteType = you can specify road or railroad here, this is built then
EntityEvent = here you specify what animation of the workers is played (if they use hammers or shovels or mining equipment)
FeatureStructs = here you can specify features, which tech is needed to build this impr if this feature is here, and what to do with them if this impr is build on them, you can set additional time if there is forest, how much production the next city gains through this and if this feature will be removed after the time is over.
Button = this is the graphic you will see in the workers menu to build this improvement
One last file still needs modification, get CIV4UnitInfos.xml and copy it over to Mymod\Assets\XML\Units\CIV4UnitInfos.xml . Open it, search for “scrub” and you will jump directly to all the worker menu options. So directly under this paste:
<Build>
<BuildType>BUILD_DESERTWINDMILL</BuildType>
<bBuild>1</bBuild>
</Build>
This will include this option to the worker menu, but remember that there are two workers in civ4! The normal one and the Indian fast worker, so simply search for the next appearance of “scrub” and paste the option there too.
Quick explanation of the connection between those files: In CIV4UnitInfos.xml you added the option that there should be a new button in the workers menu. All infos about this button are stored in the CIV4BuildInfos.xml. There you also specified which improvement this should place from CIV4ImprovementInfos.xml. And there you specified which one out of the CIV4ArtDefinesImprovements.xml is the right art specification with 3d model and animations. The Type you always specified is used to access the right one.
END of this guide :)
I hope somebody has a use for this, spelling mistakes and corrections can be sent to me via pm!
Exavier Jan 12, 2006, 02:02 PM nice work... now to actually read it :P
EDIT: thankyou very much. I am horrible with 2D graphics editing (probobly because i didn't know how to work with the Alpha chanel to figure out what to edit). Going to have fun now :P
Ereonus Jan 13, 2006, 05:03 AM Thanks for your fantastic work, you do and explain all i want to do !!!!
GREAT thanks
:goodjob:
LittleRedPoint Jan 13, 2006, 05:18 AM Thank you for your great tutorial! This cover a path that was missing in the tutorial section! :goodjob:
Ereonus Jan 13, 2006, 06:05 AM How do you modify the .nif files, can you give us a list of all tools you use.
The tools for all the modifications you do.
Thanks
Exavier Jan 13, 2006, 06:13 AM How do you modify the .nif files, can you give us a list of all tools you use.
The tools for all the modifications you do.
Thanks
Noone can edit the Nif files Civ4 uses atm... for the resorces he used a different similar kind and just reskinned it.
RED DIAMOND Jan 13, 2006, 01:28 PM You did a fantastic job on adding resources Exavier.:goodjob:
Exavier Jan 13, 2006, 02:48 PM You did a fantastic job on adding resources Exavier.:goodjob:
um wrong name for credit :P
I have only added 1 resorce... Steel... and thats still in the beta for the next version of my mod :P
Master Lexx Jan 13, 2006, 03:38 PM You did a fantastic job on adding resources Exavier.
So let´s thank exavier for writing 4k words in a foreign language and spending many hours with this.
:mad: :mad: :mad: This really is not nice! :mad: :mad: :mad:
Zuul Jan 13, 2006, 03:57 PM No lets thank Master Lexx instead. Exavier already got his 15 min ;p.
Exavier Jan 13, 2006, 04:19 PM So letīs thank exavier for writing 4k words in a foreign language and spending many hours with this.
:mad: :mad: :mad: This really is not nice! :mad: :mad: :mad:
I thought it was pretty funny... but I made sure to point out the error :)
GIR Jan 15, 2006, 09:53 AM WOW! absolutely great work! :goodjob:
D A N K E S C H Ö N
Crypticnight Jan 15, 2006, 10:53 AM Excelent work! And great explanations!:) This tuturial adds yet another perspective to my thoughts upon your mod and the time that you have spent on your project. Bravo!:goodjob:
KGrevstad Jan 16, 2006, 09:21 PM Excellent work, Master Lexx, on both this tutorial and your GreenMod. However, I am trying to merge portions of your GreenMod into my mod, which already includes the Lost Wonders mod. The Lost Wonders mod already has modified the GameFont.tga files so now I need to merge your graphics with those of the Lost Wonders.
I am using gimp. When I bring up the file for editing, I do get all the lovely icons, but what I don't get is the pink grid (and the background is gey/white checkerboard, which is just gimp, probably). Is this pink grid part of the image, an artifact of PaintShop, or meta-information about the image? Without the pink grid, I also don't have the blue-green activation dot.
Am I doing something wrong here, or is gimp simply unable to manipulate these files?
--Kristine
Master Lexx Jan 18, 2006, 04:01 AM @KGrevstad: those pink grids belong to the picture, they are normal coloured. Some graphics programms think those colours are used for transparency, not show in a gme, so they donīt display them, but there should be an option to make them visible. I prefer Paint Shop pro, so i canīt help with this. Donīt forget, the icons shown in the tgas are used in the same order how the resources are set up in the artdefinesxml.
KGrevstad Jan 18, 2006, 07:47 PM @Master Lexx
Thanks. I still haven't found a way to make them visible in the native image, but I am able to see them in the red and green layers if I decompose the image into rgb layers. I think the problem is that gimp is viewing this as three channels with an alpha channel, whereas paintshop seems to be viewing it only as rgb. Where will these mini-icons be shown in the game? That is to say, if I mess around with the tga file, how would I view the result in the game?
--Kristine
Master Lexx Jan 18, 2006, 11:43 PM The basic minicon is shown, if you roll over a resource with your curser in the map view. The gamefon75 miniicon is shown in the city screen on the right.
RogerBacon Jan 21, 2006, 11:15 PM Thank you for this tutorial. I only read the first part but that was enough to help me make an alpha layer, which is what I needed.
Roger Bacon
Kyburg Feb 07, 2006, 11:28 AM Many thanks for your great work, Master Lexx.
Im interested for new bonuses cocoa, coconut, palm oil and olive oil.
Since I don't understand much about graphics, maybe there is something else interested to place it.
Kyburg Feb 07, 2006, 11:56 AM I found olive and cocoa with black background.
Master Lexx Feb 08, 2006, 04:14 AM I will take a look, maybe those are the next resources. I will try to find a resource that fits for reskinning.
Civmansam Feb 08, 2006, 06:38 PM cool mod but i was wondering...
How do give units skins?
Is it the same thing?
Master Lexx Feb 09, 2006, 08:40 AM You read about unit reskinning in many other threads. Just extract the pak files, convert the right dds of the unit, repaint it and place this skin in the same folder struture, it was in the pak files just remake the directory structure in the mods folder.
mismatch Feb 11, 2006, 05:21 AM I've got a small question. Ive made a trench improvements (for infantry and such), but since here are no models suidatble for a trench, I want the trench to be just a flat texture slapped upon a tile.
How would you do this?
I tried to just put the dds path within the .nif tag (as you do with leaderheads), but this just gave a a purple orb.
Master Lexx Feb 12, 2006, 07:40 AM Sorry, I never made a trench and I also never made a leaderhead. Maybe you can use the wheat ressource and make a flat ground painting with it and include it as improvment.
mismatch Feb 12, 2006, 10:23 AM yah, got it to work I believe, havent tried it ingame yet, but the pedia pic
looks promising enuff.
cheers mate.
http://img49.imageshack.us/img49/4317/trench0ff.th.jpg (http://img49.imageshack.us/my.php?image=trench0ff.jpg)
Caradoc Feb 14, 2006, 09:45 PM Would you kindly help me with this:
"TerrainBooleans tell on which terrain the resource can be placed. FeatureBooleans tell on which features in connection to the terrain of FeatureterrainBoolean[/b] the resource can be placed. FeatureTerrainBooleans tell on which terrain that also has one of the specified features the resource can be placed. The above example tells, that the resource can be placed on snow or grass or grass with jungle. If you want to make only terrains valid, use TerrainBooleans, if you want it to be placed on a terrain that also has a certain feature you need to use FeatureBooleans and FeatureTerrainBooleans, if you also want it to appear on a terrain but also on the same terrain with a certain feature you have to specify it in all three Booleans."
I have a hard time understanding the example. Since there is already a Terrain Boolean for GRASS, why is there also a FeatureTerrainBoolean for GRASS and JUNGLE? And doesn't JUNGLE always appear on GRASS anyway?
Maybe another example would help.
NEVER MIND: I did a couple of experiments and figured it out. -C
sepamu92 Feb 21, 2006, 02:52 PM can someone help me, every time i try to start up dds converter 2.1 it says "We have encountered an error and have to close." What happened?
Thanks in advance,
Sepamu
edit: nevermind, i got it to work
earthgate Feb 28, 2006, 12:25 PM I was just wonderign the terrain improvement tiles.. in civ 4 I could not find the farm or jungle tiles in the art folder.. maybe i didnt look good enough.. I was hoping to to take a closer look on those.. I got this idea about making a swamps/wetlands... well you can take a look at this post :D
http://forums.civfanatics.com/showthread.php?t=161115
btw the greenmod is awesome and so are the lemon plantation ...:goodjob:
execellent tutorial ...
Master Lexx Mar 12, 2006, 08:32 PM First try to add a new terrain, maybe one with just another name. If you can solve this problem you are on the right way,
when I tried to add a new terrain, it appeared as mountain under water, even if I just copied one.
It was fun to add new ressources to Civ4, I was the first who has done this (with a real new 3d look).
I hope this guide stays usefull for people, besides this the first ressource I added was "tea" :-)
Crighton Mar 16, 2006, 01:58 PM sweet lemons man, very nice
Padmewan Mar 16, 2006, 03:10 PM A very well-written TUT, thanks Master Lexx. I'm sorry to hear that you no longer have time to continue pursuing GreenMod, but I do hope this thread lasts as a testament to your creativity and helpfulness!
Now for some questions for you (if you're still out there) and everyone else reading this:
1. In response to KGrevstad, for anyone else who needs help with this, I have found that if you manipulate the fonts file VERY CAREFULLY, you can work so that you don't touch the pink/turquoise pixels even if you can't see them (as in Gimp). This thread (http://forums.civfanatics.com/showthread.php?t=150737) (on modding religions) includes a screenshot of the larger font file that I copied and then pasted on a lower layer to use as a template that basically tells me "do not erase/touch these lines".
I don't think I understand alpha channels at all, maybe because I only use Gimp and Fireworks, so maybe if I tried PSP (I understand Photoshop also handles alpha channels correctly) I could "get it."
2. Has anyone figured out how the engine handles the era transitions? I have successfully "stolen" the .nif for modern plantations for use as a greenhouse, but I have not been able to do the same for modern windmills. I appreciate the tutorial above about the various multi-files for worked, improved, etc., but I need to understand the era transitions, too.
3. Does all it take to put a building on a plot of land is to copy out the .nif and .k?? from the building art XML file and paste it into a new resource or improvement file? I think I tried that once and it failed, but I'll try again with Pyramids first (since it obviously works here). I have also successfully turned wheat, pigs, and cows into improvements from resources, but I'm not sure where a direct translation is possible and where all these complicated route-clearing, worked/unworked, era changes are all hidden.
Thanks again to Lexx and in advance for anyone who can answer these questions!
FK2006 Mar 30, 2006, 09:07 AM sorrry just got it
trancers21 May 04, 2006, 11:41 PM how would i make it to where just one resource appeared on the map? Basically--i want to take the ancient temple and create a few different real temples that exude different bonuses..but i only want one type on the map.
micmc Aug 01, 2006, 04:46 PM how would i make it to where just one resource appeared on the map? Basically--i want to take the ancient temple and create a few different real temples that exude different bonuses..but i only want one type on the map.
just use the same bonusartdefine for all the resources, but then edit whatever you wanted in the xml/civ4bonusinfo...
so if you had
zombie temple
brothel temple
tiger temple
they'd all use the same artwork/icons/etc for "basic temple" and adventurers would have a 1 in 3 chance of being lucky....
micmc Aug 01, 2006, 04:54 PM absolutely great tutorial...if I know anything about CIV4 graphics now, it is because of the time you took to create this for us. I thank you, my wife thanks you, my daughter thanks you, my dog would thank you but he's being fixed in the morning and has other things on his mind....
anyway, with psp saving to .tga, I get a warning box upon saving, saying "you may only save 1 alpha channel"..which means (if I understand hwo it all bloody works on a basic level) it becomes problematic to add the small-icons on the font75 file.
I know it must be possible, because I've seen your font75 file from servo's mod, (which saved me btw when I had to use it as a backup's backup) but before I bugger anything else up, I thought I'd ask how can you add to the alpha channel, I've read the psp helps and if it was me and those help files that stood between salvation and the end of the world....spend your retirment fund today!
Eusebius Nov 11, 2006, 08:55 AM I happened to discover that if you have both <iPlayer> and <iTilesPer> set to zero, the resource doesn't show up at all on the map.
Eusebius
Elucidus Jan 01, 2007, 10:05 PM I am trying to add a new type of farm. All it does is give a bigger bonus and is tied to a later tech, but I can't get the button to show up. I just referenced the button for the farm, I thought it would appear twice in the list, but it doens't show up. Any ideas why?
hrochland Aug 06, 2007, 03:50 AM Know somebody, please, where are bonuses in BtS xml structure????? I can not find CIV4BonusInfos.xml file :(
Jean Elcard Aug 06, 2007, 08:55 AM It's not the only file missing now with BtS. I'm really looking for an alternative of Civ4PlotLSystem.xml for example. This tutorial is using it as well.
After all it sums up to 47 xml files gone in comparison to the original Civilization 4 and 37 new ones.
EDIT: I just saw, that CIV4BonusInfos.xml is still mentioned in CIV4TerrainSchema.xml. So if it is in the schema you might still use it. Maybe BtS is still using some of the xml files of the original Civ 4. You may try to copy it from there to your BtS mod folder: \Assets\XML\Terrain\.
EDIT2: You may not believe it, but it's actually using the CIV4BonusInfos.xml from the Warlords folder! Just tried to change something there and it showed up in Beyond the Sword. I can't imagine, why they have done something like that. The XML files don't need that much space on a harddisk. And what if you want to uninstall Warlords? Should break nearly everything.
hrochland Aug 06, 2007, 12:32 PM Thanks you very much, Jean Elcard. I will try it this evening. One more thanks :)
Know you, please, about some man, that he may help me with some few a little python problems in my Bts HrochMod3.4.3 ? :blush:
Liberace_2211 Sep 13, 2007, 12:26 AM Excelent!!! This tutorial really helped me add some new resources. I didnīt know I had to change those GameFont files but I could finally show the new resources in the city screen. Thank you man!!! You made my day :D
:goodjob: :goodjob:
magic_stick1376 Jul 23, 2008, 04:08 PM this may sound pretty dumb, but is it possible to use a flat image for the resource? or must you make a new skin?
stanleyshi79 Apr 18, 2009, 02:54 AM Very good instruction. I follow your idea to add new improvement (plant) in industiral era. It can work. But in civilopedia, the technology shows" can plant" not "can build a plant". I don't know what's wrong with it? Can you give me a hand?
Thanks in advance!:)
xienwolf Apr 18, 2009, 12:44 PM It is your text key for the BuildInfos entry to construct the plant. It should state "Build a Plant" instead of just "Plant" which would be the proper text key in ImprovementInfos.
stanleyshi79 Apr 19, 2009, 07:18 PM It is your text key for the BuildInfos entry to construct the plant. It should state "Build a Plant" instead of just "Plant" which would be the proper text key in ImprovementInfos.
Thanks! I got it.
pleasenoname Jun 21, 2009, 10:08 AM I cannot find the the spices .dds in any folder, despite using search and compiling a list of all the .dds files. It exists, I placed some with world builder. Yet nothing has that name
Also, I find it inefficient how all the folders for different resources are spread out over Original, Warlords and BTS.
fractalfeline Jul 16, 2009, 06:56 AM Hi! Sorry for being a total noob but I'm trying to make a new mod. I got lost somewhere around the ingame icons section. Can you tell me how to find the atlas file I'm supposed to be editing? I don't know if there's some difference in versions but I have BTS and I was looking all over my various installed folders and I can't find anything. I found the copper resource thing (yay) and incense, of all things, but beyond that I can't find a whole lot else...
The_J Jul 16, 2009, 01:06 PM The atlas files (like the most graphical files) are packed into .fpk files. They are in the vanilla folder. To unpack use PakBuild, it's here in the database.
Classicus Jan 28, 2010, 09:04 AM I would like to make it so that cities gain the bonuses of each individual resource, for example if I have 3 clam, I get the health benefits of each one, rather than just one only. How can I do this in the XML?
The_J Jan 28, 2010, 04:16 PM Simple answer: You can't. That function is not provided by civ :(.
pleasenoname Jun 07, 2010, 11:39 PM *psst*, *sdk*, *SDK*.haha
BeastofStrength Jul 10, 2010, 06:23 PM I have copied the Bonusinfo.xml form Warlords and the CIV4TerrainSchema.
I then copied the Horse, Bonusinfo.xml, copied it, and made a Camel resource.
(I"m not worried how the art looks like right now.);)
I also did the renaming of the XML Art files and XML text files.
I go to load my mod, it starts to load then says, something to the effect:
The CIV4TerrainSchema doesn't know what <damage>0</damage> means.
Bonus fails to load.
Before when I was using the CIV4, Bonusinfo.xml and the CIV4TerrainSchema, I would get something to the effect;
The CIV4TerrainSchema doesn't know what <iheal>0</iheal> means.
Bonus fails to load.
Apparently my copy and pasting abilities haven't worked this time. I can make units and buildings work, when I copy and paste.
Can someone please give a helping hand? :nuke:
The_J Jul 10, 2010, 06:26 PM BtS has it's own schema, use this ;).
If you're not doing your mod modular, then don't use the schema at all. It's not really needed for XML only changes.
BeastofStrength Jul 10, 2010, 06:36 PM thank you!!
thecowwarrior Mar 10, 2011, 08:10 PM Very thorough guide, helped me a ton. Thank you!
NusRa May 15, 2011, 11:56 AM I followed your Tutorial.
Was able to add resources to xml, no problem.
However, the section of tutorial on adding the mini map icons to the font files was trial and error.
Was able to do it after a while using Psp 4.14.
The learning curve was high.
First hurdle was adding that blue/green pixle.
Solution: save the mask to file. Then delete the mask.
Then add the pixle to correct location.
After which the mask is reloaded.
Save the gameFont file, so you don't have to repeat this step.
Next, make active the icon image, crtl-c to copy. Then make the gameFont image the active image.
My icon image has a black background, so make sure the background color is black for the clipboard copy. More on why the background is black in a moment. Anyway paste the icon into the gameFont image using crtl-shift-e(paste as a transparent seltion).
Don't unselect the paste outline.
Next mask->edit. Then change foreground color to a gray scale white. And, paint or fill the still selected icon with this foreground color.
Unselect the icon. Now view through mask in the view menu to check your work.
Save the gameFont file. And place in the your mods custom assets res/font folder.
Repeat process for the gameFont_75 file.
Note this is what took me so long to implement his mod.
I was testing out my changes made to only one of these files, to see if I was doing it correctly.
And, it wasn't working, so my thinking was that I wasn't doing the change correctly.
Once I made the leap of thinking to maybe, firixas programmed the loading of these mini icons as pairs, the above instructions worked like a charm.
civ2 Aug 04, 2011, 10:22 AM Nice tutorial!:goodjob:
I used it do make a funny mini mod on resources:
http://www.2shared.com/file/2r8TnNgZ/AAA_Resources.html
It does 2 things (and was done in those 2 major steps too)
1. Simple value tweaking - making resources much more useful.
2. Improvements tweaking - this was done after reading your tutorial.
The second part includes:
a. Taking MINE and FARM, and adding MINE_2 and FARM_2.
b. The original upgrade is made "cottage style" to immediately upgrade into the second/new one.
So what's the catch?
Simple:
c. The first upgrade doesn't give BONUS bonuses.
Instead, it SPAWNS resources!
Like, build a FARM on an normal tile, and you can get a RICE!
Same goes for MINE - need some GOLD?:mischief:
I made the discovering values very small (aka chances VERY high), but my first tests were with low chances.
Which made it kinda GAMBLING.:eek:
Why?
Cause the _2 thingy gives useful stuff ONLY with resources!:eek:
So there was a chance of an "abandoned mine" that was just sitting there, EMPTY.:eek:
Which meant you had to change it to, say, COTTAGE, and then rebuild it for another TRY!:crazyeye:
d. Now almost the same was done with COTTAGE.
It now can spawn ALL other resources that aren't spawned by MINE/FARM!:D
Except for WATER ones - I found no way to spawn them...
I'm awaiting everyone's reviews on this "mod", and maybe someone knows THIS:
How to make resources spawn WITHOUT building improvements???:confused:
Why those WATER/LAND_WORKED things don't work like other improvements???
I tried to make them do the trick, but it didn't happen...:cry:
Do you think I should.could post this in the MODS section???
It just seems to be so minor...
Thanks!:goodjob:
cfeyyaz Dec 10, 2011, 02:39 PM Hi, I want that building a mine/farm/pasture etc. to cost money(gold from the empire's treasury). Is it possible by doing small modifications on those XML files, or does it require other advanced programming skills? :)
The_J Dec 10, 2011, 07:30 PM Can be done :).
That's in the units\buildInfos.xml, the value for iCost.
|
|