Modders Guide to Civilization V

Hi everyone, can someone show me how to do this in my mod:

1. I want to have a new yield type, eg "morale"
2. I want my building to give +1 yield of that "morale".,eg "my tower"

I tried this but not successful.
1st I create a new yield:
<Yields>
<Row>
<Type>YIELD_MORALE</Type>
<Description>TXT_KEY_YIELD_MORALE</Description>
<IconString>[ICON_RES_GEMS]</IconString>
<MinCity>2</MinCity>
<GoldenAgeYield>0</GoldenAgeYield>
<GoldenAgeYieldThreshold>0</GoldenAgeYieldThreshold>
<AIWeightPercent>100</AIWeightPercent>
</Row>
</Yields>

Then I add this to my building:
<Building_YieldChanges>
<Row>
<BuildingType>BUILDING_TOWER</BuildingType>
<YieldType>YIELD_MORALE</YieldType>
<Yield>1</Yield>
</Row>
</Building_YieldChanges>

But nothing happen. My tower does not give that Morale, I cannot see it when I put my cursor over the tower icon...If I change it to
<Building_YieldChanges>
<Row>
<BuildingType>BUILDING_TOWER</BuildingType>
<YieldType>YIELD_FOOD</YieldType>
<Yield>1</Yield>
</Row>
</Building_YieldChanges>

then my tower will gives me 1 food. So it seems that the game does not recognize my new yield type...but I dont know what is wrong.
 
I have tried for 3 days to mod the warriors for Denmark to look like the barbarians. I give up im so frustrated.

I get so tired of all the units looking the same for every Civ.

Is there anyone that can make a Denmark mod for me with the Warrior units look like the barbarians. Maybe with a few less people and a little larger and stronger than normal since they are Vikings after all.

I know its probably too much to ask but i thought maybe someone rally enjoys doing them and im too frustrated to keep trying.
 
Is there anyone that can make a Denmark mod for me with the Warrior units look like the barbarians. Maybe with a few less people and a little larger and stronger than normal since they are Vikings after all.

Most of the work has already been done, but let's teach the man to fish just a little bit.

Gedemon has an excellent tutorial here. I have attached a ModBuddy project to use as a template to post #4 after the tutorial.

...

You don't need any new art, however, so it's pretty easy, and if you don't bother with adjusting the number of units in the formation as you mention, it won't conflict with any other unit mods. It'll just be a few lines of SQL.

Spoiler a little handholding :
Download the template I uploaded in the tutorial thread. Open it in ModBuddy, and delete all of the files except "newunit_portuguese_knight.sql." Rename it to whatever you like.

Now go to the mod properties. On the Mod Info tab, click New next to the Mod ID and give it whatever name and description you like. Then on the Actions tab, make sure the renamed file is set to OnModActivated/UpdateDatabase. (If you rename it in ModBuddy, it should automatically change to the correct name).

Then you'll just revise the SQL file with the following changes:

UNIT_KNIGHT to UNIT_WARRIOR
UNITCLASS_KNIGHT to UNITCLASS_WARRIOR
ART_DEF_UNIT_U_PORTUGUESE_KNIGHT to ART_DEF_UNIT_BARBARIAN_EURO
CIVILIZATION_GREECE to CIVILIZATION_DENMARK
*UNIT_PORTUGUESE_KNIGHT to *UNIT_DANISH_WARRIOR [or similar]
and
'Portuguese Knight' to 'Warrior' [or 'Danish Warrior' or whatever you want to call it].

...

Now, if you do want to change the number of units in the formation, you're going to need to leave the civ5artdefines_units.xml file (set to VFS true) in the mod, but as mentioned in the linked thread, this may lead to conflicts with other mods. You won't need civ5artdefines_unitmembers.xml.

You are going to need a unique ART_DEF entry, so go back to your SQL file and change ART_DEF_UNIT_BARBARIAN_EURO to ART_DEF_UNIT_U_DANISH_WARRIOR.

Now, in the civ5artdefines_units.xml file:
Delete the <UnitArtInfo> for the Portuguese knight at the end of the file. Make a copy of the <UnitArtInfo> entry for ART_DEF_UNIT_BARBARIAN_EURO, and put it at the end. Rename it ART_DEF_UNIT_U_DANISH_WARRIOR. Finally, you can play with the <MemberCount> entries for each of the 3 different models that make up a Barbarian Brute (Warrior) unit. If you don't like one of the models, feel free to set it to 0.


If you're feeling a little more ambitious, you might instead use the art for the Highlander unit posted in this forum.

...

EDIT: And if you absolutely just can't make it work, PM me and I'll be happy to do it for you.
 
I tried everything you said to do and it seems easy but it doesnt even show up on my mod list so i guess im just a modbuddy noob. I eally want to learn to do this but short of it being a mod to just download in the game im beginning to think i wont get the hang of it.:mad:
 
