Requesting Help and Understanding with Scripting and Modding - Please be Kind

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
FortressofRain
Posts: 11
Joined: Tue, 15. Sep 09, 13:15

Requesting Help and Understanding with Scripting and Modding - Please be Kind

Post by FortressofRain » Tue, 15. Sep 09, 13:33

First off hello! I just bough X3TC and have not played any of the previous X3 games. I have always been into space sims and am enjoying myself vastly. I have modded many other games in my life and am by no means computer illiterate, but as always there is a learning curve with games made by different companies and using different hard coding and software.

As such I am trying to gain a basic understanding of how to begin using scripts and mods and how to write them, what the acronyms all mean on this board, and how to use the tools and such that you all have created.

Now first, I have read lots and lots around the board doing my own research and homework. I know a bit about how to use the AL system, at least access it from the game menu, how to enable the script and galaxy editor and have downloaded many of the essential tools for the job:

[BETA] Plugin Manager 2.20 BETA 6
X3 ModManager 0.0.8

I even read how to use them! Well the later anyway. The former didn't come with a readme and so to that end I am stumped.

So far I have unpacked all of the CAT files (backed up my install first, and double backed up the CAT files). Then I deleted the CAT files from my install directory as to not allow them to be used over the new files.

My first question is what are the DAT files compared to the CAT files, what are they used for, and should I delete them if unpacking my game with the intention of editing the unpacked files directly to create my own mod in my main X3 directory (I know enough about modding to be confident in doing so).

My next question is how exactly do I install a downloaded spk script, what does spk stand for (acronym), and how do I activate or use it in the game.

Next can you please explain the difference between regular scripts I'm guessing and AL scripts? I'm assuming that one affects the game globally once while the other is a timed/repeating monitor script that affects the game locally or globally over and over again, which can thus be used to influence ai behavior? I'm not sure so please a re-explanation would be great!

Finally, where can I find a tutorial that explains the code language of the script editor.

My first situation is that I have downloaded "Improved Boarding By Cycrow ; Hotkeys to initiate boarding" and am trying to figure out what to do with the file on my desktop. I have the notion that I should open the plugin manager and drop the file in and install it somehow but a step by step guide would be great.

Also a link with a readme or tutorial for using the plugins manager would be great.

Please remember that I have not played any of the previous games so most of this coding I will pick up quick but is very foreign to me right now.

Respectfully and Thankfully,

Raine

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Tue, 15. Sep 09, 14:35

Welcome FortressofRain,

The Tutorials and Resources is a good starting point:
http://forum.egosoft.com/viewtopic.php?t=216693

As is apricotslices’s guide:
http://forum.egosoft.com/viewtopic.php?t=136357

We all start somewhere and learn something new everyday, backup, have a play and learn from what you break :wink:

LA

eladan
Posts: 7168
Joined: Sat, 7. Jan 06, 16:01
x4

Re: Requesting Help and Understanding with Scripting and Modding - Please be Kind

Post by eladan » Tue, 15. Sep 09, 15:54

FortressofRain wrote:and have downloaded many of the essential tools for the job:

[BETA] Plugin Manager 2.20 BETA 6
X3 ModManager 0.0.8
Don't forget the X3 editor as well, also created by doubleshadow (the same person who created the mod manager)
My first question is what are the DAT files compared to the CAT files, what are they used for, and should I delete them if unpacking my game with the intention of editing the unpacked files directly to create my own mod in my main X3 directory (I know enough about modding to be confident in doing so).
The dat files contain the packed file structure of the game contents. The cat files are a catalogue of the files contained within the dats.

If you're thinking of unpacking all the files, deleting the packed stuff, and editing the files directly, I'd advise against doing so - you're best off editing copies of them and creating either a standard mod loaded from the mod folder, or a 'false patch'. It is, of course, your decision though.
My next question is how exactly do I install a downloaded spk script, what does spk stand for (acronym), and how do I activate or use it in the game.
If you've installed the plugin manager, double clicking the .spk file should be enough to install it. You may need to choose the location of your game folder if the plugin manager doesn't find it though.

If you've enabled the script editor, the script is enabled when it's installed. Depending on the script, there may be specific instructions for using it, so read the readme for the script.
Next can you please explain the difference between regular scripts I'm guessing and AL scripts? I'm assuming that one affects the game globally once while the other is a timed/repeating monitor script that affects the game locally or globally over and over again, which can thus be used to influence ai behavior? I'm not sure so please a re-explanation would be great!
A standard script is, well, a standard script. Basically, it does what you would expect - it runs on request, and goes from start to finish, and exits. Something important to remember with scripts is that generally, they are run locally. What this means is that they are attached to a particular game object. If a script isn't attached to any object, then it runs globally. There isn't any major difference between scripts run globally vs locally except that a locally run script is dependent on the object it's running on - i.e. if the object disappears, so does the script, and there are some shortcut inbuilt vars and stuff for a local script to deal with the object it's running on.

