Help Modifying Cold Star Paths

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
Zloth2
Posts: 37
Joined: Sat, 7. Jul 18, 17:16

Help Modifying Cold Star Paths

Post by Zloth2 » Mon, 9. Jul 18, 02:48

I think I found what I'm supposed to be modifying but, when I do, nothing seems to happen.

I'm looking at the targetpoints.xml that came out of the ego_dlc_2 directory. According to the Wiki, Cold Star is cluster L. There's two sectors mentioned in its targetpoints: 01 and 03. When I mapped out the points for them both, neither looked a whole lot like Natural Expansion but 1 looked more like it than 3 so I started with that, modifying a path that went along the bottom and looked somewhat like the path my ships were taking.

It looks like this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 

<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > 
	<replace sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][@tags='navpath']/point[@x='57479.3'][@z='14335.9']/@z">-40000</replace>
	<replace sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][@tags='navpath']/point[@x='23084.5'][@z='23084.5']/@z">-40000</replace>
</diff>
It did nothing.

I changed it to a remove.

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 

<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][@tags='navpath']"></remove>
</diff>
Nothing. (I'm not sure if it would remove all the pointlists with the macro name or just the first one?)

I changed 01 to 03. Still nothing. I changed 03 to 03blahblah and checked the debug log. Nothing. Uhoh.

In case my content.xml is behind the issue, here's that as well:

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
<content id="Zloth_CGF" name="Cold Gate Fix" date="2018-07-08" version="1" save="false" enabled="true" author="Zloth"
    description="Moves the southern path in Cold Star's Natural Expansion sector to the south so trader ships don't run off into a Xenon base"> 
 <dependency id="ego_dlc_2" name="Home of Light"></dependency>
</content>
So my questions right now are:
  • Why isn't the error showing up in the debug?
  • What is Natural Expansion's sector number?
  • Is the coordinate system here like the one displayed in the sector maps with positive x, positive z in the upper right?
Any answers appreciated! (Especially accurate ones. ;)

Edit: I noticed the dlc_sectors_2 xml has zones in it. I definitely want to be working with sector 1. Here's what it looks like:
https://drive.google.com/file/d/1G091YD ... sp=sharing
The gold is just lines connecting to each zone. The other colors are the targetpoint paths. The black one is the one I think needs modification. (Apologizes to anyone who's color blind.)

w.evans
Posts: 2954
Joined: Tue, 18. Nov 14, 17:23

Post by w.evans » Mon, 9. Jul 18, 08:45

Hi,

Looks like Cluster_L_Sector01_macro is indeed Natural Expansion.

Code: Select all

<macro name="Cluster_L_Sector01_macro" class="sector">
...
  <properties>
    <identification name="{20004,35}" description="{20004,36}"  owner="terracorp"/>
  </properties>
</macro>

Code: Select all

<page id="20004" title="Sectors" descr="Sector names and texts" voice="yes">
...
 <t id="35">Natural Expansion</t>
</page>
Your first patch should hit. Are you sure you were looking at the right path in-game to verify? There appears to be several.

Second patch, not so much. It'll hit several nodes and the game won't know which node you wanted to change, so it won't apply the patch. A simple way to fix would be:

Code: Select all

<diff>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][1]"/>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][2]"/>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][3]"/>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][4]"/>
</diff>
should remove all of them. That should also enable you to verify if the mod was loaded and the patches are taking effect at all. However, please note that i have not worked with targetpoints, so not sure if this is all that would be required. Looks like it, though.

Re: errors not showing up, that is odd and could be indicative of the mod not being loaded at all. Unfortunately, not enough data to go by. Your content.xml looks ok.

Ezarkal
Posts: 746
Joined: Wed, 22. Apr 15, 02:27

Post by Ezarkal » Mon, 9. Jul 18, 20:10

Here is a mod that does something similar for Fields of Opportunity.

If nothing works, you might want to take a look at what what he did.

https://steamcommunity.com/sharedfiles/ ... earchtext=
"I'm not saying let's go kill all the stupid people...
I'm saying let's remove all the warning labels and let the problem solve itself out."

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13817
Joined: Sun, 20. Nov 05, 23:45

Post by UniTrader » Mon, 9. Jul 18, 23:43

w.evans wrote:

Code: Select all

<diff>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][1]"/>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][2]"/>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][3]"/>
  <remove sel="targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][4]"/>
</diff>

i made a quick test mod with this, but since i dont have a test save at hand and my time today runs out i will just reply here that i am working on that
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Zloth2
Posts: 37
Joined: Sat, 7. Jul 18, 17:16

Post by Zloth2 » Tue, 10. Jul 18, 01:52

w.evans wrote:That should also enable you to verify if the mod was loaded and the patches are taking effect at all.
Yep, that's what I'm after. I definitely wouldn't want to leave it that way or ships would run right through radiation zones and perhaps minefields.
Re: errors not showing up, that is odd and could be indicative of the mod not being loaded at all. Unfortunately, not enough data to go by. Your content.xml looks ok.
Well, I made a folder in extensions called "cold gate fix" which has the content.xml and the code is in a file called RemovePaths.xml in the same directory. If I make a mess in the content.xml then I get errors for sure.

Maybe I'm not actually pointed at the right place for the path?

Well, I'll try removing them one by one. Thanks for the suggestion!

P.S. Yeah, I've seen (and am using) the Avoid FoO. I even posted in that link! It's another option but one that's a good bit more complex.

Edit: UniTrader, here's a recent save of mine. I've been using some mods but none that are supposed to affect save games, I think. (I fired everyone just in case More Crew got unhappy.) There's a freighter right in front of the ship. Send that off to the SE jump gate to see if fixes are working.
https://drive.google.com/open?id=1UHNNc ... 8RyvKjNKcn

w.evans
Posts: 2954
Joined: Tue, 18. Nov 14, 17:23

Post by w.evans » Tue, 10. Jul 18, 19:12

Zloth2 wrote:and the code is in a file called RemovePaths.xml in the same directory.
that's it. the code should be in [yourmod]\libraries\targetpoints.xml

Zloth2
Posts: 37
Joined: Sat, 7. Jul 18, 17:16

Post by Zloth2 » Wed, 11. Jul 18, 03:32

Thanks w.evans, that got error messages showing up!

Unfortunately, it's telling me it can't find the nodes. I tried getting rid of the attribute specifications to just be:
<remove sel="targetpoints/pointlist"/>
hoping that wuld get it to just delete some random pointlist but I still got the no node found error.

The replace version of my script got similar errors. I tried changing my replace to:
<replace sel="targetpoints/pointlist/@z">-40000</replace>
hoping to replace some random point's Z but still got the node not found.

I tried putting library/ on the front of the sel but still nothing. I also tried removing targetpoints from the front, still nothing.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13817
Joined: Sun, 20. Nov 05, 23:45

Post by UniTrader » Wed, 11. Jul 18, 04:00

i missed it initally, but your Paths are missing the initial /
also in case of removal the order/position of nodes changes with every remove action, so to remove multiple you either use descending Order or remove only the (new) first until all are gone
so correctly it should look like this for example:

Code: Select all

<diff>
  <remove sel="/targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][1]"/>
  <remove sel="/targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][1]"/>
  <remove sel="/targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][1]"/>
  <remove sel="/targetpoints/pointlist[@macro='Cluster_L_Sector01_macro'][1]"/>
</diff>

also the XPath must be unique - it will only have an effect if it refers to exactly one Node/Attribute. If it has multiple (or 0) possible matches it will be Ignored (with the Error you mentoined)


And i just confirmed that the Code above works - with this in the libraries/targetpoints.xml the Ships go straight through the Radiation Clouds from Zone to Zone..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Zloth2
Posts: 37
Joined: Sat, 7. Jul 18, 17:16

Post by Zloth2 » Wed, 11. Jul 18, 06:22

That's got it! Now my replace diff works, too!

The line is actually drawn from the Xenon mining station to one of the human stations so I suspect the line may be intended for Xenon to use. I'll play around with it and see if I can negotiate a path that works OK for both.

Many thanks to all!

Zloth2
Posts: 37
Joined: Sat, 7. Jul 18, 17:16

Post by Zloth2 » Sun, 15. Jul 18, 04:18

Workshop item added.

I also removed all the navpaths in Toride. I'm not sure what Egosoft was thinking there - maybe the zone was originally intended to be much more hazardous and the stone areas where the only safe paths? It's certainly a pretty drive going through the rocks but smashing all those ancient, beautiful asteroids.... (Not to mention the difficulty in getting ships, especially small/medium ships, back to civilization.)

Post Reply

Return to “X Rebirth - Scripts and Modding”