[Help] Changing HQ Sector in XML

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

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

User avatar
Snowfious
Posts: 45
Joined: Wed, 26. Jun 19, 00:49
x4

[Help] Changing HQ Sector in XML

Post by Snowfious »

Looking at various mod authors code, and especially the alt starts you can play, when changing the sector and position of HQ, I've seen people use the "diff" code, looking like this:

This is the code to select:

Code: Select all

<find_sector name="$HQSector" macro="macro.Cluster_01_Sector002_macro"/>
What I'm having difficulty finding (even from referencing from others code) on how to select the "macro" from above, when the referencing I can find online of code that is:

Code: Select all

<replace sel="//mdscript[@name='X4Ep1_Mentor_Subscriptions']/cues/cue[@name='Start']/actions/find_sector[@name='$HQSector']" </replace>
How would I go about being able to include the "macro" in the code above to be something else like: "macro.Cluster_11_Sector001_macro"? (Pontifex's Claim) Essentially just changing the sector from the actual game files (which would be Grand Exchange)

For referencing, the map data is in libraries/mapdefaults.xml and the HQ is in md/X4ep1_mentor_subscription.xml
TheDeliveryMan
Posts: 877
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [Help] Changing HQ Sector in XML

Post by TheDeliveryMan »

About a year ago I experimented with a different HQ location as well. The md/X4ep1_mentor_subscription.xml I found on my hard drive looks like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <replace sel="/mdscript/cues/cue[@name='Start']/actions/find_sector[@name='$HQSector']" >
    <find_sector name="$HQSector" macro="macro.cluster_04_sector001_macro"/>
  </replace>
</diff>
Haven't tested if this still works.
User avatar
Snowfious
Posts: 45
Joined: Wed, 26. Jun 19, 00:49
x4

Re: [Help] Changing HQ Sector in XML

Post by Snowfious »

TheDeliveryMan wrote: Sun, 3. Jan 21, 00:40 About a year ago I experimented with a different HQ location as well. The md/X4ep1_mentor_subscription.xml I found on my hard drive looks like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <replace sel="/mdscript/cues/cue[@name='Start']/actions/find_sector[@name='$HQSector']" >
    <find_sector name="$HQSector" macro="macro.cluster_04_sector001_macro"/>
  </replace>
</diff>
Haven't tested if this still works.
Hey thanks for this, it gave me a good referencing meaning I didn't have to reference the "macro" part, just the "name" part and you create a whole new 'find_sector name', and you're good to go.

Not sure if yours works, but I referenced someone else's code where their "start" mod actually works out there (unlike most that are outdated), and their code went like this:

Code: Select all

//mdscript[@name='X4Ep1_Mentor_Subscriptions']/cues/cue[@name='Start']/actions/find_sector[@name='$HQSector']


And everything works. So yes, you can say it still works.

Return to “X4: Foundations - Scripts and Modding”