Frustrated with Modbuddy

Craig_Sutter

Deity
Joined
Aug 13, 2002
Messages
2,753
Location
Calgary, Canada
I've been working on a mod to get rid of technologies after the Medieval Era. I had the Mod working and things were going well... the following is the last working copy I did. It loaded in game and the tech screen was adequate.

Then things went south...

Here is my last working code:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/4/2012 11:18:40 AM -->
<GameData>
	<Technologies>
		<Update>
			<Set Era="ERA_MEDIEVAL"/>
			<Where Type="TECH_ASTRONOMY"/>
		</Update>
		<Update>
			<Set Era="ERA_MEDIEVAL"/>
			<Where Type="TECH_BANKING"/>
		</Update>
		<Update>
			<Set Era="ERA_RENAISSANCE"/>
			<Where Type="TECH_FUTURE_TECH"/>
		</Update>
		<Update>
			<Set Disable="true"/>
			<Where Era="ERA_RENAISSANCE"/>
		</Update>
		<Update>
			<Set Disable="true"/>
			<Where Era="ERA_INDUSTRIAL"/>
		</Update>
		<Update>
			<Set Disable="true"/>
			<Where Era="ERA_MODERN"/>
		</Update>
		<Update>
			<Set Disable="true"/>
			<Where Era="ERA_FUTURE"/>
		</Update>
		<Update>
			<Set Disable="false"/>
			<Where Type="TECH_FUTURE_TECH"/>
		</Update>
		<Update>
			<Set GridX="7" GridY="-10"/>
			<Where Era="ERA_RENAISSANCE"/>
		</Update>
		<Update>
			<Set GridX="8" GridY="-10"/>
			<Where Era="ERA_INDUSTRIAL"/>
		</Update>
		<Update>
			<Set GridX="9" GridY="-10"/>
			<Where Era="ERA_MODERN"/>
		</Update>
		<Update>
			<Set GridX="10" GridY="-10"/>
			<Where Era="ERA_FUTURE"/>
		</Update>
		<Update>
			<Set GridX="7" GridY="3"/>
			<Where Type="TECH_FUTURE_TECH"/>
		</Update>
		<Update>
			<Set Cost="825"/>
			<Where Type="TECH_THEOLOGY"/>
		</Update>
		<Update>
			<Set Cost="825"/>
			<Where Type="TECH_CIVIL_SERVICE"/>
		</Update>
		<Update>
			<Set Cost="825"/>
			<Where Type="TECH_CURRENCY"/>
		</Update>
		<Update>
			<Set Cost="825"/>
			<Where Type="TECH_ENGINEERING"/>
		</Update>
		<Update>
			<Set Cost="825"/>
			<Where Type="TECH_METAL_CASTING"/>
		</Update>
		<Update>
			<Set Cost="1125"/>
			<Where Type="TECH_COMPASS"/>
		</Update>
		<Update>
			<Set Cost="1455"/>
			<Where Type="TECH_EDUCATION"/>
		</Update>
		<Update>
			<Set Cost="1455"/>
			<Where Type="TECH_CHIVALRY"/>
		</Update>
		<Update>
			<Set Cost="1455"/>
			<Where Type="TECH_MACHINERY"/>
		</Update>
		<Update>
			<Set Cost="1455"/>
			<Where Type="TECH_PHYSICS"/>
		</Update>
		<Update>
			<Set Cost="2340"/>
			<Where Type="TECH_ASTRONOMY"/>
		</Update>
		<Update>
			<Set Cost="2340"/>
			<Where Type="TECH_BANKING"/>
		</Update>
		<Update>
			<Set Cost="3450"/>
			<Where Type="TECH_FUTURE_TECH"/>
		</Update>
	</Technologies>
	<Technology_PrereqTechs>
		<Update>
			<Set PrereqTech="NONE"/>
			<Where TechType="TECH_ACOUSTICS"/>
		</Update>
		<Update>
			<Set PrereqTech="NONE"/>
			<Where TechType="TECH_PRINTING_PRESS"/>
		</Update>
		<Update>
			<Set PrereqTech="NONE"/>
			<Where TechType="TECH_GUNPOWDER"/>
		</Update>
		<Update>
			<Set PrereqTech="NONE"/>
			<Where TechType="TECH_NAVIGATION"/>
		</Update>
		<Update>
			<Set PrereqTech="NONE"/>
			<Where TechType="TECH_ECONOMICS"/>
		</Update>
	</Technology_PrereqTechs>
