How do you write your scripts?

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
terodil
Posts: 149
Joined: Sat, 12. Aug 17, 22:13
x4

How do you write your scripts?

Post by terodil » Wed, 1. May 19, 00:19

Hi good folks,

first off, I'm immensely grateful for the way Egosoft opens up their games for modding. The scripting possibilities are wonderful and immense, and it's a welcome fresh breath of air especially nowadays when it seems that almost every game developer/publisher is out to squeeze a few bucks out of 'DLC', which generally goes hand-in-hand with extreme efforts to obfuscate or even encrypt games to prevent modders from doing their stuff. So thanks, and kudos, Egosoft.

That said, I really have difficulty becoming friends with the built-in script editor. It just feels so cumbersome to click through everything when it'd take me a fraction of the time to just type what I want the script to do.

So, how do you edit your scripts? Is it just a lack of practice on my part that makes the internal editor so slow? Is there a way to import raw code into the internal editor, or is it possible to enable a 'type your code' mode somehow?

The reason I'm asking is that up to today, I was pretty happy using X-Studio for my scripting needs -- t-file manipulation and the script editor were wonderful to use... until I ran into a severe bug with data types [1]. From what I have read, X-Studio 2 never made it out of beta and seems less powerful than X-Studio 1 (?). Are there any other alternatives out there for scripting X3TC/AP?

Best,
-t.

[1] Edit: SirNukes just pointed out that the bug (compilation of Datatype symbols into wrong codes) is somewhat easily rectified by patching the compiled files. Still, I'd be interested in hearing from more experienced modders. I just can't fathom writing the likes of CODEA in the internal editor.
My X3 mods: Ship Autoclaimer - Ship Services - Friendlier War Sectors - in development: Logistics Centre

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Re: How do you write your scripts?

Post by X2-Illuminatus » Wed, 1. May 19, 10:42

The Exscriptor is the only other available external Script Editor besides mr.bear's X-Studio 1 and 2 I'm aware of. Exscriptor was originally written for use with X3R, but as it loads gamefiles to read in the commands in should work with X3TC/AP, as well. It has less features than X-Studio though, whereby I don't know whether this matters for you. I remember there was also another external Script Editor by a Russian developer (I think), but I don't have any more info about it.

As for your datatype bug, depending on its severity, you could check whether there's a way around it. Instead of checking for the datatype of objects, you could also compare their maintypes and subtypes, which define all objects in the game.
terodil wrote:
Wed, 1. May 19, 00:19
So, how do you edit your scripts? Is it just a lack of practice on my part that makes the internal editor so slow? Is there a way to import raw code into the internal editor, or is it possible to enable a 'type your code' mode somehow?
If you are used to write code (in whatever programming or scripting language) in a proper IDE, then creating code in the ingame Script Editor is certainly something different. There's no 'type your code' mode, and importing 'raw code' is not possible either. (Besides, the readable part of a script file is not the actual code, but just meant for the browser view of the script.)
One of the reasons why writing code is so slow are the interface limitations of the editor. The other is indeed your lack of practice with it. As with any programming / scripting language, once you know the commands, how they work together and what input values they require - and most importantly where to find them - writing code will be easier and faster. (The MSCI reference can help with the "where to find the command" issue, whereby it misses the X3AP commands.) Of course, once you know all that, writing code in an external SE will still be faster.

The biggest advantage of the ingame SE is certainly that you can test your code right away. For beginners (without or with only limited coding exerience) it's presumably also easier to get into scripting due to its accessibility and you can easily 'hack' your first lines of code together.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Post Reply

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