Jump to content

Help with Converting a Mod to Modular System


Recommended Posts

So I've been trying to get Khall's Shotguns and Carbines mod to work with the modular system, but I'm having problems. Could someone go over this and tell me what I'm doing wrong?

Apparently others get a CTD on startup and when I try to go to the soldier equip screen I get a CTD.

https://dl.dropboxusercontent.com/u/82304502/Xenonauts/Khall%27s%20Carbines%20%26%20Shotguns.zip

Link to comment
Share on other sites

Hope you don't mind, but here's some corrections that should make everything work (I needed to work through it to make sure it would work, so it made sense to pass it on to you):

[ATTACH]5172[/ATTACH]

There's several issues that have been corrected:

1) In all of the non-spreadsheet .xml files that have new things being added to them, you need to use *both* MODMERGEATTRIBUTE="name" (or whatever is the merging attribute) and MODMERGE="insert". Note that this is contrary to what llunak indicated when he commented on my Armoured Assault mod. I'm unsure whether it's a bug or not, but since it works with MODMERGEATTRIBUTE anyway I guess it doesn't matter too much.

2) For all of the non-spreadsheet .xml files where you were replacing something, you need again to have MODMERGE="update" and MODMERGEATTRIBUTE="name" and then only include the elements you want to replace. You don't need MODMERGE="update" on any of the other rows unless the element has children (e.g. <singleshot> and <ammos>)

3) When adding in burst fire to an already existing weapon, you don't need to use MODMERGE="insert". The element strictly speaking already exists (even if it's empty) so it's an "update" instead (but since it doesn't have children, you can just include the <burstfire> row without a MODMERGE command)

4) For the rocket launcher, you needed to use MODMERGEATTRIBUTE="name" for all the rocket types as there's multiple <ammo> entries.

5) In ammos.xml, in addition to needing the MODMERGEATTRIBUTE="name" on the entry, you need to add MODMERGE="update" to the top-most element (i.e. <Ammos>). This is because that element has both children (the ammo entry) and an attribute (the random xmlns:xsi thing). Took me a while to figure out that one!

I think that's it. I don't think I made any changes to the spreadsheets. Hope that's useful and makes sense (it might be worth looking at the files too?). For what it's worth, it took me a few attempts to get it all working myself.

Also, I added in a line to the shotgun giving it a burst fire mod as a test, but I forgot to remove it before uploading so it will need removing (sorry).

Also also, it looks like the mod loader doesn't add in new sounds at the moment. All the elements definitely added in correctly according to the error log, but there's still none of the new sounds. I'll log it as a bug report, but if you want it to work in the short term I guess you'll need to add the new sounds directly into the correct folder rather than using them in a mod folder.

Khall's C+B.zip

Khall's C+B.zip

Link to comment
Share on other sites

1) In all of the non-spreadsheet .xml files that have new things being added to them, you need to use *both* MODMERGEATTRIBUTE="name" (or whatever is the merging attribute) and MODMERGE="insert". Note that this is contrary to what llunak indicated when he commented on my Armoured Assault mod. I'm unsure whether it's a bug or not, but since it works with MODMERGEATTRIBUTE anyway I guess it doesn't matter too much.

You're right on this, "insert" should require MODMERGEATTRIBUTE in this case, otherwise insert wouldn't know whether the element already exists or not.

5) In ammos.xml, in addition to needing the MODMERGEATTRIBUTE="name" on the entry, you need to add MODMERGE="update" to the top-most element (i.e. <Ammos>). This is because that element has both children (the ammo entry) and an attribute (the random xmlns:xsi thing). Took me a while to figure out that one!

Hmm, yes. That's an internal XML attribute, so I think I'll add it to the list of ignored attributes for merging.

Also also, it looks like the mod loader doesn't add in new sounds at the moment. All the elements definitely added in correctly according to the error log, but there's still none of the new sounds. I'll log it as a bug report, but if you want it to work in the short term I guess you'll need to add the new sounds directly into the correct folder rather than using them in a mod folder.

Will be fixed in 0.27.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...