I tried everything you said to do and it seems easy but it doesnt even show up on my mod list so i guess im just a modbuddy noob. I eally want to learn to do this but short of it being a mod to just download in the game im beginning to think i wont get the hang of it.:mad:

I have to ask: Did you "Build" the mod?
 
LOL I think I followed the directions to the letter and never pushed the build button before I did it. It was about 3 this morning when I tried it. Told you I was a total modbuddy noob.
 
Alright I built the Mod it shows up but doesnt work.

I also tried to use Kaels tutorial in xml and it shows up in my mod list but doesnt work. I turned it on in properties but still nothing. I know there is something im not understanding.
 
Well it only got worse. I tried out all my work and when i started the game i had no warriors in the game and couldnt even build them, so I guess im even further away.

At this point I would just be happy to have the look change and not the size or number.
 
Can you see what Im doing wrong. My mod shows up but the warriors dont look any different

-- NEW UNIT TEMPLATE
-- Adds a Portuguese Knight as a new unique "ethnic" unit for Greece

INSERT INTO "Units" ('Type', 'Description', 'Civilopedia', 'Strategy', 'Help', 'Requirements', 'Combat', 'RangedCombat', 'Cost', 'Moves', 'Immobile', 'Range', 'BaseSightRange', 'Class', 'Special', 'Capture', 'CombatClass', 'Domain', 'CivilianAttackPriority', 'DefaultUnitAI', 'Food', 'NoBadGoodies', 'RivalTerritory', 'MilitarySupport', 'MilitaryProduction', 'Pillage', 'Found', 'FoundAbroad', 'CultureBombRadius', 'GoldenAgeTurns', 'IgnoreBuildingDefense', 'PrereqResources', 'Mechanized', 'Suicide', 'CaptureWhileEmbarked', 'PrereqTech', 'ObsoleteTech', 'GoodyHutUpgradeUnitClass', 'HurryCostModifier', 'AdvancedStartCost', 'MinAreaSize', 'AirUnitCap', 'NukeDamageLevel', 'WorkRate', 'NumFreeTechs', 'RushBuilding', 'BaseHurry', 'HurryMultiplier', 'BaseGold', 'NumGoldPerEra', 'SpreadReligion', 'IsReligious', 'CombatLimit', 'RangeAttackOnlyInDomain', 'RangeAttackIgnoreLOS', 'RangedCombatLimit', 'XPValueAttack', 'XPValueDefense', 'SpecialCargo', 'DomainCargo', 'Conscription', 'ExtraMaintenanceCost', 'NoMaintenance', 'Unhappiness', 'UnitArtInfo', 'UnitArtInfoCulturalVariation', 'UnitArtInfoEraVariation', 'ProjectPrereq', 'SpaceshipProject', 'LeaderPromotion', 'LeaderExperience', 'DontShowYields', 'ShowInPedia', 'MoveRate', 'UnitFlagIconOffset', 'PortraitIndex', 'IconAtlas', 'UnitFlagAtlas' )
SELECT ("UNIT_VIKING_WARRIOR"), ("TXT_KEY_UNIT_VIKING_WARRIOR"), "Civilopedia", "Strategy", "Help", "Requirements", "Combat", "RangedCombat", "Cost", "Moves", "Immobile", "Range", "BaseSightRange", "Class", "Special", "Capture", "CombatClass", "Domain", "CivilianAttackPriority", "DefaultUnitAI", "Food", "NoBadGoodies", "RivalTerritory", "MilitarySupport", "MilitaryProduction", "Pillage", "Found", "FoundAbroad", "CultureBombRadius", "GoldenAgeTurns", "IgnoreBuildingDefense", "PrereqResources", "Mechanized", "Suicide", "CaptureWhileEmbarked", "PrereqTech", "ObsoleteTech", "GoodyHutUpgradeUnitClass", "HurryCostModifier", "AdvancedStartCost", "MinAreaSize", "AirUnitCap", "NukeDamageLevel", "WorkRate", "NumFreeTechs", "RushBuilding", "BaseHurry", "HurryMultiplier", "BaseGold", "NumGoldPerEra", "SpreadReligion", "IsReligious", "CombatLimit", "RangeAttackOnlyInDomain", "RangeAttackIgnoreLOS", "RangedCombatLimit", "XPValueAttack", "XPValueDefense", "SpecialCargo", "DomainCargo", "Conscription", "ExtraMaintenanceCost", "NoMaintenance", "Unhappiness",
("ART_DEF_UNIT_U_BARBARIAN_EURO"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate", "UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_WARRIOR");
INSERT INTO "Language_en_US" ( 'Tag', 'Text' )
VALUES ( 'TXT_KEY_UNIT_VIKING_WARRIOR', 'Viking Warrior' );
INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
SELECT ("UNIT_VIKING_WARRIOR"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_WARRIOR");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_VIKING_WARRIOR"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_WARRIOR");
INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
VALUES ( 'CIVILIZATION_DENMARK', 'UNITCLASS_WARRIOR', 'UNIT_VIKING_WARRIOR' );
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_VIKING_WARRIOR"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_WARRIOR");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_VIKING_WARRIOR"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_WARRIOR");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_VIKING_WARRIOR"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_WARRIOR");

