Documenting the 'codearray' of the XML X3 script files

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
itegebo
Posts: 3
Joined: Thu, 20. Jun 13, 05:10

Documenting the 'codearray' of the XML X3 script files

Post by itegebo » Fri, 21. Jun 13, 04:18

After a bit of searching, it appears that a few people have attempted to decipher the 'codearray' node in the XML script files (presumably for the purposes of compiler/editor writing). Since there already exist a few external editors, it seems people stop once they find that out.

Undeterred, I continue. In part because I run Linux and don't wish to fiddle with Wine, and also because the currently available editors don't appear to be open source in addition to my not wanting to code in a brand new editor after already being quite competent in another. Lastly, it's just kind of fun.

Anyway, I'm wondering if anyone is actually still interested or otherwise able to post what they know about the 'codearray'. I've spent a good hour or two on it, and have a decent idea about what's going on; it looks like there's pretty much a 1:1 correspondence between a group of svals and "instructions".

The "general expression" instruction is rather hairy, and I don't at all understand the last longer chunk at the end, but I thought I'd ask before I continue. Apologies if this has been beaten to death elsewhere, I just couldn't find much using the forum search.

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Fri, 21. Jun 13, 05:28

Not sure about the code array, but X-Studio is open source (scroll to the bottom of the second post in that link to download the code), and it is written in C.
You could take a look at that if you want to see how it is (de)compiled in that program.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

itegebo
Posts: 3
Joined: Thu, 20. Jun 13, 05:10

Post by itegebo » Fri, 21. Jun 13, 05:59

jack775544,

Thanks for the pointer. I thought I'd checked that one for source, but clearly I missed it. There is a good deal of helpful information in that code base.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Fri, 21. Jun 13, 08:15

Also, Whimsy documented the codearray in his manual for Exscriptor.

itegebo
Posts: 3
Joined: Thu, 20. Jun 13, 05:10

Post by itegebo » Fri, 21. Jun 13, 18:35

DrBullwinkle wrote:Also, Whimsy documented the codearray in his manual for Exscriptor.
You're correct, it's well documented there. Thanks!

To Whimsy,

That was a great read. I definitely appreciate you're having written all that up.

For anyone else, there's another thread about the 'codearray', and Whimsy references it the Exscriptor manual, see here.

Post Reply

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