Jump to content
Charon

How does the whole modmerge thing work ?

Recommended Posts

@Max_Caine and @Solver

So how does this whole modmerge thing work ?

X-Divison has an aircrafts.xml and aircraftweapons.xml. Both work fine. I guess this is because there is no other same named file (aircrafts.xml or aircraftweapons.xml)  loaded before before that.

If another mod changes the aircraftweapons.xml it only "update"s the content but doesnt " insert" or "replace" it.

So what do I have to do in order for other aircraftsweapons.xml to get acknowledged which are ON TOP of x-divison.

And yes i´ve read the illunak thread :). I guess i cant figure out where to put that MODMERGE in excel sheets.

Share this post


Link to post
Share on other sites

Excel XML files are horrible...

If you're changing an aircraft weapon that already exists in XDivision, then the new mod primarily needs to have the same name (first column) as the weapon in XDivision. "Update" is the default I think, if you want to replace then you have to specify values for all columns in the new mod's Excel XML. And to "insert" you write a row with a new name, that doesn't exist in any previous mod.

Share this post


Link to post
Share on other sites
3 minutes ago, Solver said:

Excel XML files are horrible...

If you're changing an aircraft weapon that already exists in XDivision, then the new mod primarily needs to have the same name (first column) as the weapon in XDivision. "Update" is the default I think, if you want to replace then you have to specify values for all columns in the new mod's Excel XML. And to "insert" you write a row with a new name, that doesn't exist in any previous mod.

The problem is when we add a new mod with new and existed weapons at X-Division, it upgrades or replaced the existed ones but does not insert the new ones. I see the new ones when X-Division is deactivated but when i activate it, i lose the new ones. 

Share this post


Link to post
Share on other sites
1 minute ago, Solver said:

Excel XML files are horrible...

Yo, any suggestions how to deal with them ? Because we kind of want to add more, and more mini mods on top of it like the MICHAEL BAY APPROACH MOD. Because the AM_AirSuperiority and CO seems to work fine with everything.

 

1 minute ago, Solver said:

If you're changing an aircraft weapon that already exists in XDivision, then the new mod primarily needs to have the same name (first column) as the weapon in XDivision. "Update" is the default I think,

Yeh, I found that out. Its "insert" as long as the file, apart from XCE, doesnt exist. Its "update" as soon as the modloader has loaded the same file earlier. That are the auto settings.

I dont know where i have to write MODMERGE "***" MODMERGENAME "***", can you give me an example ?

Share this post


Link to post
Share on other sites

You write those things in the actual Excel cell. If in your FiringMode column you write:

MODMERGEREPLACE Mixed MODMERGEWITH Auto

then it would make the particular weapon auto-fire. Though it's a silly example, you should just make a column that says Auto. There is nothing in aircraftweapons.xml that can accept multiple values so using the MODMERGE commands in that file doesn't make sense. It makes much more sense in researches or items xml files.

If some things simply aren't appearing, then it's probably an error in some file somewhere...

(I'm not actually an expert on the modmerge stuff, I didn't make it)

Share this post


Link to post
Share on other sites

This doesnt screw up the whole file if i put a MODMERGE in front of the identifier column ?

like:     <Cell><Data ss:Type="String">MODMERGEATTRIBUTE "Name" MODERGE "insert" AV.HYPERMISSILE</Data></Cell> ?

does this now insert the whole item ?

Edited by Charon

Share this post


Link to post
Share on other sites

Actually, im just throwing this out there and you are free to argument against but this system seems to be counter intuitive for it is trying to do, that is providing a modular system.

Lets take Khall's Tundra Tileset  as an example. The "tundra" tileset doesnt exist previously so he uses "insert" ( writing nothing would have worked the same way, see auto explanation above) in missiontypeprops_gc.xml. "tundra" didnt exist previously but now it does which means i have to use "replace" in my own missiontypeprops_gc.xml to make it working ( i tested this throughly with my own file ). Can you follow me so far ? Easy enough i guess.

For future references its important to keep in mind: XCE is not a mod and doesnt follow the same rules, its the base from wihich the modular system starts to work.

