[TUTORIAL] X Rebirth - Modding Guide

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

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

User avatar
-Skipp-
Posts: 94
Joined: Tue, 7. Oct 14, 10:18
x4

Post by -Skipp- » Tue, 11. Nov 14, 19:03

OK, so i used the X tools to extract the ad dds and the xml file. I edited the dds to my image... now what? where do i put those files?

what if i want to send the mod to my friends? just the ad (for example replacing all ingame ads)?

Do i need to somehow repack all the files used in the mod you linked or can i just send them the dds and the xml i made in a specific folder structrue?

Edit: nvm - i got it :D

I just needed to repack it back again. Works perfectly

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Tue, 11. Nov 14, 22:46

Hello experts. Help please. I want to change part of the code.

Code: Select all

<connection ref="connection_turret_small_mg07">
              <macro ref="turret_small_mg_macro" connection="connection_component01" />
            </connection>
on

Code: Select all

<connection ref="connection_turret_medium_mg07">
              <macro ref="turret_medium_mg_macro" connection="connection_component01" />
            </connection>

How to do it. If not difficult , write a script please.
Many thanks in advance.

its cod

Code: Select all

<connection ref="ConnectionFor_units_size_xl_cs_omicron_center_a">
        <macro>
          <component ref="units_size_xl_cs_omicron_center_a" connection="space" />
          <connections>
            <connection ref="connection_turret_small_mg07">
              <macro ref="turret_small_mg_macro" connection="connection_component01" />
            </connection>
            <connection ref="connection_turret_small_mg08">
              <macro ref="turret_small_mg_macro" connection="connection_component01" />
            </connection>
          </connections>
        </macro>
      </connection>

User avatar
Kaldo
Posts: 126
Joined: Mon, 14. Jan 13, 21:43
x3tc

Post by Kaldo » Sat, 15. Nov 14, 15:34

I want to modify color of the font in the logbook, so profits are marked green, expended money is red, destroyed ships are orange etc.

I unpacked everything but I'm having trouble finding the logbook files. I found a reference to menu_logbook.lua in the detailmonitor.xml, but from what I've read lua scripts are already compiled in the .xpl files. The one of interest to me is the menu_object.xpl.

So basically what I'm asking is... is this even possible, can I modify lua scripts / xpl files or is there a better way of approaching this problem?

I'm a complete newbie in X:R modding, I just read the basic guide but there's nothing there about UI customization. I unpacked all the .cat files but couldn't find anything resembling the logbook creation files either. Any hint is appreciated.

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

Post by Vim Razz » Sat, 15. Nov 14, 19:33

@ alexalsp -

Information for that kind of editing can be found in this guide.

In this example it looks like you want to replace the macro that the connection is pointing to in the file units_size_xl_cs_omicron_ship_02_macro.xml

For this, you'd make a file named units_size_xl_cs_omicron_ship_02_macro.xml in the assets\units\size_xl\Macros folder of your mod that looks something lie:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
<replace sel="//connection[@ref='ConnectionFor_units_size_xl_cs_omicron_center_a'/macro/connections/connection[@ref='connection_turret_small_mg07']/macro[@ref='turret_small_mg_macro']/@ref">turret_medium_mg_macro</replace>
</diff>

@Kaldo -

That sounds pretty tricky. I don't think that logbook entries are very well marked or tagged for making that kind of distinction, so you'd need to come up with a custom system of your own for that, somehow.

Modding Lua menus requires an entirely new menu in place of the old one. You can unpack many of the .xpl files with Night Nord's decompiler -- though as the menu system is being improved in 3.0, it wont open as many of the new files as the old (2.51) ones, unfortunately.

When testing stuff out, you'll want to have your Lua file in a subdirectory off of the main game file rather than in your mod directory or the game wont see it, though when you're done you can pack it in a subst_01.cat/dat in your mod folder.

Information and tutorials for lua can be found online. Regarding font colors, take a look at this thread if you haven't already. The way that ego's display formatting functions handle font colors is changing right now, and we don't have any information on the new options yet.

Expect to take a lot of time looking at menu files to try and figure out how they work, then a lot more time tinkering to try and get what you want. There's no particularly easy direction to point you at for this sort of thing.

Andycaccia
Posts: 1
Joined: Mon, 21. Jun 04, 22:47
x2

region_definitions.xml

Post by Andycaccia » Thu, 20. Nov 14, 23:43

Is this file: region_definitions.xml still used by the game? I one made a mod that changes the respawn speed of natural resources, worked well with 1.24, but stopped since 1.30. Any Clue?

Where should I look for the file controlling resources in game? I'd like them to replenish faster...

User avatar
TheRealBix
Posts: 400
Joined: Thu, 2. Jul 09, 14:34
x4

Post by TheRealBix » Fri, 28. Nov 14, 00:33

Hi there :)
I have some questions for pro coders !

Is there a way to add new wares to the game without requiring a reboot or altering savefiles ?

To fill traders I need to use setup.xml, but it is only used at the game start right ?

that's all for the moment :P

