Trying to create own mod. Problems with buildings

Metal_Matty

Chieftain
Joined
Nov 11, 2018
Messages
4
Hi, i'm new in the modding scenario and i'm trying to make my own mods to play with friends, and one day maybe become a free-time modder of new civ. Btw i found many problems with the buildings, while i created a lot of different unique units without problems, i get a lot of problems with buildings. I rewrote this mod, getting the same problem (I tought i failed something i couldn't find so i tought to rewrite it). I would appreciate a lot if you would help me understand my errors, ty all.
Don't comment the names (I'm making mods for fun) or the OPpines (As i have fisrt to test them) of the mod.
Sorry for Bad English
Thank you in advamce.
 

Attachments

  1. Civilization 5 does not have anything called PROMOTION_EMBARKATION_WITH_OCEAN_MOVEMENT. A search through all of the Civ5 xml files returns nothing. I believe the promotion you are looking for is
    Code:
    		<Row>
    			<Type>PROMOTION_ALLWATER_EMBARKATION</Type>
    			<Description>TXT_KEY_PROMOTION_ALLWATER_EMBARKATION</Description>
    			<Help>TXT_KEY_PROMOTION_ALLWATER_EMBARKATION_HELP</Help>
    			<Sound>AS2D_IF_LEVELUP</Sound>
    			<CannotBeChosen>true</CannotBeChosen>
    			<AllowsEmbarkation>true</AllowsEmbarkation>
    			<EmbarkedAllWater>true</EmbarkedAllWater>
    			<EmbarkExtraVisibility>2</EmbarkExtraVisibility>
    			<PortraitIndex>22</PortraitIndex>
    			<IconAtlas>ABILITY_ATLAS</IconAtlas>
    			<PediaType>PEDIA_SHARED</PediaType>
    			<PediaEntry>TXT_KEY_PROMOTION_ALLWATER_EMBARKATION</PediaEntry>
    		</Row>
  2. ART_DEF_UNIT_U_MM_LOLI_SCOUTING_TALENT is an undefined art definition.
  3. The issue with your building is actually here
    Code:
    <GreatWorkCount></GreatWorkCount>
    This overrrides the usual default value of numerical 0 and instead results in a value of NULL which is not allowed for the GreatWorkCount column. The base-game's CityView.lua script cannot resolve this issue properly and so results in a broken city UI view.
    • Default values for columns are not enacted when any data for a column is entered, including a NULL value which is what you specification for <GreatWorkCount> is actually telling the game.
    • Entirely delete any columns you are not using for your buildings or units from whichever template you are starting with. This avoids these types of errors and makes it much easier to read one's own code.
  4. Reducing your buildings code from you original template to this
    Code:
      <Buildings>
        <Row>
          <Type>BUILDING_MM_LOLI_FOUNDATION_MONUMENT</Type>
          <Description>TXT_KEY_BUILDING_MM_LOLI_FOUNDATION_MONUMENT</Description>
          <Civilopedia>TXT_KEY_CIV5_BUILDINGS_MM_LOLI_FOUNDATION_MONUMENT_TEXT</Civilopedia>
          <Strategy>TXT_KEY_BUILDING_MM_LOLI_FOUNDATION_MONUMENT_STRATEGY</Strategy>
          <GoldMaintenance>2</GoldMaintenance>
          <NeverCapture>1</NeverCapture>
          <Cost>20</Cost>
          <HurryCostModifier>100</HurryCostModifier>
          <MinAreaSize>-1</MinAreaSize>
          <BuildingClass>BUILDINGCLASS_MONUMENT</BuildingClass>
          <ArtDefineTag>MONUMENT</ArtDefineTag>
          <FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
          <FreeBuildingThisCity>BUILDINGCLASS_SHRINE</FreeBuildingThisCity>
          <PortraitIndex>3</PortraitIndex>
          <IconAtlas>EXPANSION_BW_ATLAS_1</IconAtlas>
        </Row>
      </Buildings>
    is far easier to read and understand and eliminates the possibilities of creating errors from incorrect implementation of template values for various columns.
 
