Vanilla Units won't accept modded changes

Ajidica

High Quality Person
Joined
Nov 29, 2006
Messages
22,482
In my mod I created a new unit tree and, because I'm too lazy to remove all of the vanilla units I didn't want in the mod (like Swordsmen, Nuclear Missile, ect) I set their production cost equal to -1 so they couldn't be built and assigned them all the tech 'nanotechnology' so I wouldn't have to see them in the pedia.

I made sure I properly refrenced the file where the changes are. The modinfo file acknowledged the file is both loaded and activated.
However, none of my changes are loading up. All of the other changes I made in different files are working just fine (with the exception of a few text key things I can safely ignore).

Now, to save time with this what I did was import the vanilla unitinfo file and just changed the relavent stuff. Might this cause the issue to occur? If so, what should I do to rectify it?
 
If there is an error in an XML file, then the entire file won't execute. So it's possible that somewhere in your large file is some mistake, and it's preventing the whole thing from working. The ModBuddy builder does not check to see if your file is actually correct, so it's very easy to miss something.

FireTuner can sometimes tell you what the error is, but failing that, the only option is to comment out most of the file, see if that works, and then uncomment parts of the file and re-check it each time. Or post it here and we might spot the error for you.
 
Thanks. Here is the file.
 
Ah. Well, the main problem is that you just can't edit GameData XML this way. You can't replace the entire file, you MUST use the <Update> syntax. (I misunderstood what you'd said you did.)

When you said you'd set all of the existing units' costs to -1, I thought you did using a simple Where command. Like:

Code:
<GameData>
  <Units>
    <Update>
      <Set Cost="-1">
      <Where />
    </Update>
  </Units>
</GameData>
Or if you want it to only do this for combat units, you could do the Where by combat class, or by whether the Combat rating is positive, or something along those lines.

But bottom line, you just can't edit database XML this way, at all.
 
Why must modding in Civ5 be so counter-intuitive?

Anyhow, might this cause some eventual issues if applied to the SS parts units?

Second Question: Why doesn't simply editing the base file work?

Last question: Is there any list showing where all of these different types of commands are? Kaels tutorial has gotten a bit out of date.

EDIT: Problem.
I put the code snippet into the file with the vanilla units and when I loaded the game up, my custom units dissapeared. I then tried sticking the code into the file with my custom units and I didn't activate the vanilla file, but my custom units also dissapeared. Is there something I am missing here?
 
Anyhow, might this cause some eventual issues if applied to the SS parts units?

Might what? Like I said, your whole methodology is wrong. It doesn't matter WHAT is in the file, doing it this way simply will not work.

Second Question: Why doesn't simply editing the base file work?

First, because Steam automatically overwrites the contents of those directories each time there's a patch. The occasional minor patches won't get a lot of fanfare, but they'll still destroy the changes you're making. (Worse, they might destroy some of the changes but not others, and now nothing would work right.)

Second, because that change would then apply to every game you play. You wouldn't be able to turn it on and off like you can normal mods.

Third, because editing the core files for any type of software is just a really bad idea in general. For one thing, there are a variety of minor mistakes you can make in the XML that would cause the entire game to crash upon login. If those mistakes are in the core files, you can't even get into the program to try to find out what's wrong. (FireTuner's a bit flaky if it's initialized before the main process is.)

Fourth, because mods are loaded after the core files (but before custom maps), so you'd need to put ALL of your related changes into the core files to get it to work. So not just units, but unit classes, all the other unit tables, any new promotions those units use... you can see the problem.

Also, no one else would be able to use your mod. But I'm not going to count that as a fifth reason, since you're clearly just doing this for your own entertainment.

Last question: Is there any list showing where all of these different types of commands are? Kaels tutorial has gotten a bit out of date.

XML editing hasn't changed at all since he wrote that tutorial. (Neither has SQL.) It's the Lua methodology and art asset logic that's changed, and even that hasn't changed by much. (Pretty much VFS and GameEvents are the two notable changes.) If you were doing Lua editing then I'd point you to the wiki, but for XML, there are only Delete, Set, and Where, within either Update or Row entries. That's it, and that's all you need for GameData XML.

So the way to fix the problem you're experiencing is to use the method in his tutorial. It works just fine.

Is there something I am missing here?

Yes. You just can't do it that way very easily, for the reasons I've outlined above. Spend the time learning the right way to edit XML, and you'll be much happier in the long term.
 
Okay, I've read Kaels tutorial before, but it doesn't cover what to do if I simply don't want the game to look at vanilla units unless if I want to add an entry for every single unit I want to get rid of.

First, because Steam automatically overwrites the contents of those directories each time there's a patch. The occasional minor patches won't get a lot of fanfare, but they'll still destroy the changes you're making. (Worse, they might destroy some of the changes but not others, and now nothing would work right.)

Second, because that change would then apply to every game you play. You wouldn't be able to turn it on and off like you can normal mods.
I'm not changing a core file. I copied it into my mod and renamed it. If Steam updates are rewriting renamed files, then there is a bigger issue going on here.
 
I managed to get the vanilla units to dissapear. Thank you for your help.

However, I did the same thing for the vanilla civs so they don't show up in the pedia but when I went to select a civ the only one that appeared was the Mongols. I tried random civ and managed to get one of my modded civs.
Now, when I went to select my civs through the Advanced Setup menu (or whatever it is called) I got all of my modded civs there. Any ideas on why this might occur?

EDIT: I ran into a similar issue, but I don't think I am doing anything wrong. I have renamed oil, aluminum, and coal into three mod specific resources. What I did was create an XML file labled 'Resource Modificiation', copied over the aluminum, coal, and oil entries, and then changed the TXT_KEYs on them along with the required texts. I then checked to make sure the game loaded it up and it did, but no changed occured in the pedia.
 
I found this thread via the site search, since you guys talking about somethign similiar i want to do but not as complex. I want to edit the vanilla Civilizations.

For e.g. rename egyptian cities to more modern names, and rename the persian civilization to Iran and for England to be instead United Kingdom and include scottish &Irish cities. and Removing those cities from the city states and basically swopping it to represnt a certain civ like Jerusalem.

How do i do this?

And i basically do not want it to use the vanilla city states nor do i want it to use the existing vanilla civs information/details
 
Back
Top Bottom