An AL plugin is handled by the AL engine, and is basically a global script which will run at set time intervals that you define. They also have the advantage that they can be turned on or off easily from within the game
Finally, where can I find a tutorial that explains the code language of the script editor.
Download the MSCI manual. It's a bit out of date, having been written for X2, but the framework is still quite recognisable.

For everything else, and to fill in any gaps, visit the tutorials thread as Logain Abler mentioned.

FortressofRain
Posts: 11
Joined: Tue, 15. Sep 09, 13:15

Post by FortressofRain » Tue, 15. Sep 09, 23:24

Thanks for the help.

I already found and read most of those tutorials but I still don't understand everything they are talking about as I don't understand all the technical jargon/language they are using but it was a start.

I am still wondering if I need to unpack the DAT files and delete them, like if they will overwrite my changes I will make in the unpacked CAT files.

This is the first step. Understanding what I need to do with the DAT files.

Secondly, I will eventually repack everything into a mod or "fake patch" but for now its easier to work with the files directly until I become confident with repacking and understanding all of the directories.

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 08:14
x3

Post by doubleshadow » Wed, 16. Sep 09, 08:35

Hi,
first of all I will summarise something for you:

If you want:

* play with scripts, install spk files - then - you don't need to really do anything except enable the script editor

* modify TShips (alter ship stats, add "new" ship) - then - you need X3 Editor 2, X3 ModManager is not required at this point but may be handy, but it's now part of X3E2 anyway.

* create new ship modes or just examine all the game files 'cos you wonder what's inside the hood - then - you need X3 Editor + X3 ModManager - or these days you can just use X3 Editor 2 which can do everything for you.


(the below text was actually written first)

Whether to unpack the game files or not:

It depends on what are you planning to do. Since you are not sure yet. Just unpack them - it wont hurt anyone (but your hard drive ;) ).

Just unpack them into some other directory - "X3 Terran Conflict Unpacked", so you have both the "normal" and "unpacked" game.

But unless you will try to do ship models (3D Max), you won't really need the unpacked files.