Edit : I've seen a bunch of lines that, I supposed, update the warelist of the NPC for a newer version :

Code: Select all

      <patch sinceversion="2" state="complete">
        <do_if value="$actor.type == entitytype.armsdealer">
          <include_actions ref="md.Setup.SetArmsDealerWares" />
          <set_value name="$TraderDefinition" list="md.$ArmsDealerLists" />
          <clear_list list="$WareList"/>
          <do_all exact="$TraderDefinition.count" counter="$i">
            <add_inventory entity="$actor" ware="$TraderDefinition.{$i}.{1}" min="$TraderDefinition.{$i}.{2}" max="$TraderDefinition.{$i}.{3}" chance="$TraderDefinition.{$i}.{4}" />
            <set_value name="$Price" min="$TraderDefinition.{$i}.{1}.minprice" max="$TraderDefinition.{$i}.{1}.maxprice" />
            <append_to_list name="$WareList" exact="[$TraderDefinition.{$i}.{1}.id, $Price]"/>
          </do_all>
          <remove_value name="$TraderDefinition" />
          <remove_value name="$Price" />
        </do_if>
      </patch>
Is it possible to do the same at the first loaded game with the mod, or the "patch" command is very specific ? (I don't think it's a good idea to reset warelists at each load)

gundamwarcraft
Posts: 10
Joined: Tue, 24. Jun 14, 13:12

Post by gundamwarcraft » Sun, 14. Dec 14, 20:13

ok. im new to this thing. so, how do i extract a mod that was in .dat format? i try to use XRCatTool but it only detect game core file. not the mod that was save in dat format

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

Post by UniTrader » Sun, 14. Dec 14, 20:39

do you mean the official tool from EGO? this works for me fine for both core Files and Mod Files. if its a 3rd party application - no idea, i dont use them since the official program has both, a command line/script interface and a GUI interface

and also note that you need both the .cat and the .dat - either of them alone is useless ;)
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 ;)

gundamwarcraft
Posts: 10
Joined: Tue, 24. Jun 14, 13:12

Post by gundamwarcraft » Sun, 14. Dec 14, 21:05

i want a tool to extract a dat file from a mod. not core files. i have try XRCatTool but that program only detect and extract core files.
any idea which should i use?
i have also try to use steam wokshop tools but for some reason, i was unable to download the workshop tools

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

Post by UniTrader » Sun, 14. Dec 14, 21:38

as i said before [url=steam://install/282160]this here[/url] works fine for me. there is another prgram out there with exactly the same name, but afaik it is restricted to the core files. cannt tell since i never used it.
you will find this Program next to the X Rebirth Folder in a folder called X Rebirth Tools, but the XRCatToolGUI.exe should be saaoicated with .cat files already, so no need to locate it if you just want to extract a single cat/dat ;) (if you want to extract all the core files i would recommend using a script/patch file though - once written it required just a double-click to update all extracted files)
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 ;)

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Mon, 15. Dec 14, 00:54

Please, please, please, please help.

There is code.

Code: Select all

<mdscript name="Setup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="Start" version="12">
      <actions>
  
        <set_value name="md.$EngineUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_engine_bal_mk1, 1, 1, 100],
                    [ware.upg_pla_engine_spe_mk2, 1, 1, 80],
                    [ware.upg_pla_engine_man_mk2, 1, 1, 80],
                    [ware.upg_pla_engine_spe_mk3, 1, 1, 60],
                    [ware.upg_pla_engine_bal_mk3, 1, 1, 60],
                    [ware.upg_pla_engine_man_mk3, 1, 1, 60],
                    [ware.upg_pla_engine_spe_mk4, 1, 1, 40],
                    [ware.upg_pla_engine_bal_mk4, 1, 1, 40],
                    [ware.upg_pla_engine_man_mk4, 1, 1, 40],
                    [ware.upg_pla_engine_spe_mk5, 0, 0, 0],
                    [ware.upg_pla_engine_bal_mk5, 0, 0, 0],
                    [ware.upg_pla_engine_man_mk5, 0, 0, 0]
                ]
            ]
        "/>

I want to replace only three lines

Code: Select all

 
                    [ware.upg_pla_engine_spe_mk5, 1, 1, 100],
                    [ware.upg_pla_engine_bal_mk5, 1, 1, 100],
                    [ware.upg_pla_engine_man_mk5, 1, 1, 100]

how to do it.

Thank you, thank you, thank you.

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

Post by UniTrader » Mon, 15. Dec 14, 02:03

in this case you may be more succesful by setting the Values again.. Tamina asked me something similar lately, will try to adapt it in my head: (logic behind this is tricky, especially the first approach.. if it works dont ask how :D )

Code: Select all

