[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

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

Post by Exavier724 » Tue, 30. Dec 14, 17: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, 23: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: 13928
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Thu, 1. Jan 15, 23: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 » Fri, 2. Jan 15, 00: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: 13928
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Fri, 2. Jan 15, 00: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 ;)

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

Post by Sanyokbig » Fri, 2. Jan 15, 00:57

Thanks, it became a little clearer now

can .xsd files be opened so i can see documentation in formatted view without .xml tags?

About linking, never done it. Should i place them in one folder and define .xsd in header via xsi:noNamespaceSchemaLocation="aiscripts.xsd" or it's fine if .xsd is in one folder and .xml in another like in game catalogs?

And for the scriptproperties.html, where can i find it? :)

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

Post by UniTrader » Fri, 2. Jan 15, 01:51

not sure if there is some xsl file which formats this Info nicely, but i think this may be useful:
http://stackoverflow.com/a/2176503

scriptproperties.html is in the root directory when you extracted your files, but requires some files in the libraries folder to work properly - i would recommend extracting all Game files in a sub-directroy of the Game folder to allow easy access to all files, i have written a short script for that a while ago:

Code: Select all

mkdir "..\X Rebirth\XR_extracted"
XRcatTool.exe -in "..\X Rebirth\01.cat" "..\X Rebirth\02.cat" "..\X Rebirth\03.cat" "..\X Rebirth\04.cat" "..\X Rebirth\05.cat" "..\X Rebirth\06.cat" "..\X Rebirth\07.cat" "..\X Rebirth\08.cat" "..\X Rebirth\09.cat" -out "..\X Rebirth\XR_extracted"
simply put it right next to the XRCatTool.exe from EGO and let it do its magic™ ^^
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 ;)

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

Post by Exavier724 » Fri, 2. Jan 15, 10:39

Is there a way trigger an auto explore on a sector? So that when the game start it reveals the zones, highways, and static objects (stations) as if you had flown there.

Trying to get zones & highways to line up but its a pain having to start a new game (gates don't seem to move otherwise) and fly around discovering everything every time.

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

Post by UniTrader » Fri, 2. Jan 15, 15:22

<set_known/> for any object you might be interested. just use some <find_.../> commands vague enough to returnn all shipe/zones/sectors/stations and then <do_all/>
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 ;)

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

Post by UniTrader » Wed, 7. Jan 15, 03:07

i think its something like
[ 'shieldgenerator' , 100 , 'turret_small_mg' , 100 , 'turret_medium_pe' , 100 ]
similiar to the buildplanlist (numbers here probably define the percentage of installed upgrades since thats how its done with the Upgrade Commands )

if you want to be sure modify the NPC_Architect.xml with

Code: Select all

<add sel="//do_elseif[@value="event.param == &apos;cArch_buildermacrosResult&apos;"]" pos="prepend">
<debug_text text="event.param2.{3}" filter="general" />
</add>
and order some stations with upgrades - expected Format for this list should then appear in the debuglog
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 ;)

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

Post by Exavier724 » Wed, 7. Jan 15, 15:58

lol thanks. I actually realized about an hour after I posted, which is why i deleted my comment, that the station did have guns on it. They just don't show up in the stations details screen they start shooting at you. Guess the NPCs don't need to actually buy turrets for their stations. I can live with that :P

Now I just need to finish up my jobs, name my zones/sectors properly (hate naming things lol), and adjust my gate activation script and I think it will be ready for steam :)

Thanks for your help.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7545
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Sun, 22. Mar 15, 21:08

Hi Observe,

The following nexus link is broken on the first page:
5. Example mod extension developed for this guide (download here)
I'd welcome a new one :)

Regards,
Sparks

kMotion
Posts: 19
Joined: Thu, 9. Apr 15, 16:29
xr

Post by kMotion » Sat, 25. Apr 15, 23:49

Hello every one, I'm new in modding for X Rebirth. Who can say, where I can find tutorials? Where I can find info about global variables, function, arrays, etc in x rebirth? How can I start in modding? Thanks!

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

Post by UniTrader » Sun, 26. Apr 15, 00:11

what kind of Mod do you have in mind? this tuto is primarily for Universe Editing, but there are other kinds of mods, too.. and regarding Script commands: see the previous Posts about aiscript and md - and also the part about extracting the Game 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
wysiwyg
Posts: 584
Joined: Thu, 26. Feb 04, 01:08
x4

Post by wysiwyg » Sun, 26. Apr 15, 00:13

kMotion wrote:Hello every one, I'm new in modding for X Rebirth. Who can say, where I can find tutorials? Where I can find info about global variables, function, arrays, etc in x rebirth? How can I start in modding? Thanks!
Well, this tutorial by observe is a very good starting point. Also the posts stickied at the top of the board have some very good information about such things as publishing to steam, in-game tools, a PDF guide to the Mission Director (MD), etc.

I found studying other people's work was the best way to actually start understanding how it all fits together because you can see the results of the code in-game just by installing the mod.

As far as tools go all you need is a good XML editor such as MS Visual Studio Express (free) and something like notepad++ or Programmer's Notepad if you want to edit Lua files (you could use just either one of those editors but I find VS better for XML as it has tooltip documentation and schema checking built in, NP++ is just a better all round editor for general text based coding such as Lua script IMO)

Once you have an idea what you want to do you should unpack the game's cat/dat files and you'll find that most of the reference documentation is contained within these unpacked files in the form of XML schema files (*.xsd). There is also a very useful file called scriptproperties.html that you can load in a browser that is a useful reference.

If you want to mod the UI then you'll need some knowledge of Lua scripting and, again, study the game's files and use the links in the UI modding sticky as a further guide (The sticky also points to Egosoft's own confluence page with a ton more info on the UI).

Best single bit of advice: Study other modders' work!

Good luck
Wysi :)

Post Reply

Return to “X Rebirth - Scripts and Modding”