Man thanks a lot to have answered me :D
1)I tried to search on civwiki and tehere was a promotion called by that name, after I discovered that that "promotions" is gave by a trait, but I didn't change it after I discovered, thx to have said me! Thanks to have found also the resolution to my problem ^^
2)Oh yeah mb. As I was rewriting it, I was bored when doing it, didnt saw that
3)Didn't knew it, thanks a lot, i think all the errors i did with buildingss were for this
4)You mean writing from 0? Or eliminating useless strings?

Really really thanks a lot, and sorry for my bad english
 
Last edited:
I'm doing it now, and i found your guide to create buildings from 0, so i'm studying it, to improve my mods, thx a lot ^^
 

Would you be so gentle to help me again?
I have another time problem with a building (I tried to fix it for about 30m, but i don't understand my error).
I followed your guide to create wonders and i created 1 for my ex-mod, and until that it's all okay.
I started to create a new mod, and i had a problem with his ovverride of Terracotta Army
As always sorry for my bad english and
Thanks a lot, i wait for your answer, have a nice day.
 

Attachments

  1. Database.log will have given a clue to your problem:whoward69's enable error logging tutorial
  2. You cannot state the same column-name more than one time within the same row you are adding to a game-table
    Code:
    		<Help>TXT_KEY_WONDER_COME_UNA_CATAPULTA_HELP</Help>
    		<Description>TXT_KEY_WONDER_COME_UNA_CATAPULTA</Description>
    		<Civilopedia>TXT_KEY_CIV5_WONDER_COME_UNA_CATAPULTA_TEXT</Civilopedia>
    		<Strategy>TXT_KEY_WONDER_COME_UNA_CATAPULTA_STRATEGY</Strategy>
          <Help>TXT_KEY_WONDER_COME_UNA_CATAPULTA_HELP</Help>
    You have specified column "<Help>" and its argument two times. The game therefore discards the entire contents of the file where this fatal syntax error is found.
  3. Even if you fix the code to this for the new row in table <Buildings>
    Code:
        <Row>
          <Type>WONDER_COME_UNA_CATAPULTA</Type>
    		<Help>TXT_KEY_WONDER_COME_UNA_CATAPULTA_HELP</Help>
    		<Description>TXT_KEY_WONDER_COME_UNA_CATAPULTA</Description>
    		<Civilopedia>TXT_KEY_CIV5_WONDER_COME_UNA_CATAPULTA_TEXT</Civilopedia>
    		<Strategy>TXT_KEY_WONDER_COME_UNA_CATAPULTA_STRATEGY</Strategy>
          <NukeImmune>1</NukeImmune>
          <Cost>250</Cost>
          <HurryCostModifier>-1</HurryCostModifier>
          <MinAreaSize>-1</MinAreaSize>
          <ConquestProb>100</ConquestProb>
    		<FreePolicies>1</FreePolicies>
          <BuildingClass>BUILDINGCLASS_TERRACOTTA_ARMY</BuildingClass>
          <ArtDefineTag>TERRACOTTA ARMY</ArtDefineTag>
          <MaxStartEra>ERA_MEDIEVAL</MaxStartEra>
          <PrereqTech>TECH_CONSTRUCTION</PrereqTech>
    		<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
    		<GreatPeopleRateChange>1</GreatPeopleRateChange>
          <DisplayPosition>2</DisplayPosition>
          <PortraitIndex>7</PortraitIndex>
          <WonderSplashImage>WonderConceptTerracottaArmy.dds</WonderSplashImage>
          <WonderSplashAnchor>R,T</WonderSplashAnchor>
          <WonderSplashAudio>AS2D_WONDER_SPEECH_TERRACOTTA_ARMY</WonderSplashAudio>
          <IconAtlas>EXPANSION_BW_ATLAS_2</IconAtlas>
        </Row>
    You will not get the addition of unit-copies because you have not stated
    Code:
    <InstantMilitaryIncrease>1</InstantMilitaryIncrease>
  4. Even though column "InstantMilitaryIncrease" is defined as an integer column, values greater than numerical '1' do not result in more than one copy of each type of land unit a player owns.
 
Back
Top Bottom