Getting started modding, trying to modify a building

dgh64

Chieftain
Joined
Aug 20, 2014
Messages
12
So I've done a little modding in Civ IV and V, but I'm new to BE. I thought to get started, I'd try making a couple simple changes to a building. I'm trying to move to Autoplant to Habitation, and make it only have 1 engineer slot instead of 2. I started out trying to use modbuddy, and it was so incomprehensible and un-user-friendly that I just used it to generate a mod id and then used Notepad to edit files manually.

Here's the .modinfo file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="da123498-39d0-4359-9be8-4c3ad5e71e03" version="1">
  <Properties>
    <Name>Move Autoplant to Habitation</Name>
    <Stability>Alpha</Stability>
    <Teaser>Changes the tech requirement for autoplants to Habitation</Teaser>
    <Description>Changes the tech requirement for autoplants to Habitation and makes them only have 1 engineer slot instead of 2.</Description>
    <Authors>John</Authors>
    <HideSetupGame>0</HideSetupGame>
    <AffectsSavedGames>1</AffectsSavedGames>
    <MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
    <SupportsSinglePlayer>1</SupportsSinglePlayer>
    <SupportsMultiplayer>1</SupportsMultiplayer>
    <SupportsHotSeat>1</SupportsHotSeat>
    <SupportsMac>1</SupportsMac>
    <ReloadLandmarkSystem>0</ReloadLandmarkSystem>
    <ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
    <ReloadUnitSystem>0</ReloadUnitSystem>
  </Properties>
  <Dependencies />
  <References />
  <Blocks />
  <Files>
    <File md5="78104B9393118D84894E898508A22AF7" import="0">XML\CivBEBuildings.xml</File>
  </Files>
</Mod>

And here's the CivBEBuildings.xml file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 11/11/2014 3:43:26 PM -->
<GameData>
	<Buildings>
		<Update>
			<Where Type="BUILDING_AUTOPLANT"/>
			<Set PrereqTech="TECH_HABITATION"/>
		</Update>
		<Update>
			<Where Type="BUILDING_AUTOPLANT"/>
			<Set SpecialistCount="1"/>
		</Update>
	</Buildings>
  </GameData>

When I start the game, the mod loads without any errors but it doesn't make any changes. I open up the tech web and the Autoplant is still on Robotics and it still has 2 specialist slots. Anyone know what I'm doing wrong?
 
You need to use modbuddy to set the UpdateDatabase action for your new XML file (there is a way to do it manually but that is a pain and I don't remember the syntax OTOH). Honestly you should really learn how to use modbuddy if you want to mod CivBE, it is very very hard to work without it.
 
Add this to the bottom of your .modinfo, but before </Mod>:
Code:
  <Actions>
    <OnModActivated>
      <UpdateDatabase>XML\CivBEBuildings.xml</UpdateDatabase>
    </OnModActivated>
  </Actions>
 
Thank you for the help. I can't believe I forgot the OnModActivated part. It's working perfectly now.

I spent about 3 hours pounding on the keyboard in frustration before I figured out how to get modbuddy to work. It seems to be just a color-coded XML and LUA editor that checks your syntax and makes sure the files are linked properly, is that right? Is there anything else it does that I can't do just with a simple text editor? I write code a lot (mostly JavaScript, but most of the principles still apply) so once I know the syntax and stuff I'd prefer to just use notepad.
 
The only thing you absolutely need it for is uploading mods to the Steam Workshop. But it arguably makes some tasks easier.

If you don't intend to interface with the Workshop, note you don't need to generate the md5's. Just leave the md5="" part out of your Files section.
 
Back
Top Bottom