[EINFO]Doubling with GameModifier in mod overwrites

I'm not sure if it deserves its own topic, but here it goes. If you're overwriting an old type (item, building, spell, Abilitybonuses, raceconfigs), then some variables will be saved from the old version. So if you just copy say a building to a mod file, it will require twice the amount of resources to construct.

I think I've now found out that only <GameModifier> values get doubled - everything else gets overwritten. So you should be able to copy everything from a type except the gamemodifiers and not get a doubling problem.

This also presents another problem. Since the original gamemodifiers cannot be overwritten, you have to use the original gamemodifier as a startingpoint and make your own gamemodifier a "modified" version of that. For example, if you have a building that costs 100 gildar, and you want to reduce that to cost 75 gildar, the correct modifier would actually be

    <GameModifier>
      <ModType>ConstructionResourceCost</ModType>
      <Attribute>Gold</Attribute>
      <Value>25</Value>
    </GameModifier>

instead of the logical <Value>-75</Value>

Comments? Anyone found any other tag that can't be overwritten?

 

17,300 views 22 replies
Reply #1 Top

Oh, yeah, i guess that would happen...overwriting dosent clear the old data, it just overwrites it, expect for things that can be stacked (GameMods, sfx, etc) where it'd actually add that item to the list to the existing items.

Added to the bug list :)  Thanks heavenfall!

Reply #2 Top

I guess this means some things can't be overwritten at this time, for example

        <GameModifier>
            <ModType>ResourceMultiplier</ModType>
            <Attribute>Materials</Attribute>
            <Value>1.20</Value>
            <Provides>+20% Materials</Provides>
        </GameModifier>

the <Provides> tag text (which gives text to the "Provides:" area when choosing a building can't be removed.

Also unit special abilities from UnlockCombatAbility can't be removed either, or any special event like a tech revealing a new world resource.

Reply #3 Top

Actually, now that I think about it, there's no way to "counter"the inherent bonus from

        <GameModifier>
            <ModType>ResourceMultiplier</ModType>
            <Attribute>Materials</Attribute>
            <Value>1.20</Value>
            <Provides>+20% Materials</Provides>
        </GameModifier>

 since it's all additive. If I do <Value>1.20</Value> followed by <Value>1.0</Value> it just ends up with +120%.And if I do a negative value it reverses the whole building (<Value>-1.0</Value> = -120%)

Wow, this is rather inconvenient.

+1 Loading…
Reply #4 Top

Would you mind emailing me ([email protected]) with a few of the files you're trying to read in?  I think I have a solution, but would like toe verify with user-designed examples.

Reply #5 Top

Quoting Heavenfall, reply 3
Actually, now that I think about it, there's no way to "counter"the inherent bonus from

        <GameModifier>
            <ModType>ResourceMultiplier</ModType>
            <Attribute>Materials</Attribute>
            <Value>1.20</Value>
            <Provides>+20% Materials</Provides>
        </GameModifier>

 since it's all additive. If I do <Value>1.20</Value> followed by <Value>1.0</Value> it just ends up with +120%.And if I do a negative value it reverses the whole building (<Value>-1.0</Value> = -120%)

Wow, this is rather inconvenient.

Have you tried:

        <GameModifier>
            <ModType>ResourceMultiplier</ModType>
            <Attribute>Materials</Attribute>
            <Value>0.80</Value>
            <Provides>-20% Materials</Provides>
        </GameModifier>

This sort of a system worked to counter the default bonuses from NPC professions and Sov histories.

Reply #6 Top

I have been trying to edit CoreUnitGroupings.xml and it seems impossible to change this file. Any change to this results in the doubling of some techs, for example 2 harbors, etc.

Reply #7 Top

Here's my question, I seem to be getting this overwrite but I am not modding files and placing them into a mod folder, I am simply modding the core files and leaving them where they are. Yet I still get this doubling and say 4 townhalls appearing on the tech tree description.

 

Apparently, it's quite like what BlackRainz has been having, yet I am not modding any tech files.

Reply #8 Top

Yeah, it doesn't matter if you edit tech files, some files cause the double thing.

Reply #9 Top

Many of the core Kingdom buildings XML files are literally broken where they have multiple copies of structures and some structures completely coded improperly. This is what's causing your doubling. Making a new data.zip file essentially breaks the game.

Doubling might also be caused by multiple input of the same building into a technology. Make sure your not just copying all the xml data and modifying it. You kinda need to minimize what your editing because the old stuff will still exist when you mod it... if that makes any sense.

Try removing the references to the harbors and such in your mods.

Reply #10 Top

Making a new data.zip file essentially breaks the game.

 

This must be it, because I am not copy+pasting anything, no duplicate files or any of that.

Reply #11 Top

Making a new data.zip does not always break the game, actually most of the time it doesn't. There are many files you can change without it happening but there are also some that will cause this problem to happen. I have been playing around with it for a while and it doesn't always cause the problem. Or perhaps it didn't do it in other versions, maybe it's become a big issues in the new version?

Reply #12 Top

Hmmm, it's possibly that remaking the data.zip only includes any relevant files. However, if your going to do any building modification it'll break.

Reply #13 Top

For the record, when you're altering a spellbook under the <Spellbook> tag you have to re-state all spells. Despite <SpellBookNode> obviously being repeatable, it does not get saved when overwriting <Spellbook>.

Reply #14 Top

I now believe that Spells are also flawlessly overwritten in 1.06, including GameModifiers. I realize I'm bumping, but I think that's important to know if you're trying to overwrite an old spell.

Reply #15 Top

ok i may have asked this in a way, but i still don't seem to grasp it.

I am remaking the data.zip, with core files only, yet modifiers and text are being duplicated, why is this when

there is nothing to duplicate from?

 

 

P.S. Plz don't tell me to put down the matches and leave the fire playing to adults :)

Reply #16 Top

Quoting BoogieBac, reply 1
Oh, yeah, i guess that would happen...overwriting dosent clear the old data, it just overwrites it, expect for things that can be stacked (GameMods, sfx, etc) where it'd actually add that item to the list to the existing items.

Added to the bug list   Thanks heavenfall!

As far as I see, this still isn't fixed with 1.07, and hampers modding community.

My impression was this is was going to be fixed ASAP.

Reply #17 Top

This does make it difficult to mod existing items.  I would guess that prerequisites also stack rather than overlay although that should cause less of a problem.

Quoting EviliroN, reply 15
...
P.S. Plz don't tell me to put down the matches and leave the fire playing to adults

No adults here.  We're all kids with matches. ;)

Reply #18 Top

It appears not to apply to items. Don't know if its new in 1.07 or if it never did.

Edit: Abilitybonuses also have the doubling effect.

Edit2: Doublechecked, still applies to improvements.

Reply #19 Top

Quoting Heavenfall, reply 18

Edit: Abilitybonuses also have the doubling effect.

 

I edited the core abilitybonuses file and am not getting a double on it. the only thing for me that was doing it was improvements and I've since found a way to not have to edit that file for my mod.

Reply #20 Top

Ah. It seems to differ from event to event. I tried a new race ability and it doubled. Then I tried a merchanthistory and it didn't double.

Reply #21 Top

i guess, in a way, it's too bad. i assume if it were an across the board thing, they'd have an easier time debugging, no?

 

Reply #22 Top

It doubles when you are trying to change a value which is already there, it does not double when your adding something for the most part. I can add mana regeneration to a building as long as I create a new file, and delete everything except for the code for adding mana regen. Some files are fine though, you can edit all weapons and armor and it works fine.