[Help] Change Starting Station

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

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

Post Reply
user1679
Posts: 795
Joined: Fri, 20. Jul 18, 23:20

[Help] Change Starting Station

Post by user1679 » Mon, 10. Aug 20, 03:51

I created a very basic gamestart with a stripped down ship and no money. I used an existing start so it currently starts me on a very busy Argon dock. I would like to move the start to a lesser-known, quiet station but I can't find the proper macro to use in the gamestart file.

Specifically, I need to find these:

Code: Select all

<location galaxy="xu_ep2_universe_macro" zone="zone002_cluster_06_sector001_macro" room="dockingbay_arg_s_01_macro" station="station_gen_factory_base_01_macro" equipmentdock="true">
I tried flying to the dock I'm interested in (Teladi space) and saving the game but there is no useful information I could find in the save. I also looked at the modding tutorial which suggested taking a "picture" of the location because that would create a text file (xml?) with the info needed. This also didn't work, all I get is a JPG. Finally, I've googled for several hours looking to see if there are any console commands or other such debugging tools that could show me this information in-game. No luck there either.

So, if I want to start my pilot in some out-of-the-way station, how do I find the necessary macro items to use?


Thanks!

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

Re: [Help] Change Starting Station

Post by UniTrader » Mon, 10. Aug 20, 10:42

you can use Rogues Site ( roguey.co.uk - check the url when looking at the map) to get the Zone (and Sector) Macros.
The station= will be pretty much always the same, except maybe for a few unique stations (they alll share the same macro), but you could try one of these:
<xs:enumeration value="tradestation" />
<xs:enumeration value="shipyard" />
<xs:enumeration value="wharf" />
<xs:enumeration value="equipmentdock" />
<xs:enumeration value="defencestation" />
<xs:enumeration value="piratebase" />
<xs:enumeration value="headquarters" />
instead of equipmentdock for the station type, Not sure how the game handles the case of no Station of the specified type in the selected Zone, so it might help to use a sector= as start location instead


PS check the gamestarts.xsd from the game files - it defines what is possible in the gamestarts file and how its structured, including stuff not (yet) used in vanilla
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 ;)

user1679
Posts: 795
Joined: Fri, 20. Jul 18, 23:20

Re: [Help] Change Starting Station

Post by user1679 » Tue, 11. Aug 20, 03:55

Thanks for the tip, gamestarts.xsd is where I got the basis for my custom start.

This is what the spawn data in my actual 'gamestart' looks like (minus the ship layout):

Code: Select all

            <location galaxy="xu_ep2_universe_macro" zone="zone002_cluster_06_sector001_macro" room="dockingbay_arg_s_01_macro" station="station_gen_factory_base_01_macro" equipmentdock="true">
              <player>
                <position x="-2.5" y="1.7" z="21" />
                <rotation yaw="145" pitch="0" roll="0" />
              </player>
            </location>
Notice the "position" entries which I forgot to mention in my OP. This spawns my player on an Argon Equipment Dock with my ship docked right next to me.

Let's say for example I want to start in Bright Promise (cluster_09_sector001_macro - by Roguey's siet) on the station equipmentdock_teladi_01. I still don't know how to determine the macro for the "room" or the values to use for "position" so I actually spawn on the dock and not in space. This information doesn't get saved directly to the save file but instead it looks like:

Code: Select all

<player name="Kaelana Amnell" location="{20005,7029}" money="5000"/>
**Note: the above is not a save for Bright Promise, it is to illustrate that coordinates are not saved to the file.

I tried this but after the loading timer gets to 100%, the game drops me back on the main menu screen:

Code: Select all

            <location galaxy="xu_ep2_universe_macro" zone="cluster_34_sector001_macro" room="" station="wharf_teladi_01" equipmentdock="false">
            </location>
So at least some of that spawn info is required...



Thanks again for your help!

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

Re: [Help] Change Starting Station

Post by UniTrader » Tue, 11. Aug 20, 20:03

UniTrader wrote:
Mon, 10. Aug 20, 10:42
The station= will be pretty much always the same, except maybe for a few unique stations (they alll share the same macro),
^^ already said that macro is always the same, with a few exceptions you can count on one hand probably.

also here a quickly hacked together md script for you:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<mdscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="LogRoom" xsi:noNamespaceSchemaLocation="http://utnas/~unitrader/XRebirthxsds/md.xsd">
  <cues>
    <cue name="LogRoom" instantiate="true">
      <conditions>
        <event_player_activated_external_view/>
      </conditions>
      <actions>
        <debug_to_file name="'Positions.csv'" text="'%1,%2,%3,%4,%5,%6'.[player.sector.macro.id,player.zone.macro.id,player.object.macro.id,player.room.macro.id,player.entity.position,player.entity.rotation]"/>
      </actions>
    </cue>
    <cue name="LogRoomInit">
      <actions>
        <debug_to_file name="'Positions.csv'" text="'%1,%2,%3,%4,%5,%6'.['sector','zone','object','room','position','rotation']"/>
      </actions>
    </cue>
   </cues>
</mdscript>
Put this in an md file, add "-scriptlogfiles" to your start parameters, and every time you switch to external view it will log sector, zone, object(station) and room macro names, and also your current position and rotation in the room and store it into a Postitions.csv
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 ;)

user1679
Posts: 795
Joined: Fri, 20. Jul 18, 23:20

Re: [Help] Change Starting Station

Post by user1679 » Wed, 12. Aug 20, 00:55

UniTrader wrote:
Tue, 11. Aug 20, 20:03
UniTrader wrote:
Mon, 10. Aug 20, 10:42
The station= will be pretty much always the same, except maybe for a few unique stations (they alll share the same macro),
^^ already said that macro is always the same, with a few exceptions you can count on one hand probably.

also here a quickly hacked together md script for you:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<mdscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="LogRoom" xsi:noNamespaceSchemaLocation="http://utnas/~unitrader/XRebirthxsds/md.xsd">
  <cues>
    <cue name="LogRoom" instantiate="true">
      <conditions>
        <event_player_activated_external_view/>
      </conditions>
      <actions>
        <debug_to_file name="'Positions.csv'" text="'%1,%2,%3,%4,%5,%6'.[player.sector.macro.id,player.zone.macro.id,player.object.macro.id,player.room.macro.id,player.entity.position,player.entity.rotation]"/>
      </actions>
    </cue>
    <cue name="LogRoomInit">
      <actions>
        <debug_to_file name="'Positions.csv'" text="'%1,%2,%3,%4,%5,%6'.['sector','zone','object','room','position','rotation']"/>
      </actions>
    </cue>
   </cues>
</mdscript>
Put this in an md file, add "-scriptlogfiles" to your start parameters, and every time you switch to external view it will log sector, zone, object(station) and room macro names, and also your current position and rotation in the room and store it into a Postitions.csv
Thank you for the script, that is what I was looking for.

Where can I learn to write those? I am a C++ programmer who used to program VB 5 and 6 so learning new languages isn't difficult. I just have a hard time finding resources and examples for X4. I looked at the tutorials section and references here but many of them are "just do xyz" but don't explain how or why.

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

Re: [Help] Change Starting Station

Post by UniTrader » Wed, 12. Aug 20, 16:06

all valid xml commands are defined in the aiscripts.xsd and md.xsd (depends which one of both you write), and both include the common.xsd for shared commands. For expressions in these commands refer to the scriptproperties.html (use it from a webserver for proper viewing, don't forget to also give it the libraries directory - or check the related xml file directly)


note: I refer to the extracted files. all mentioned stuff is packed in the cats/dats usually and can be extracted with eg egos cat tools
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 ;)

user1679
Posts: 795
Joined: Fri, 20. Jul 18, 23:20

Re: [Help] Change Starting Station

Post by user1679 » Fri, 14. Aug 20, 00:28

UniTrader wrote:
Wed, 12. Aug 20, 16:06
all valid xml commands are defined in the aiscripts.xsd and md.xsd (depends which one of both you write), and both include the common.xsd for shared commands. For expressions in these commands refer to the scriptproperties.html (use it from a webserver for proper viewing, don't forget to also give it the libraries directory - or check the related xml file directly)


note: I refer to the extracted files. all mentioned stuff is packed in the cats/dats usually and can be extracted with eg egos cat tools
Thanks!

Post Reply

Return to “X4: Foundations - Scripts and Modding”