</GameData>

I should say second to last... I added other entries to get rid of the prereqs for future tech:

<Update>
<Set PrereqTech="NONE"/>
<Where TechType="TECH_FUTURE_TECH"/>
</Update>

And added two entries to make Astronomy and Banking prerequisites for future tech. I removed the old prereqs and added the new ones in that order.

Anyhow, when I did that, my mod stopped working... so I removed the added entries and returned to my old code; however, for some reason it would not load anymore.

The thing is, not only that file, but no xml files I create seem to be working anymore... not even a simple part of the mod above:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/6/2012 1:49:13 AM -->
<GameData>
  <!-- TODO: Insert table creation example here. -->
 
  <!-- TODO: Insert table data example here.-->
  
  <!-- Enter your Game Data here. -->
	<Technologies>
		<Update>
			<Set Disable="true"/>
			<Where Type="TECH_NAVIGATION"/>
		</Update>
	</Technologies>
</GameData>

I've worked at getting it going again for some time... I've rebuild and made certain I didn't forget onModActivate and UpDateDataBase, etc. I cleared different caches.

I still cannot get a simple mod to work...

So that leaves me with the belief something is wrong with Modbuddy... The thing is, when I started using the program, I could not get anything to work either... then suddenly, it did work, but now just as suddenly, it does not.

I'm thinking there might be something wrong with the Civ5 paths or user path so the mod is not being read properly, or perhaps there is a cache hidden somewhere in Modbuddy that I should empty. Or perhaps my deleting projects and redoing them to try for a fresh start is leaving bits of program scattered about and that is mixing things up.

Any explanation, advice or help would be appreciated...

By the way, my paths for modbuddy are:

c:/program files (x86)/steam\steamapps\common\sid meier's civilization v

for the program path... that was as installed, I never did a custom install.

and:

C:\Users\Craig and Nancy\Documents\My Games\Sid Meier's Civilization 5\MODS

for the user path.

So, as I said, I'd appreciate it if someone could check out the code... and any advice as to why Modbuddy has stopped working would be much appreciated.

Thanks
 
You've deleted the general cache in the user directory, I assume. I don't think ModBuddy itself is the culprit, but you could try making a brand new mod and then adding all the files from the old mod. It's an easy fix, and it worked for me when I had a similar issue that I didn't feel like troubleshooting.
 
That's the thing... that code above "is" the mod, and I've cannot even get a part of it to work anymore... a couple of times I've deleted the whole mod (making certain to keep a copy of the original code I've posted here). And then I started it anew, using just a part of the code I posted... and even those little bits are not working. I even retyped instead of copying and pasting. I'll try again with a renamed mod, but am almost sure it will not work.

Oh yes, I deleted the cache in the My Documents/games/etc folder. Several times.
 
Okay... created a new mod under a new name.

Used this simple code to change a tech cost...

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/6/2012 3:14:37 AM -->
<GameData>
  <!-- TODO: Insert table creation example here. -->
 
  <!-- TODO: Insert table data example here.-->
  
  <!-- Enter your Game Data here. -->
	<Technologies>
		<Update>
			<Set Cost="825"/>
			<Where Type="TECH_CIVIL_SERVICE"/>
		</Update>
	</Technologies>	
</GameData>

did the onModActivate, etc and built it... but nothing... when I started the game, the cost of Civil Service was unchanged.

Something is definitely wrong... I had no troubles earlier today starting my mod.

Again, any advice would be nice.
 
