help with overwriting md file

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

00NightHunter00
Posts: 19
Joined: Wed, 8. Apr 20, 21:08
x4

help with overwriting md file

Post by 00NightHunter00 »

im having issues replacing/ overwriting a md script file

im trying to replace a md file that was added through the mod swi cause im making a overhaul of said mod but cant seem to get the correct way to write the code to do what i want

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
 <replace sel="//mdscript">
  <mdscript name="SWI_Failsafe_Stations" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\x4 extract\libraries\md.xsd">
  </mdscript>
 </replace>
</diff>
this is what i thought would do it but no luck any help would be appreciated
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: help with overwriting md file

Post by kuertee »

I would replace the first child and not the root.
Then save it with the same filename.
E.g. clearing genericmissions.xml to replace all its contents:
1. The diff XML file

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="/mdscript/cues">
		<cues>
			<cue name="MyCue">
			</cue>
		</cues>
	</replace>
</diff>
2. Save it as "x4 game\extensions\mymod\md\genericmissions.xml".
Note the filename needs to reside in exactly the same place as the original BUT in your own mod folder.
E.g. "md\genericmissions.xml" is in "x4 game\extensions\mymod\".
Realspace
Posts: 1637
Joined: Wed, 15. Nov 06, 10:21
x4

Re: help with overwriting md file

Post by Realspace »

Remember to activate the debuglog...it saved me a lot of headaches when replacing many md's. It's the only way to know if it targets. As Kuertee told, be sure it is the same name in the same folder and I add, if it is a mod of a mod, always add DEPENDANCY in the content otherwise the mod it should replace could be loadee after and your mod simply missing the target.

If it is a patch of another mod, the directory should reflect that too. As when patching a dlc
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: help with overwriting md file

Post by kuertee »

Realspace wrote: Fri, 28. Oct 22, 09:23 Remember to activate the debuglog...it saved me a lot of headaches when replacing many md's. It's the only way to know if it targets. As Kuertee told, be sure it is the same name in the same folder and I add, if it is a mod of a mod, always add DEPENDANCY in the content otherwise the mod it should replace could be loadee after and your mod simply missing the target.

If it is a patch of another mod, the directory should reflect that too. As when patching a dlc
Good point, realspace.

I missed that nighthunter was modding SWI.

In this case the folder needs to be as below IF the MD XML file is SWI-specific. I think so anyway.
x4 game\extensions\mymod\extensions\StarWarsMod_M1\md\yourxmlfile.xml

If the MD file is from the base game, then the folder nees to be:
x4 game\extensions\mymod\md\yourxmlfile.xml

EDIT: Also, replace "md" with whatever folder the file is original from. E.g. "library", "aisciprt", etc.

Return to “X4: Foundations - Scripts and Modding”