[EINFO]Doubling with GameModifier in mod overwrites

By on August 29, 2010 10:18:09 AM from Elemental Forums Elemental Forums

Heavenfall

Join Date 07/2008
+436

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?

 

Locked Post 22 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 10:25:04 AM from Elemental Forums Elemental Forums

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!

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 10:44:26 AM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 11:04:51 AM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 12:29:52 PM from Elemental Forums Elemental Forums

Would you mind emailing me (scott@stardock.com) 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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 3:47:17 PM from Elemental Forums Elemental Forums

Quoting Heavenfall,
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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 4:15:17 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 5:33:08 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 8:08:26 PM from Elemental Forums Elemental Forums

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

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 8:23:03 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 8:25:42 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 8:37:35 PM from Elemental Forums Elemental Forums

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?

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 10:32:40 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
August 31, 2010 10:33:19 AM from Elemental Forums Elemental Forums

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>.

Reason for Karma (Optional)
Successfully updated karma reason!
September 2, 2010 7:00:10 AM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 1:27:07 AM from Elemental Forums Elemental Forums

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

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 5:08:46 AM from Elemental Forums Elemental Forums

Quoting BoogieBac,
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.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 6:23:45 AM from Elemental Forums Elemental Forums

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,
...
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.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 6:52:50 AM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 3:22:11 PM from Elemental Forums Elemental Forums

Quoting Heavenfall,

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.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 3:31:48 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 4:10:36 PM from Elemental Forums Elemental Forums

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?

 

Reason for Karma (Optional)
Successfully updated karma reason!
September 6, 2010 1:20:19 PM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108432  walnut2   Server Load Time: 00:00:00.0000157   Page Render Time: