[MOD] BiM - Build in Maelstrom

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

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

Post Reply
csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

[MOD] BiM - Build in Maelstrom

Post by csaba » Wed, 4. Dec 13, 13:20

BiM - Build in Maelstrom


A simple mod that adds 12 station build Locations to Sigma Sector in Maelstrom.

To install:

Always backup your saves before installing mods!

Extract the files to your X-Rebirth extensions folder usually:

Steam\steamapps\commonX\Rebirthextensions

download at:

[ external image ]

To uninstall:
Remove the files from the extensions folder. Will not break save files as far as I tested.


The locations are relatively far away from other entities such as Highways or the single station in the Sector so you don't end up with collisions when building. If you have such problems leave me a note here in the posts.


FAQ and tips:

Can I remove this mod without ruining my save files?
Yes you can. A lot of scenarios were tested in this regard as for now it seems it's a safe mod in that aspect. But as always make a backup of your save files before attempting to use this mod.

Additionally stations already under construction or finished/extended stations stay in the zone after removal.

Weren't there already build locations in Maelstrom?
There is none to my knowledge. I found a code for one in Inviting colossus but couldn't see it in game.

Are my other mods compatible with this one?
Any mod that changes entities inside zones can have an affect on this one as well as they change the same zones.xml file. In theory only mods that affect build nodes should be incompatible but be safe and make a backup first if you have mods like "no stardust" "remove highways" etc.

Aren't Xenon's a big threat?
Yes they are, make sure to clear the sector before attempting to build anything as a Branch 9 makes short work of your freighters. Xenon should periodically appear in the sector but as far as I can tell when out of sector your assets are realtively safe after the sector is cleared. However keep some guard ships assigned to the stations like Balor's and Taranis's.

There are not much of resources to do anything :/, what should I build?
It's is true that only hydrogen and icee are available in the first 2 sectors and Sable Vortex the home sector of the Xenons is pretty hostile while having everything else expect ions and plasma. In the Xenon sector you can clear a zone then set a miner to mine while you are out in the other zones to clear some more enemies or you can just mine in Omicron safely and when full send the ships to your stations to unload. Do not set the station Managers to manage the full system as they might send their miners right on top of the Xenon keep them locked to the Sigma Sector.

An alternative is to go down the water/spice/spaceweed/spacefuel/narcotics/medical supplies route which will only require water/energy and wheat. Wheat is available at the station at the jumpgate. Remember that Spaceweed and Spacefuel are illegal wares.

Any known bugs?
Theres one I know of when you don't get build nodes if right after mod installation you Load in the same sector they should be in. Workaround: leave and renter zone or dock undock a capital ship.

Will NPC traders come to my stations?
Yes and No. There are some inside the Sector but the Galaxy wide trade is set off by default in the game so most ships don't trade across systems. I might make an add-on for this later allowing ships to trade across systems but it might make the mod unremovable from the extensions folder without breaking your save files.

Wont the build positions collide with other entities causing bugs?
It's possible I set all the nodes to be relatively far away from entities like Highways but just the sheer scale of some of the stations might cause some bugs. I couldn't test them all in all locations. If you get one give me a notice and I'll change the node's position. Always check after you order your station if it would fit if you can already see your station wont fit cancel the build order right away.

Wait if you change the build node's position how will that affect my already built stations?
It wont affect stations you'll get a new node inside your zone. If I implement new nodes I'll try to make them so they wont collide with old stations built there.


[ external image ]

Old Original Post so the first few posts make sense:
Anyone knows where can I hack my save files to have build locations in certain zones? I can't seem to find them.

I'd really love some stations in those hidden zones. Which are otherwise... empty... \o/
:(
Last edited by csaba on Fri, 6. Dec 13, 22:36, edited 34 times in total.

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Wed, 4. Dec 13, 13:41

You don't hack the save files to add build spots, you patch the map files.

\maps\XU_ep1_universe\zones.xml

search for "buildcon" to see how they're formatted.

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Wed, 4. Dec 13, 14:13

Vim Razz wrote:You don't hack the save files to add build spots, you patch the map files.

\maps\XU_ep1_universe\zones.xml

search for "buildcon" to see how they're formatted.
Thanks I'll check that out. :thumb_up:

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Thu, 5. Dec 13, 00:24

Testing.

Added this line to extensions/modtest/maps/XU_ep1_universe/zones.xml:

Code: Select all

<diff>
  <add sel="/macros/macro[@name='tzoneCluster_A_Sector01_Zone95_macro']/connections">
       <connection ref="buildcon1">
        <offset>
           <position x="0" y="3441.40625" z="0" />
        </offset>
      </connection>    
  </add>
</diff>
It puts a build position directly on top of the Jump Beacon in Maelstrom/Sigma Sector/Aged Ductwork. Success! :D

I didn't actually build there as I don't have time but the Architect contacted me as usual with the build plans.

I'm still getting used to the position numbers, distances and trying to figure out which zones is which macro but I'm starting to get the hang of it.

Thanks for the pointers Vim Razz :mrgreen:

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Thu, 5. Dec 13, 01:51

np, and grats! :D

User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph » Thu, 5. Dec 13, 06:39

Do either of you know how to get your current ships coordinates/location so it would be easier to mod those?

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Thu, 5. Dec 13, 09:16

umm.... One way to do it might be to open up a savegame file and search for the component macro="unit_player_ship_macro" (the skunk) then look a few lines down for the offset position of that component.

I think that should give you the coordinates of the skunk relative to the zone it's in at the time you made the save. I'm not 100% sure, though.

I'm getting a little too tired to figure out a way to test it tonight. Maybe someone can correct me if I'm wrong, or I'll find some way to test it tomorrow.

Or maybe someone has a better way of finding the info that they might share. :)

monze
Posts: 88
Joined: Fri, 8. Aug 03, 23:13
x4

Post by monze » Thu, 5. Dec 13, 09:40

I'm watching these posts with interest. Not knowing the first thing about modding, ( all I can do is trial and error with the save game files) I really want to learn how to place these "nodes". :)

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Thu, 5. Dec 13, 13:26

monze wrote:I'm watching these posts with interest. Not knowing the first thing about modding, ( all I can do is trial and error with the save game files) I really want to learn how to place these "nodes". :)

Actually it is not that hard. I am no coder myself. My profession is chemical engineer so quite far from it.

Following Vim Razz's Tip I read the Modding Guide on this forum downloaded the example mod and the CAT extractor and use notepad++ to edit the files.


Warning the following code patches the map file. Save files made with this change in the game wont load without it!

Update save="false" fixes this problem. Still testing some scenarios where it still might.

You create a mod folder with a name you like and put it into extensions

so: extensions/randommod89/

Then create a maps folder:

estensions/randommod89/maps/

Then the XU_ep1_universe folder

So the path should be:
Steam\steamapps\common\X Rebirth\extensions\randommod89\maps\XU_ep1_universe\

This is a clone of the root file path inside the CAT files. Every time the game launches will check the extensions for these clones and compare them to the root files.

Inside this folder you make an XML file named zones. I copy pasted another XML file from the game directory then renamed it to zones.xml and deleted it's content but I'm pretty sure it works with a .txt renamed to .xml.

Now the coding step by step.

Code: Select all

<diff>
  <add sel="/macros/macro[@name='tzoneCluster_A_Sector01_Zone95_macro']/connections">
       <connection ref="buildcon1">
        <offset>
           <position x="0" y="3441.40625" z="0" />
        </offset>
      </connection>   
  </add>
</diff> 
Line 1:
<diff>

This will make the game on launch search under this line for differences between it's own/root zones.xml file.

Line 2:
<add sel="/macros/macro[@name='tzoneCluster_A_Sector01_Zone95_macro']/connections">

add sel="macros/macro means adding some extra to a macro here

[@name=''] is where the macro for the zone goes. Which is tzoneCluster_A_Sector01_Zone95_macro' for Aged Ductwork.
/connections will determine that we ad entities (stations, nods, etc) to the macro.

You can search for the macros names in the original/root zones.xml which you need to extract from the games .CAT files. Cluster A is Maelstrom Sector01 is Sigma Sector. Zones can be identified by the <map index="6" /> Each zone has a number in the sector map in game. That's how I found Aged Ductwork as it has the number 6 on the sector map. This is actually the longest thing you have to do.

Line 3:
<connection ref="buildcon1">

Connection means a new item in the zones. Like stations, highways, Jumpgates, and other stuff. "buildcon1" is the macro for the building nods. But you could put a station macro there and that would appear there.

line 4:
<offset>
This calls for coordinates I think.

line 5:

<position x="0" y="0" z="0" />

Self explanatory. X and Z are the horizontal coordinates and Y stands for the Vertical coordinates. 0,0,0 is the middle of the zones. (Yes thankfully zones have their own inner coordinates. You don't have to first look for the zones position in the Sector to determine it's center coordinates.)

Putting in numbers gives you distances in meters. See my example at the end of the post.

line 6:
</offset>
close search for position

line 7:
</connection>
close search for entity

line 8:
</add>
close search for addons

line 9:
</diff>
close search for differences between the root and the mod xml.

Example code:

Code: Select all

<diff>
  <add sel="/macros/macro[@name='tzoneCluster_A_Sector01_Zone95_macro']/connections">
       <connection ref="buildcon1">
        <offset>
           <position x="0" y="-10000" z="0" />
        </offset>
      </connection>    
	  <connection ref="buildcon2">
        <offset>
           <position x="0" y="10000" z="0" />
        </offset>
      </connection>    
  </add>
</diff>
y="-10000" puts buildcon1 10km under the middle of the zone
y="10000" puts buildcon2 10km above the middle of the zone

in game:
See as I'm right next to the y=10000 nod which is 10km above the middle the other one which is 10 under is 20km in total away from me.
[ external image ]


I do have a question though:

How can I flag this so I can uninstall without breaking my save files? Looking for that infamous save="false" line.
Last edited by csaba on Thu, 5. Dec 13, 20:58, edited 7 times in total.

monze
Posts: 88
Joined: Fri, 8. Aug 03, 23:13
x4

Post by monze » Thu, 5. Dec 13, 14:05

That's very detailed and very well layed out... many thanks.. Now to get my little brain into gear :)

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Thu, 5. Dec 13, 14:15

monze wrote:That's very detailed and very well layed out... many thanks.. Now to get my little brain into gear :)

LoL surprised you could read it before I edited my grammar. English fails me sometimes. Gotta work now, will check back later.

edit:

Thought I make a picture of the actual file opened in Notepad++.:

[ external image ]

high res:
http://img27.imageshack.us/img27/2513/sj4a.jpg

I kept Observe's modname (osr_universe) for mine from the Guide mod. (for now)
Last edited by csaba on Thu, 5. Dec 13, 19:41, edited 1 time in total.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 5. Dec 13, 17:31

csaba wrote:How can I flag this so I can uninstall without breaking my save files? Looking for that infamous save="false" line.
content.xml of your mod. but be sure it does really load again without this extension - will all possible states of a station. (not existent, building, built 1st step, completely built) - if this does not work do not put that attribute in.

more to that in the pinned Modding Guide from Observe ;)
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 ;)

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Thu, 5. Dec 13, 19:21

UniTrader wrote:
csaba wrote:How can I flag this so I can uninstall without breaking my save files? Looking for that infamous save="false" line.
content.xml of your mod. but be sure it does really load again without this extension - will all possible states of a station. (not existent, building, built 1st step, completely built) - if this does not work do not put that attribute in.

more to that in the pinned Modding Guide from Observe ;)
Thank you!

save="false" added

Performed Tests:

Mod set OFF or removed from extensions folder:

- With nothing built:
- Loads normally no crashes.

- While station is waiting to be Built (resources not yet provided):
- Loads normally no crashes.

- While station is being Built (resources already provided):
- Loads normally no crashes.

- While Station stage 1 is complete and doing production.
- Loads normally. Station stays intact. Production untouched.

- Uninstalling then reinstalling the mod wont cause a build node to appear in the already built station.


- While station is fully upgraded
- Loads normally. Station stays intact. Production untouched.


Possible bugs:
Nods don't appear after loading into the same zone. Workaround:Leave zone then reenter or have a capital ship there and dock/undock.

Note:
I don't have much time so don't expect a Mod out of this soon. :( I'll try to make a basic one by the weekend with 1-2 build nods in the hidden zones of Maelstrom/Sigma Sector Deceptive Dead End and Imminent Mischief and maybe 2 in a zone with Highways.

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Fri, 6. Dec 13, 20:21

[MOD] BiM - Build in Maelstrom released. Have fun!

monze
Posts: 88
Joined: Fri, 8. Aug 03, 23:13
x4

Post by monze » Sat, 7. Dec 13, 00:25

Excellent.. Gracias. Makes life easier

User avatar
Baconnaise
Posts: 619
Joined: Sat, 23. Nov 13, 15:50
x4

Post by Baconnaise » Sat, 7. Dec 13, 01:11

This is amazing.

Thanks!

csaba
Posts: 1251
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba » Wed, 11. Dec 13, 10:33

Hey there, little update

I'm quite busy irl at the moment so any updates are postponed till January. I'm thinking to add more build points to the other 2 sectors for the venturous people or those who try to domesticate the Xenon. Also some minable resources in a small quantity outside Sable Vortex so you don't only get water and hydrogen.

I'm working around Christmas as well (God bless Capitalism! -.- ) and what little time I've got left there will go towards social life.

For now the mod seems to be stable on 1.19.

Cheers
Csaba

Jannik2099
Posts: 44
Joined: Thu, 25. Jul 13, 14:40
x3ap

Post by Jannik2099 » Wed, 19. Feb 14, 14:07

The first location in malstrom... The build place is way too close to the food station, pls inscrease the distance

Post Reply

Return to “X Rebirth - Scripts and Modding”