Need help with mod and confused with file attributes/properties with Lua

OTiger

Warlord
Joined
Aug 26, 2012
Messages
178
Hello,

I've been working with this Mod for quite some time and I can't get it to work.
This is my first mod that uses Lua, which would explain some of the problems.

Lua snippets used:
Dynamic Culture Overview by KyleM
UniqueDiplomacyUtils and a custom diplomacy file based from/by Typhlomence
SquidwardUA, which was based on a Lua file done by JFD, calcul8or and Machiavelli on was used on lordrj15's Manx Civ mod (Used with permission)

I read whoward's guide on file attributes/properties but I'm still kinda confused with Lua validation though. It's possible that the source of the error comes from here.

Also, there's good chance you'll more errors too, so If you can look into it, thanks. :goodjob:
 
  1. in your modinfo file you have this:
    Code:
    <File md5="552CED2069BCAF458E8207442DE28F7A" import="0">XML/Dialogue/Squidward_UniqueDiplomacy.lua</File>
    and this
    Code:
    <EntryPoint type="InGameUIAddin" file="Lua/Squidward_UniqueDiplomacy.lua">
    These two do not match for filepath.
    • Given that within your mod the actual filepath structure is:
      Spongebob Squarepants Squidward and the Squidwardia Civilization (BNW Only) (v 1)\XML\Dialogue\Squidward_UniqueDiplomacy.lua
    • One has to assume you manually typed in the filepath/filename. Do not do this when using modbuddy because it is too easy to screw up the path/name.
    • Use the procedure shown and do step #6 before step #3 (as in whoward's note I have added extra red highlighting attention to):
      Spoiler :
      Setting an xml or lua file as an InGameUIAddin

      attachment.php


      Note: If adding an InGameUIAddin where there is only a .lua file (and no associated .xml file), do step 6 before step 3

      1. From the Mod Properties screen, select the Content tab
      2. Click the Add button
      3. Select InGameUIAddin from the top drop-down
      4. Enter a name, typically the same as the file name
      5. (Optional) Enter a description, typically the same as the name
      6. Select the file from the drop-down, or enter the name manually (if the latter, take care with both case and the direction of the slash in path names)
      7. Click the OK button
    • Even though whoward is showing an XML file in the example, the quoted post from his tutorial applies. You just select your Something.lua file instead of a Something.xml file.
  2. You have this building defined but you do not have it assigned to the civ: BUILDING_EASTER_ISLAND_HEAD_HOUSE
  3. Oops!
    Code:
      <Civilization_Leaders>
        <Row>
          <CivilizationType>CIVILIZATION_SQUIDWARDIA</CivilizationType>
          <LeaderheadType>[COLOR="Red"][B]LEADER_ENRICO_DANDOLO[/B][/COLOR]</LeaderheadType>
        </Row>
      </Civilization_Leaders>
  4. Repeats within your unit file of what the game already has:
    Code:
    	<Unit_AITypes>
    		<Row>
    			<UnitType>UNIT_INFANTRY</UnitType>
    			<UnitAIType>UNITAI_ATTACK</UnitAIType>
    		</Row>
    		<Row>
    			<UnitType>UNIT_INFANTRY</UnitType>
    			<UnitAIType>UNITAI_DEFENSE</UnitAIType>
    		</Row>
    		<Row>
    			<UnitType>UNIT_INFANTRY</UnitType>
    			<UnitAIType>UNITAI_EXPLORE</UnitAIType>
    		</Row>
    	</Unit_AITypes>
      <Unit_ClassUpgrades>
    	  <Row>
    		  <UnitType>UNIT_INFANTRY</UnitType>
    		  <UnitClassType>UNITCLASS_MECHANIZED_INFANTRY</UnitClassType>
    	  </Row>
      </Unit_ClassUpgrades>
    	<Unit_Flavors>
    		<Row>
    			<UnitType>UNIT_INFANTRY</UnitType>
    			<FlavorType>FLAVOR_OFFENSE</FlavorType>
    			<Flavor>15</Flavor>
    		</Row>
    		<Row>
    			<UnitType>UNIT_INFANTRY</UnitType>
    			<FlavorType>FLAVOR_DEFENSE</FlavorType>
    			<Flavor>15</Flavor>
    		</Row>
    	</Unit_Flavors>
  5. I don't recognize this reference but it may just be one I've never noticed before:
    Code:
     <UnitArtInfo>ART_DEF_UNIT_WW2_INFANTRY</UnitArtInfo>
  6. This may or may not work since it is essentially trying to steal Venice's ability, and may conflict with it:
    Code:
      <Civilization_Start_Place_First_Along_Ocean>
        <Row>
          <CivilizationType>CIVILIZATION_SQUIDWARDIA</CivilizationType>
          <PlaceFirst>1</PlaceFirst>
        </Row>
      </Civilization_Start_Place_First_Along_Ocean>
  7. Since you have defined building "BUILDING_ARTISTS_GUILD_SQUIDWARD" as belonging to "BUILDINGCLASS_ARTISTS_GUILD", this would make the game think the building belonged to two different building-classes, which would cause instant CTD as soon as the player 1st pressed "Start Game"
    Code:
    <Civilization_BuildingClassOverrides>
    	<Row>
    		<CivilizationType>CIVILIZATION_SQUIDWARDIA</CivilizationType>
    		<BuildingClassType>[COLOR="Red"]BUILDINGCLASS_ARTISTS_GUILD[/COLOR]</BuildingClassType>
    		<BuildingType>[COLOR="Green"]BUILDING_ARTISTS_GUILD_SQUIDWARD[/COLOR]</BuildingType>
    	</Row>
    	<Row>
    		<CivilizationType>CIVILIZATION_SQUIDWARDIA</CivilizationType>
    		<BuildingClassType>[COLOR="red"]BUILDINGCLASS_MUSICIANS_GUILD[/COLOR]</BuildingClassType>
    		<BuildingType>[COLOR="green"]BUILDING_ARTISTS_GUILD_SQUIDWARD[/COLOR]</BuildingType>
    	</Row>
    </Civilization_BuildingClassOverrides>
  8. These do not match:
    Spoiler :
    Code:
    	<Buildings>
    		<Row>
    			<Type>[color="red"]BUILDING_ARTISTS_GUILD_SQUIDWARD[/color]</Type>
    			<Description>TXT_KEY_BUILDING_ARTISTS_GUILD</Description>
    			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_ARTISTS_GUILD_TEXT</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_ARTISTS_GUILD_STRATEGY</Strategy>
    			<Help>TXT_KEY_BUILDING_ARTISTS_GUILD_HELP</Help>
    			<GoldMaintenance>1</GoldMaintenance>
    			<Cost>150</Cost>
    			<HurryCostModifier>-1</HurryCostModifier>
    			<MinAreaSize>-1</MinAreaSize>
    			<ConquestProb>0</ConquestProb>
    			<BuildingClass>BUILDINGCLASS_ARTISTS_GUILD</BuildingClass>
    			<ArtDefineTag>ART_DEF_BUILDING_ARTISTS_GUILD</ArtDefineTag>
    			<PrereqTech>TECH_GUILDS</PrereqTech>
    			<PolicyBranchType></PolicyBranchType>
    			<SpecialistType>SPECIALIST_ARTIST</SpecialistType>
    			<SpecialistCount>2</SpecialistCount>
    			<GreatPeopleRateChange>2</GreatPeopleRateChange>
    			<PortraitIndex>5</PortraitIndex>
    			<IconAtlas>EXPANSION2_BUILDING_ATLAS</IconAtlas>
    		</Row>
    	</Buildings>
    	<Building_FreeUnits>
    		<Row>
    			<BuildingType>[color="red"]BUILDING_ARTISTS_GUILD[/color]</BuildingType>
    			<UnitType>UNIT_ARTIST</UnitType>
    			<NumUnits>1</NumUnits>
    		</Row>
    	</Building_FreeUnits>
    	<Building_Flavors>
    		<Row>
    			<BuildingType>[color="red"]BUILDING_ARTISTS_GUILD[/color]</BuildingType>
    			<FlavorType>FLAVOR_CULTURE</FlavorType>
    			<Flavor>100</Flavor>
    		</Row>
    	</Building_Flavors>
    Nor do these:
    Spoiler :
    Code:
    	<Buildings>
    		<Row>
    			<Type>[color="red"]BUILDING_MUSICIANS_GUILD_SQUIDWARD[/color]</Type>
    			<Description>TXT_KEY_BUILDING_MUSICIANS_GUILD</Description>
    			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_MUSICIANS_GUILD_TEXT</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_MUSICIANS_GUILD_STRATEGY</Strategy>
    			<Help>TXT_KEY_BUILDING_MUSICIANS_GUILD_HELP</Help>
    			<GoldMaintenance>1</GoldMaintenance>
    			<Cost>200</Cost>
    			<HurryCostModifier>-1</HurryCostModifier>
    			<MinAreaSize>-1</MinAreaSize>
    			<ConquestProb>0</ConquestProb>
    			<BuildingClass>BUILDINGCLASS_MUSICIANS_GUILD</BuildingClass>
    			<ArtDefineTag>ART_DEF_BUILDING_MUSICIANS_GUILD</ArtDefineTag>
    			<PrereqTech>TECH_ACOUSTICS</PrereqTech>
    			<SpecialistType>SPECIALIST_MUSICIAN</SpecialistType>
    			<SpecialistCount>2</SpecialistCount>
    			<GreatPeopleRateChange>3</GreatPeopleRateChange>
    			<PortraitIndex>6</PortraitIndex>
    			<IconAtlas>EXPANSION2_BUILDING_ATLAS</IconAtlas>
    		</Row>
    	</Buildings>
    	<Building_FreeUnits>
    		<Row>
    			<BuildingType>[color="red"]BUILDING_MUSICIANS_GUILD[/color]</BuildingType>
    			<UnitType>UNIT_MUSICIAN</UnitType>
    			<NumUnits>1</NumUnits>
    		</Row>
    	</Building_FreeUnits>
    	<Building_Flavors>
    		<Row>
    			<BuildingType>[color="red"]BUILDING_MUSICIANS_GUILD[/color]</BuildingType>
    			<FlavorType>FLAVOR_CULTURE</FlavorType>
    			<Flavor>110</Flavor>
    		</Row>
    	</Building_Flavors>
 
I think I got most of the errors, but there's one big one that prevents the mod from working. I hope I'm not annoying you with this. I have the updated mod attached.
 
I think I got most of the errors, but there's one big one that prevents the mod from working. I hope I'm not annoying you with this. I have the updated mod attached.
A little help on what to be looking for ?
 
Back
Top Bottom