So XCE adds the tile "forest" to the game without any missiontypeprops_gc.xml content. I can no longer write nothing to "forest" because missiontypeprops_gc.xml exists previously loaded in the modloader (khall, see "update" post above), but i have to write "insert". Still with me ?

For instance if khall wants to add a forest line in his missiontypeprops_gc.xml he would naturally have to use "insert" or nothing. This would break my own missiontypeprops_gc.xml because the command "insert" in my file is no longer valid and produces a modmerge error. See where this is going ?

Furthermore, the order of the mods is crucial for it to work.

Lets say someone added a new weapon and uses "insert". If you want to replace that weapon you have to use "replace". What now if the original author deletes this weapon ? Right the second mod produces a modmerge error.

 

 

All in all this makes i fairly fragile, because if one author changes something in one mod it can break things above and below its priority regarding inserted items. Utmost care and prudence is necessary.

All of this makes every modloader configuration unique and every little change needs to be checked if it works. Still looks like an improvement over the old overwriting style.

I can start to see that a lot of people tried to make it as good as possible :).

 

Back to my original question: where do i write those modmerge commands in an excel spreadsheet ?

Edited by Charon

Share this post


Link to post
Share on other sites

I think a better question is, what are you trying to accomplish?

You shouldn't have MODMERGE in the name column, as it's the identifier of the weapon. You don't want to merge the identifier, probably, and I'm having a hard time imagining a situation where you could benefit from MODMERGE commands in the aircraft weapons file.

Share this post


Link to post
Share on other sites

ok back to my original post :D

X-Division has an file called aircraftweapons.xml.

Another mod with the name "New Airgame" has a aircraftweapons.xml as well. This mod has a higher priority.

Remember what i said earlier ?

15 hours ago, Charon said:

Yeh, I found that out. Its "insert" as long as the file, apart from XCE, doesnt exist. Its "update" as soon as the modloader has loaded the same file earlier. That are the auto settings.

This means the aircraftweapons.xml only "updates" the file, but doesnt append (illunak style) or "insert" new items. See the problem ?

If another mod wants to "insert", thus creating a new item, it needs the "insert" command, otherwise non existing "update"ed items will get deleted, just like illunak said. As a side not, this doesnt produce a modmerge error.

So where do i put that "insert" command ?

1 hour ago, Solver said:

I think a better question is, what are you trying to accomplish?

I want 2 mods with 2 aircraftweapons.xml to get the higher priority mod to append new items/weapons.

Slowly i could write @llunak but not yet.

 

This seems such like a basic problem and yet we have so many difficulties to get a proper solution.

Share this post


Link to post
Share on other sites
4 hours ago, Solver said:

I think a better question is, what are you trying to accomplish?

You shouldn't have MODMERGE in the name column, as it's the identifier of the weapon. You don't want to merge the identifier, probably, and I'm having a hard time imagining a situation where you could benefit from MODMERGE commands in the aircraft weapons file.

For short, we got a mod with airweapons file and got new weapon A and new weapon B.

When i make another mod with stats changed weapon A, weapon B and a new weapon C and put those 2 mod together (activated), i got weapon A and weapon B with replaced stats but not new weapon C.. So when you use 2 mods together with airweapons, you only can get new weapons only from 1 mod (which is most under the list)..

I think there is an error here when combining 2 airweapons file.

Share this post


Link to post
Share on other sites

I'm sorry Charon, but I can't help you with your original question. I've never had a copy of Excel, and I could never get any of the free Excel-like spreadsheets out there to work with Xenonauts, so when I modded a Excel-to-XML file, I always used a text editor. That's my only experience of editing such files, so I can't advise you how to edit a file in Excel. 

Share this post


Link to post
Share on other sites
20 minutes ago, Max_Caine said:

I'm sorry Charon, but I can't help you with your original question. I've never had a copy of Excel, and I could never get any of the free Excel-like spreadsheets out there to work with Xenonauts, so when I modded a Excel-to-XML file, I always used a text editor. That's my only experience of editing such files, so I can't advise you how to edit a file in Excel. 