Download any recent Mod Component that is obviously current (one of whoward69's should work). Most of these only affect a few files -- you should be able to "rebuild it" (cut/paste into new files) in Modbuddy in 5 minutes. Make sure you compare the .modinfo file from the original and rebuilt mods.

Edit: I posted above before I saw your last post. Some more thoughts:

1. Look closely at the actual mod in the MODS folder. Is everything in .modinfo as it should be?
2. XML (and SQL) files that have errors fail to load without giving you any feedback (except that your changes didn't happen). I don't see errors above, but I'm an SQL modder so I've largely forgotten XML table syntax.
3. It's possible to screw up a file in ways that you can't see. For example, I briefly changed my mod's name from Ea to Éa. All files created during this period were "invisible" to the game (though the contents looked OK and the É character never appears in the file).
 
First of all, post the MOD the next time you need help. Not just quote your XML, but attach the actual files (zipped, of course) to your post. That way we can make sure you didn't screw up something like the OnModActivated command. Yes, I know you said you did that, but since something's obviously NOT working, we can't just take your word for it.

Second, you really need to check the logfiles, because pure XML errors are almost always caught in there. (Assuming you enabled logfiles, of course.) And yes, your error in this case would have shown up (specifically in the Database.log file), because I pasted your code into my own mod, and that's where it printed the errors.

But on to the actual code: you made one big mistake:
Code:
	<Technology_PrereqTechs>
		<Update>
			<Set PrereqTech="NONE"/>
			<Where TechType="TECH_ACOUSTICS"/>
		</Update>

There is no tech named "NONE". If you want to remove a prerequisite, you have to use a Delete command; all of the "deleting is bad" comments only apply to "primary" tables (those with Type and ID fields), you're SUPPOSED to delete the "secondary" tables that only reference other tables for their entries. So just write
<Delete TechType="TECH_ACOUSTICS"/> instead of the Update.

But here's the thing; that particular sort of XML error doesn't stop the rest of the file from working. You'll see your modified tech tree, it just won't remove those pipes that go off the screen. So if your mod is doing nothing at all, then the mod isn't ever loading, which means it's not because of anything in the XML. Again, this is why you need to post your entire mod (the post-Build version, NOT the ModBuddy input version).
 
I'm retaining bad habits from Civ4... Thank-you.

I finally got a simple bit of code that I posted above to work. I'll work on this think more tomorrow and see if I can reconstitute my mod again with your advice.

And if I have problems with my mod again, I'll post all the parts.

Sorry for being so clutzy... I'm so inexperienced at this, that I'm having difficulty distinguishing my ineptness from whether or not the program is actually working.
 
Yes, the "NONE" is definitely a problem. I was only looking at the code in post #5 since you said that this is a "fresh" mod.

In any case, we won't believe you (and you shouldn't believe yourself) without looking at the actual "built" mod.
 
Okay... this is just a part of my overall mod. Not much, just disabling techs from Renaissance to Future. It had worked before with lock symbols appearing on all the techs in game in the tech tree; but it no longer show up.

View attachment 322790

I hope I've attached all needed files.

I hope it is not a lot of trouble to look at... the map is a nice one I made for Civ 4 and have converted for Civ 5.

I've set up Askia to start with all Medieval techs for testing purposes.

Thanks.
 
I took a screenshot of my file structure for the mod... I'm unfamiliar with the program, of course, but it look a little odd to me. A few of the directories are repeated... this may be normal, I don't know...

View attachment 322810

Is this a typical file structure for a modbuddy project, or are my directories screwed up?

Thanks - still unable to get a mod working, any mod.
 
could you post how you changed the user path, I think that is a problem for me right now...thanks :)
 
On a smart phone right now. In modbuddy there is options or settings in the top menu... Click through those until you get to where you can select civ5...it should be at the bottim of that page... Clicking it will let you choose your paths. On the bottom browse foy civ 5Within my documrnts and select.

Path should be the same as mine I posted except for /mod part which should be removed.

Sorry about spelling and unclear instructions... On a mobile and without computer... I will checkin later but likely someone else will give better info before then
 
Slight correction to what he said:

In ModBuddy's options menu, you can change the path it uses for Civ5's mod directory, just like he described. But if the default directory you see in that window is wrong (to where you NEED to use that override), then it means you pointed it to the wrong place when you were installing the SDK. So you can either do what he said, and use that override in ModBuddy (and make sure every time you make a mod that that path is being changed appropriately), or you can do what I did, and use regedit to change the path in your registry to point to the right spot. (Or re-install the SDK. Same difference.) Personally I like not having to look over my shoulder to ensure I clicked that little box every time I start up ModBuddy, but editing a registry isn't something you should do unless you're comfortable with the idea of possibly screwing up your OS.
 
I took a screenshot of my file structure for the mod... I'm unfamiliar with the program, of course, but it look a little odd to me. A few of the directories are repeated... this may be normal, I don't know...

View attachment 322810

Is this a typical file structure for a modbuddy project, or are my directories screwed up?

Thanks - still unable to get a mod working, any mod.

I usually set the base directory under ModBuddy, so the 3 project folders (Build/Package/*name of mod*) are contained underneath that. Then, when you select "Build" or "Rebuild", it copies everything needed to the MODS directory automatically, keeping everything clean.
 
Top Bottom