<diff>
<add sel='set_value[@name="md.$EngineUpgradetraderLists"]' pos="after" >
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_spe_mk5, 0, 0, 0]}}.{2}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_spe_mk5, 1, 0, 0]}}.{3}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_spe_mk5, 1, 1, 0]}}.{4}" exact="100" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_bal_mk5, 0, 0, 0]}}.{2}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_bal_mk5, 1, 0, 0]}}.{3}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_bal_mk5, 1, 1, 0]}}.{4}" exact="100" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_man_mk5, 0, 0, 0]}}.{2}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_man_mk5, 1, 0, 0]}}.{3}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{md.$EngineUpgradetraderLists.{1}.{1}.indexof.{[ware.upg_pla_engine_man_mk5, 1, 1, 0]}}.{4}" exact="100" />
</add>
</diff>
other, less dynamic approach if first doesnt work: (uses static index numbers instead of searching the list for the items which you want to change)

Code: Select all

<diff>
<add sel='set_value[@name="md.$EngineUpgradetraderLists"]' pos="after" >
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{10}.{2}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{10}.{3}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{10}.{4}" exact="100" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{11}.{2}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{11}.{3}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{11}.{4}" exact="100" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{12}.{2}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{12}.{3}" exact="1" />
<set_value name="md.$EngineUpgradetraderLists.{1}.{1}.{12}.{4}" exact="100" />
</add>
</diff>
basically this changes the nested Lists right after they are created - not directly what you asked, but it has the same effect ;)

note that modifying this file directly will only change things in a new game since this Script is only executed at this moment once. If you want it to work in an existing Game you have to write a new MDScript which is executed after the Setup.xml finished (just put the things i did in the <add/> node inside the <actions/> node of your new MDScript and find some apporiate <conditions/> for it to trigger after the Setup.xml finished ;)
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 ;)

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Mon, 15. Dec 14, 04:05

Doesn't work. Different ways I tried. Probably easier to replace. ))

MDScript is difficult for me .

I have created a mod Repair Laser . In the new game mod works, but in the old game doesn't work. How to write MDScript to mod don't know.
http://steamcommunity.com/sharedfiles/f ... earchtext=

Maybe if you is not difficult, and you have time , you can write MDScript for mod.

Sorry for my English.

Exavier724
Posts: 118
Joined: Fri, 12. Dec 03, 02:13
x2

Post by Exavier724 » Mon, 29. Dec 14, 22:54

Quick question... Does anyone have the "5. Example mod extension developed for this guide (download here)" that was created for the guide in the original post?

Seems i get a file not found error like it has been deleted from nexusmods

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Tue, 30. Dec 14, 00:55

Exavier724 wrote:Quick question... Does anyone have the "5. Example mod extension developed for this guide (download here)" that was created for the guide in the original post?

Seems i get a file not found error like it has been deleted from nexusmods
The "Example Mod" is available on Steam in two different versions: "Transcend - With Highways" and "Transcend - No Highways". The mod has evolved since this tutorial was written, but all the same code references (and more) still exist. The forum discussion thread is here and the Steam download is here.

Thanks.

Exavier724
Posts: 118
Joined: Fri, 12. Dec 03, 02:13
x2

Post by Exavier724 » Tue, 30. Dec 14, 16:19

Observe wrote:
Exavier724 wrote:Quick question... Does anyone have the "5. Example mod extension developed for this guide (download here)" that was created for the guide in the original post?

Seems i get a file not found error like it has been deleted from nexusmods
The "Example Mod" is available on Steam in two different versions: "Transcend - With Highways" and "Transcend - No Highways". The mod has evolved since this tutorial was written, but all the same code references (and more) still exist. The forum discussion thread is here and the Steam download is here.

Thanks.
Thanks :)
Decided to see if i could sit down and make a single sector playground system for empire building. Just a gate to each cluster, a couple of NPC stations, guard fleets for the gate areas (depending on where the gate leads), and alot of player build space.

So far the thing is functional except for Quotas, Jobs, & Gate Locks (if used during the campaign). :P

EDIT: This is trickier than I thought it was going to be... Though just a cpl tweaks to my highways and I think I got it working. Gates even open properly based on campaign progression :)

Wonder if I should put it up on workshop for ppl who want a crossroads empire building area. Especially now that we have galaxy trader mods.

Still can't seem to get a background other than Albion though. even when I changed all the fields I could find for it.

Sanyokbig
Posts: 31
Joined: Fri, 6. Apr 12, 13:01
x4

Post by Sanyokbig » Thu, 1. Jan 15, 22:19

Hi. Is there any list of all commands describing what they do and what parameters have?

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

Post by UniTrader » Thu, 1. Jan 15, 22:22

what commands you you mean? aiscripts? md? Ingame-commandline?
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 ;)

Sanyokbig
Posts: 31
Joined: Fri, 6. Apr 12, 13:01
x4

Post by Sanyokbig » Thu, 1. Jan 15, 23:15

XML ones. Trying to work with aiscripts. But without command reference like in Arma for example it's kinda hard

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

Post by UniTrader » Thu, 1. Jan 15, 23:23

libraries/aiscripts.xsd and libraries/common.xsd provide all available Commands (best to use them with an autocompleting xml editor like xmlcopyedit; just extract both files and link the aiscripts.xsd like its done in all other script files and autocomplete should work), and if you have trouble with the expressions look into the scriptproperties.html ;)
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 ;)

Post Reply

Return to “X Rebirth - Scripts and Modding”