Also I set the actions to OnMod and update database.
 
ITS WORKING!!!!!!!!!!!!

Thanks Nutty for your help and patients Im gonna mess with the Size and number of units now.
 
As a first step in the mod I am working on, I wish to move astronomy to the Medieval Era from Renaissance.

It is not working... I've gotten XML files from other mods to when copied to my mod, so I know how to do that... I checked true for Importing to VFS and all the file properties show up as they should. The logs are normal with no errors that are not inherent in the game.

Have I done the coding wrong? If someone could take a quick look.

Oh, and I tested this by giving one of my on map civs all the medieval tech... astronomy does not show up as researched.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/3/2012 5:53:49 PM -->
<GameData>
	<Technologies>
		<Update>
			<Set Era="ERA_MEDIEVAL"/>
			<Where Type="TECH_ASTRONOMY"/>
		</Update>
	</Technologies>
</GameData>
>

Thank-You
 
Define "not working" - if you mean it's still in the Renaisance "band" of the Tech Tree that's because you've not changed its GridY value. If you mean you don't get it as a free tech when starting a game in the Renaisance Era, then that's something else.
 
if you mean it's still in the Renaisance "band" of the Tech Tree that's because you've not changed its GridY value.

What he said, except it's GridX that controls era, not GridY. And if you don't change the GridX after changing the Era, the tech tree UI will break because it'll see two techs in the same column with different eras. It won't just be placed in the wrong box, the boxes themselves will be screwed up.

Craig_Sutter said:
I checked true for Importing to VFS

This is wrong. GameData XML must be loaded through an OnModActivated/UpdateDatabase command, NOT the VFS. It usually doesn't hurt anything to have VFS on as well, for gamedata XML, but it does nothing to enable your mod.

Also, if you have a question about why a mod isn't working, make a thread in the main C&C forum. This thread is supposed to be for discussion of Kael's modder guide.
 
Thank-you.

I'll remember to post in the main C & C forum next time.

As to how it is not working, I do not get it as a free tech when starting in the Renaissance ERA. It should be yellow like all the other medieval techs, but it green. Its grid position is still in the Renaissance, but I expected that. Later, I'll either move it, or figure out how to shift the vertical line between Medieval and Renaissance.

Meanwhile, I'll continue this post in the main forum.

Continued at:

http://forums.civfanatics.com/showthread.php?t=463365
 
So....

Is there an up to date guide somewhere?

For starters a general introduction to the programs and tools you'd be using would be nice, with more specific things later on.

EDIT:

Decided to read the guide anyways...

- It notes there are traits that are built in to the system that aren't actually used anywhere. Is there a list of all of the traits, those included? It'd help to know what exactly our toolset of modifiable traits is.
 
It is not working in my mod, where is error

HTML:
<GameData>
      <!--deleting two units from Rome -->
        <Civilization_UnitClassOverrides>
             <delete CivilizationType="CIVILIZATION_ROME"/>
        </Civilization_UnitClassOverrides>
	 
          <!-- add two new buildings -->
	<Civilization_BuildingClassOverrides >
		<Row>
		       <CivilizationType>CIVILIZATION_ROME</CivilizationType>
		       <BuildingClassType>BUILDINGCLASS_WATERMILL</BuildingClassType>
		       <BuildingType>BUILDING_FLOATING_GARDENS</BuildingType>
		</Row>

		<Row>
			<CivilizationType>CIVILIZATION_ROME</CivilizationType>
			<BuildingClassType>BUILDINGCLASS_WINDMILL</BuildingClassType>
			<BuildingType>BUILDING_COFFEE_HOUSE</BuildingType>
		</Row>

	</Civilization_BuildingClassOverrides>
</GameData>
 
XML is case sensitive, so it's <Delete /> and not <delete />, which will be causing the entire file to fail (and will also be reported in either database.log or xml.log), so, enable logging and check the log files
 
So....

Is there an up to date guide somewhere?

For starters a general introduction to the programs and tools you'd be using would be nice, with more specific things later on.

EDIT:

Decided to read the guide anyways...

- It notes there are traits that are built in to the system that aren't actually used anywhere. Is there a list of all of the traits, those included? It'd help to know what exactly our toolset of modifiable traits is.

And what exactly is out of date?

A lot of it? or only a little?
 
Back
Top Bottom