Once you start changing the TShips file (that's how *everybody* here started), you just need to know how to create a "false patch" (nothing more than a user created catalog). In X3 TC you don't even need the false patches. You can just save the modified file into the game directory.

FortressofRain
Posts: 11
Joined: Tue, 15. Sep 09, 13:15

Post by FortressofRain » Wed, 16. Sep 09, 08:51

So funny thing. I was reading http://www.moddb.com/members/enenra/dow ... ery-basics , a basic modding guide and I noticed a discrepancy.

I noticed on page 6 and 7 that he first starts by instructing to use the mod manager tool to unload the CAT file but then all other references are to DAT files. This confuses me as to what I actually need to unpack.

If I am unpacking everything into a separate folder (changed my mind and following advice and directions to make repackaging easier later on), do I need to use the tool to unpack both CAT and DAT files?

Basically what I want to learn how to do is first create a custom start (which I already found a great tutorial for, and edit in some scripts, especially the ones that let me by ATF ships, because they are my favorite.

Then I found a few other scripts like the boarding assist one.

So I think I need to unpack the game, mod the start files (2) in the tutorial I found which instructs to unpack the CAT files but mentions nothing about DAT files, and figure out how to install SPK (script files).

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 08:14
x3

Post by doubleshadow » Wed, 16. Sep 09, 10:35

FortressofRain wrote:If I am unpacking everything into a separate folder (changed my mind and following advice and directions to make repackaging easier later on), do I need to use the tool to unpack both CAT and DAT files?
The CAT and DAT always belong together and form a single logical "file". Enenra just made a mistake (or inconsistency) when writing his excellent tutorial.

When someone is speaking about "unpacking 01.cat" and someone else is speaking about "unpacking 01.dat", they are talking about the same thing.

Technically there is no way to open .dat file in ModManager and there are no means to unpack it. You must always work with the .cat file as this is the master.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 16. Sep 09, 10:40

Cat and dat files are a pair u need to use both

Basically the dat file holds all the files appended together
The cat file tells u how to split it

If scripts is what ur looking at doing then u don't need to unpack the files at all

All scripts are done in game

KaZTek
Posts: 282
Joined: Fri, 26. Dec 08, 08:58
x3tc

Post by KaZTek » Wed, 16. Sep 09, 14:20

doubleshadow wrote: If you want:

* play with scripts, install spk files - then - you don't need to really do anything except enable the script editor...
In all actuality, properly written scripts (read: majority that are here on public release) dont even need the activation of the script editor, though some versions of X3R and X3TC require them at odd times...
--

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 16. Sep 09, 17:17

KaZTek wrote:
doubleshadow wrote: If you want:

* play with scripts, install spk files - then - you don't need to really do anything except enable the script editor...
In all actuality, properly written scripts (read: majority that are here on public release) dont even need the activation of the script editor, though some versions of X3R and X3TC require them at odd times...
thats quite false actually.

if the scripts is properly written, and is just a script, then it should need you to activate the script editor in your save game for them to load.

however, alot of scripts use EMP, as its a mod loaded as well, it can put the game into modified mod, as can a few other things

some scripts, do work without enablign the script editor, ie naming a script with a !, which shouldn't really be done. As this exploits the script engine and forces players into modified mode weather they want it or not

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Wed, 16. Sep 09, 18:35

Cycrow wrote:some scripts, do work without enablign the script editor, ie naming a script with a !, which shouldn't really be done. As this exploits the script engine and forces players into modified mode weather they want it or not
That's what scripters do when they are sick and tired of explaining how to activate the script editor. =P
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 17. Sep 09, 03:05

Have you read my Modding 101 guide ?

DONT touch the game cat/dats.

Create a modding directory, then a sub directory called the number of each cat/dat, and unpack the cat/dats into those directories.

When you look at them, you find certain things in the first 4 cat/dats, which are the original game. 5 to 8 are patches to the game. The same files show up, but the file in the3 latter cat/dat overrides the earlier file number.

Mods are built of cat/dat file as well, using modmanager. A mod gets put in the /mods directory (which needs creating the first time), and overrides all numbered cat/dats.

Hence, we extract the files we need from the game numbered cat/dats, we edit them somewhere outside the game directory structure (and outside the extracted directories as well, so the original game remains intact), we assemble a new mod cat/dat files and place that in the mods directory. On the jump off screen, you then select the mod, and everything in the mod overrides the originals.

Files like tships can be in multiple cat/dats, so you always use the one in the highest number you can find, as that is the latest.

Inside your mod cat/dat, you need to include the full directory path as you add the file, so pay attention to where you got it from.

You can for quick testing just add he directories under the TC directory in your game and put test files in there, and they will override the game and any active mod. But its messy and not recommended.

FortressofRain
Posts: 11
Joined: Tue, 15. Sep 09, 13:15

Post by FortressofRain » Thu, 17. Sep 09, 03:55

Actually I did read it and was still a little confused. I was reading the other mod guide as yours seemed to be addressing an advanced or knowledgeable audience.

But I thank you for you post. It was most beneficial in helping my understand what to do. Mainly to create a mod folder (which i already did), and then create a sub-folder for each CAT and DAT to work with.

You also in a round about way answered my questions that, yes, I do need to unpack both the CAT and DAT files. Please correct me if I am wrong.

My knowledge base is growing fast, and I am now ready to start unpacking and modding things.

I'll learn about scripting shortly.

I also downloaded the new PM Lite (Beta 3) and am familiar with most products and tools available, which is the first part of my education.

Now I am going to try to start learning the ins and outs of modding, beginning with a simple mod of creating a custom start.

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 17. Sep 09, 04:00

Think of cat and dat as a single entity in 2 parts.

In programs like modmanager, you will only ever see the name of the file, not the cat or dat part, as it accesses both.

The only thing you need is awareness that there are 2 files, and the both need to be identically named, with only the extension different.

FortressofRain
Posts: 11
Joined: Tue, 15. Sep 09, 13:15

Post by FortressofRain » Thu, 17. Sep 09, 04:09

So, what you are saying is that the content in both is identical, but they work together, the CAT to identify the files and the DAT containing the information.

In order to begin modding the game I'd only need to unpack the CAT file?

Then when I repackage my files to a CAT, I'd copy and past the Cat file, go to rename and rename the extension and place both in my mod folder as a fake patch?

The bottom line is, do I need to use mod manager to unpack the CAT, DAT or both to have access to the files I need?

From what you stated, I take it either or is fine but not both correct (if I unpack both they would completely overwrite each other as they contain the same files)?

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 17. Sep 09, 04:11

No, they are 1 file in 2 parts.

All the programs access them as a single entity.

When you create a mod, you specify the name and modmanager creates the 2 files.

All you need to know is you need both files for it to work.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”