@Max_Caine I doesnt matter if you use excel or not im clearly useing a text editor here:

 

19 hours ago, Charon said:

This doesnt screw up the whole file if i put a MODMERGE in front of the identifier column ?

like:     <Cell><Data ss:Type="String">MODMERGEATTRIBUTE "Name" MODERGE "insert" AV.HYPERMISSILE</Data></Cell> ?

but its ok, seems like nobody knows something about this :). We are on VIRGIN lands !!! ... Somehow.

Edit: @llunak help ?

Edited by Charon

Share this post


Link to post
Share on other sites

Yeah, to actually do what drages describes, there should be no modmerge commands. Should work as he describes, really, that you can update two weapons (by using just the necessary fields), and add a new weapon (by using all the fields). If this doesn't work, it's a problem.

Share this post


Link to post
Share on other sites
19 minutes ago, Solver said:

Yeah, to actually do what drages describes, there should be no modmerge commands. Should work as he describes, really, that you can update two weapons (by using just the necessary fields), and add a new weapon (by using all the fields). If this doesn't work, it's a problem.

Yep it's.. not a deadly one, it's there..

Btw solver, can you look for aiprops.xml ai inventory code, this is what i use:

<Equipment>
         <PrimaryWeapon name="weapon.AlienPlasmaPistol" />
		 <SecondaryWeapon name="weapon.aliensmallshield" />
          <Belt>
            <Item name="ammo.alienplasmacell" />
          </Belt>
        </Equipment>

Here you can see AI got a plasma pistol and a shield. This works but i want to know that i can give a second weapon to him to use? Or is it doable by XCE? I want to create ranged and melee reaper type aliens. If AI can't handle it as AI wise, maybe there can be coded a percentage which weapon to choose. Maybe second weapon could be coded only for melee weapon. 

My main reason to want this to create a melee reaper type alien which can attack to vehicles.. 

OR if you can't do that, can you add an option to make melee creatures to attack vehicles. They are ignoring the vehicle and vehicles became very OP against them.

Share this post


Link to post
Share on other sites

Multiple weapons for aliens don't really work unfortunately. You can give aliens a second weapon, but they won't use it. They will only use grenades.

I would implement melee/ranged variations of aliens by actually creating two different alien classes, and assigning them to UFOs via the ufocontents files. That should probably work.

Share this post


Link to post
Share on other sites
4 hours ago, Solver said:

Yeah, to actually do what drages describes, there should be no modmerge commands. Should work as he describes, really, that you can update two weapons (by using just the necessary fields), and add a new weapon (by using all the fields). If this doesn't work, it's a problem.

Jup, thats what i´m saying. Looks like the modmerge system never worked for xml spreadsheets in the first place

 

!!! Disclamaimer !!! the following evil song is only meant for ENTERTAINMENT and its not meant personal, just an expression on how people  and I might feel in some way !!! Disclaimer End !!!

 

No one knows what its like

to be a moooooodder 

to work with XCE

Behind blue eyes

No one knows what its like

To post threads

to be fated

to telling only thrice

 

But my dreeeams

they arent as empty

as the answers seems to be

I have hours,

only lonely

spend with files

that never work

 

No one knows what its like

to feel these feelings

Like i do,

and i thank you

No one asks back as hard

on their dreeeeam

None of my  broes

can show through

 

But my dreeeeeams

 they arent as empty

As the answers

seems to be

I have hours,

only lonely

spend with files

that never work

 

Discover

X.C.E. System (4x)

 

No one knows

what its like

to be misunderstood

and enlighted

Behind blue eyes

No one knows

what to say

about the merging system

but i dont worry

Im not telling lies

 

But my dreeeams

they arent as empty

as the answers

seem to be

I have hours,

only lonely

spend with files

that never merge

 

No one knows

what its like

to be a mooooodder

to work with XCE

Behind blue eyes

 

 

Edited by Charon

Share this post


Link to post
Share on other sites
2 minutes ago, Solver said:

Multiple weapons for aliens don't really work unfortunately. You can give aliens a second weapon, but they won't use it. They will only use grenades.

I would implement melee/ranged variations of aliens by actually creating two different alien classes, and assigning them to UFOs via the ufocontents files. That should probably work.

Giving melee aliens a ranged weapon option will make it too.. but it would be more chaotic when you dont know what the alien will do, melee or ranged.. anyway it was a weak call anyway.. thx clearing this..

I am so happy that i can take clear answers from top coder of the XCE.. I really hypes me more.. i did not have this until now.. when i came to the forums, you left the XCE years ago.. sad days..

 

 

Share this post


Link to post
Share on other sites

Modmerge for XML spreadsheets does work, there are enough mods using it. Including X:CE itself to add stuff like incendiary items. But it may fail to work in particular circumstances, maybe there's a problem with mixed insert/update rows in the same file.

Share this post


Link to post
Share on other sites
22 minutes ago, Solver said:

Modmerge for XML spreadsheets does work, there are enough mods using it. Including X:CE itself to add stuff like incendiary items. But it may fail to work in particular circumstances, maybe there's a problem with mixed insert/update rows in the same file.

look below

9 hours ago, Charon said:

For future references its important to keep in mind: XCE is not a mod and doesnt follow the same rules, its the base from wihich the modular system starts to work.

Yes, you are right it works as long the as the xml sheets "update"s existing weapons :). The problem is this:

23 hours ago, Charon said:

If another mod changes the aircraftweapons.xml it only "update"s the content but doesnt " insert" or "replace" it.

So what do I have to do in order for other aircraftsweapons.xml to get acknowledged which are ON TOP of x-divison.

You could make 2 mini exemplary mods with only modinfo and aircraftweapons and try to add new weapons in the higher priority mod and see if it works for yourself, and share it if it works. I hope the mistake is on our side.

Share this post


Link to post
Share on other sites

Yes, right, X:CE itself isn't a mod, but I was actually referring to the X:CE Balance Mod. It's just a mod, even if it's on by default, and it uses spreadsheet merging.

Share this post


Link to post
Share on other sites
2 minutes ago, Solver said:

Yes, right, X:CE itself isn't a mod, but I was actually referring to the X:CE Balance Mod. It's just a mod, even if it's on by default, and it uses spreadsheet merging.

But not aircraftweaopns.xml spreadsheet merging. We know that spreadsheet merging should function:

23 hours ago, Charon said:

Yo, any suggestions how to deal with them ? Because we kind of want to add more, and more mini mods on top of it like the MICHAEL BAY APPROACH MOD. Because the AM_AirSuperiority and CO seems to work fine with everything.

I´ve just confirmed teh bug again:

1. Copy and paste aircaftweapons.xml and items.xml into a new mod

2. C&P a weapon and change it to: AV.TEST in both files. Set the new item to unlimited

3. change the picture for the existing autocannon

Result: the picture gets taken but the new weapon not. No modmerge error anywhere.

Could you try this and report back i would really love to know that the bug is on our side, thank you :):

25 minutes ago, Charon said:

You could make 2 mini exemplary mods with only modinfo and aircraftweapons and try to add new weapons in the higher priority mod and see if it works for yourself, and share it if it works. I hope the mistake is on our side.

 

Share this post


Link to post
Share on other sites

I´ve also confiremd right now that the items.xml, which is a spreadsheet as well, functions as expected. The new item is available, just not for the aircraft.

Share this post


Link to post
Share on other sites
11 hours ago, Charon said:

But not aircraftweaopns.xml spreadsheet merging. We know that spreadsheet merging should function:

I´ve just confirmed teh bug again:

1. Copy and paste aircaftweapons.xml and items.xml into a new mod

2. C&P a weapon and change it to: AV.TEST in both files. Set the new item to unlimited

3. change the picture for the existing autocannon

Result: the picture gets taken but the new weapon not. No modmerge error anywhere.

Could you try this and report back i would really love to know that the bug is on our side, thank you :):

 

So you could post those files here and accelerate the process of me looking at them :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×