Basic XML editing

AJ22PIZZA

Chieftain
Joined
Jun 3, 2014
Messages
93
Hello. I'm trying to make a mod that's a simple XML edit. I coped the entire "UnitAbilities" XML file and removed this line of code: <Row Type="ABILITY_ANTI_SPEAR" Tag="CLASS_MELEE"/>.
I made a build of the mod and it appears in my "Additional Content" folder and I have it enabled, but when I create a game it doesn't load up. Thanks in advance.
 

NameArleadyUsed

Chieftain
Joined
Mar 12, 2016
Messages
99
Location
Europe, Earth, Solar System
Vanilla files are loaded every time you launch (start/load) game. After that any enabled mods are loaded. This means original files are always loaded and thus simple copy_almost_all and try to load will fail to achieve what you expect. In this case all unit abilities are arleady in game at just before your mod starts to load. Moreover, game does not let you load the same things (abilities you didn't deleted) twice and prevents that kind of abuse by: not loading/crashing/trolling you other way.
What you need to do is to delete anti spearman ability with your mod (Remember? It arleady is in game when your mod loads.). So you can delete all the lines of your XML file and write this
Code:
<GameInfo>
<UnitAbilities>
<Delete UnitAbilityType="ABILITY_ANTI_SPEAR" />
</UnitAbilities>
</GameInfo>
Or change file format from XML to SQL (both of the original file and in .modinfo) and write this:
Code:
DELETE * FROM UnitAbilities WHERE UnitAbilityType='ABILITY_ANTI_SPEAR';
 
Last edited:
Top Bottom