Patching MD of TOA and KE dlcs

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

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

Realspace
Posts: 1641
Joined: Wed, 15. Nov 06, 10:21
x4

Patching MD of TOA and KE dlcs

Post by Realspace »

I need help with the mission patching. While vanilla mission mdscript is easily patchable, all mission introduced by the DLC have various degrees of problems when you want to redirect their SPACE or even only keep the space they link to.

Space specific is recalled by the tag extension="'ego_dlc_pirate'", or whatever dlc. This allows the dlc to select only its sectors. Problem is I added more sectors and in general, when patching a dlc, this tag creates a pletora of problem if not removed.

If basic space is called by space="player.galaxy", dlc's is called with a <find_sector name="DLCNameSectors"...and the above extension="'ego_dlc_xxx'"
If you keep this link to dlc's space, patching will not link to any space and the missions get bugged.

So I added a simple string to redirect the space to a specified list of sectors. Example:

Code: Select all

 <!--new string-->
		<set_value name="$PirateSectors" exact="[macro.cluster_500_sector001_macro, macro.cluster_500_sector002_macro, macro.cluster_500_sector003_macro, macro.cluster_501_sector001_macro, macro.cluster_501_sector002_macro, macro.cluster_502_sector001_macro, macro.cluster_502_sector002_macro, macro.cluster_503_sector001_macro, macro.cluster_503_sector002_macro, macro.cluster_504_sector001_macro]"/>
		<!--end-->
After this I can call the $PirateSectors and delete the extension="'ego_dlc_xxx'" that creates problems.

This works, but not always. Works with Terran and Split dlc, I have no errors, but somehow is not accepted by TOA and KE for some parts.

The log tells that some cue can not find the space. So I tried to repeat the <set_value name="$PirateSectors" etc. at the beginnin of each action, still the space is not recognized. I also added the space="player.galaxy" that is not there when calling the space from a dlc, but they still resist.

There is no error in the patching, no duplicate or missin directory. The errors is at the level of the final document the engine creates after patching. Here an example of the log

Code: Select all

[=ERROR=] 1.03 Error in MD cue md.Setup_DLC_Pirate.SetupAuroraCasino: Invalid space
* Expression: $PirateSectors
* Action: <find_station>, line 540
Seems like the engine can not find the sectors that are specified by the $PirateSectors so can not create the station, in this case. But other errors derive from this premise too, if you can not set the space then various actions can not be performed.

In Setup_DLC_Pirate I've patched with this line:

Code: Select all

<replace sel="/mdscript/cues/cue[@name='X4ep1_Prelude_Setup']/cues/cue[@name='SetupAuroraCasino']/actions/find_sector[@name='$Windfall4Sector']">
                     <find_sector name="$Windfall4Sector" macro="macro.cluster_503_sector001_macro" space="player.galaxy" comment="Windfall IV"/>
              </replace>
The original is this:

Code: Select all

<find_sector name="$Windfall4Sector" macro="macro.cluster_503_sector001_macro" extension="'ego_dlc_pirate'" comment="Windfall IV"/>
As you can see, I am not even redirecting to another sector (I did it some times and worked with terran and split DLC). I simply need to set the space as not belonging to a dlc but to a set of sectors I decide are Pirate Sectors .
Even if I patch the entire actions, it still gives errors.
This the full ORIGINAL <actions></actions>:

Code: Select all

      <actions>
            <find_sector name="$Windfall4Sector" macro="macro.cluster_503_sector001_macro" extension="'ego_dlc_pirate'" comment="Windfall IV"/>
            <find_station name="$AuroraCasino" space="$PirateSectors" godstationentry="'pirate_landmark_02'" required="true"/>
            <set_value name="md.NPC_Instantiation.Instantiation.$DockareaAlliedFactionOverrides.{$AuroraCasino}" exact="[
                       faction.scaleplate, faction.loanshark, faction.argon,
                       faction.antigone, faction.hatikvah, faction.teladi]"/>
            <signal_objects object="player.galaxy" param="'init station'" param2="$AuroraCasino" param3="false"/>
            <!-- Add persistent Casino room -->
            <get_room_definition macro="$CasinoCorridorMacro" doors="$ResultDoors" race="$AuroraCasino.owner.primaryrace" tags="tag.corridor"/>
            <create_dynamic_interior interiorname="$CasinoInterior" corridorname="$CasinoCorridor" roomname="$CasinoRoom" object="$AuroraCasino" room="macro.room_gen_casino_01_macro" corridor="$CasinoCorridorMacro" name="'{20007,1341}'" persistent="true"/>
            <run_actions ref="md.NPC_Instantiation.Add_Casino_Workers">
              <param name="ActorCue" value="this"/>
              <param name="Room" value="$CasinoRoom"/>
            </run_actions>
          </actions>
Last edited by Realspace on Fri, 5. May 23, 09:07, edited 1 time in total.
Realspace
Posts: 1641
Joined: Wed, 15. Nov 06, 10:21
x4

Re: HELP with patching MD of TOA and KE dlcs

Post by Realspace »

Seems I figure it out. The extensions="" is mandatory for some scripts while can be omitted in others. So I filled the tag and redirected it to my mod AND also specified the sector's list where the dlc does not. This makes the engine choose a pool of sectors and go looking in my mod (where all sectors and maps are redone).
This is quite tricky, the dlc has not to specify the sectors when using the tag, the mod has to do otherwise the patch will create a freeze in the mission. And there is no requisite I can see that makes a difference from a script to another, to need the tag or not. Anyway now you know too.
Realspace
Posts: 1641
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Patching MD of TOA and KE dlcs

Post by Realspace »

Update: the issue returns :evil: All TOA missions suffer of inability to find the space when you patch the mission adding a simple

Code: Select all

<set_value name="$PirateSectors" extension="'xrsge'" space="player.galaxy" exact="[macro.cluster_500_sector001_macro, macro.cluster_500_sector002_macro, macro.cluster_500_sector003_macro, macro.cluster_501_sector001_macro, macro.cluster_501_sector002_macro, macro.cluster_502_sector001_macro, macro.cluster_502_sector002_macro, macro.cluster_503_sector001_macro, macro.cluster_503_sector002_macro, macro.cluster_504_sector001_macro]"/>
that defines what Pirate sectors are, disregarding the dlc but using a setup.
Same error occurs, example

Code: Select all

[=ERROR=] 0.00 Error in MD cue md.Setup_DLC_Pirate.SetupS3Station: Invalid space
* Expression: $PirateSectors
* Action: <find_station>, line 49
I also tried this setting:

Code: Select all

<find_sector groupname="$PirateSectors" extension="'xrsge'" multiple="true" macro="[macro.cluster_500_sector001_macro, macro.cluster_500_sector002_macro, macro.cluster_500_sector003_macro, macro.cluster_501_sector001_macro, macro.cluster_501_sector002_macro, macro.cluster_502_sector001_macro, macro.cluster_502_sector002_macro, macro.cluster_503_sector001_macro, macro.cluster_503_sector002_macro, macro.cluster_504_sector001_macro]" />
Same error happens, INVALID SPACE.
Any idea what could be the cause?
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Patching MD of TOA and KE dlcs

Post by DeadAirRT »

From the last post (Just above this one)

First code snippet has macro.cluster_500_sector001 instead of sector.cluster_500_sector001.

From the last post,
Your find_sector is missing space="player.galaxy"

Return to “X4: Foundations - Scripts and Modding”