[PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

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
nekoexmachina
Posts: 58
Joined: Thu, 3. Apr 14, 12:51
x4

Post by nekoexmachina » Sun, 10. Jan 16, 21:07

Any linux guys have a fix for this: http://imgur.com/yZrCaxX ?
P.s.
Does game actually requires every item to be in <xml tags>? I hate this and I only use wine/x-studio due to this strange thing in scripts. Can I code scripts without XML? It's a pain to write XML by-hand in VIM, which I usually use for everything.

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

Post by X2-Illuminatus » Sun, 10. Jan 16, 21:18

You can only write scripts in a dedicated editor, such as the ingame Script Editor or a respective external Script Editor. In case, you haven't already, you could try out X Studio 2 and see whether the bug persists.

The xml part of a script file is actually just used for displaying the script in your browser. The actual code is stored in the codearray of the script, which is hardly readable.
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!

nekoexmachina
Posts: 58
Joined: Thu, 3. Apr 14, 12:51
x4

Post by nekoexmachina » Sun, 10. Jan 16, 21:25

Thanks! Second version doesn't have this problem.

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

Post by jack775544 » Mon, 11. Jan 16, 01:12

That looks like it is just a bug in wine. The X-Studio 1 interface seems to be done in a very custom fashion and it wouldn't surprise me if it broke on different platforms, where X-Studio 2 was done using more generic components.

sicknezz
Posts: 50
Joined: Sat, 18. Jul 09, 00:20
x4

Post by sicknezz » Mon, 15. Feb 16, 23:43

Hello mr.bear

If you are interested i would like to support the X-Studio a bit with a better German Translation since about 20% of the Translation is weird and not properly done ;)

If you are interested just msg me 8)


User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Fri, 6. May 16, 06:31

I love X-Studio but one thing I hate having to do every time it starts is to put in the admin password when I know that it doesn't need any admin rights, all my game files are owned by my (non-admin) user. I've tried using things like "PE Editors" to remove the manifest from the binary that says it should prompt for admin but that didn't do anything.

Did anyone manage to make X-Studio run without administrator rights?
X3LU 1.5.2/1.7.0 Youtube series with: IEX 1.5b + LUVi, SIaF r7 (previously also used Phanon Plus 4.02, Revelation Plus 1.04, Diverse Game Starts - LU Edition)
[ external image ]

andreihaiducul
Posts: 62
Joined: Wed, 10. Jul 13, 04:23
x3ap

Post by andreihaiducul » Mon, 25. Jul 16, 18:01

Does anyone have a working download link for the source code package?

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

Post by X2-Illuminatus » Mon, 25. Jul 16, 19:10

Here you go: Link (mediafire.com)
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!

Deniskos
Posts: 146
Joined: Wed, 11. Jun 08, 21:40
x4

Post by Deniskos » Thu, 11. Jan 18, 06:05

X-Studio.v1.08.14.Feb.2014
Data type [DATATYPE_PASSENGER] does not work!
In order to work it is necessary to reassign the type [DATATYPE_PASSENGER] in the game editor.

Deniskos
Posts: 146
Joined: Wed, 11. Jun 08, 21:40
x4

Post by Deniskos » Thu, 11. Jan 18, 06:17

If I create a new script in x-studio with Custom Syntax, then after changing and saving the script in the game editor, x-studio does not recognize new commands. :evil:

FritzHugo3
Posts: 4657
Joined: Mon, 6. Sep 04, 17:24
x4

Post by FritzHugo3 » Mon, 19. Feb 18, 02:53

Dont like my Steamversion, dont accept the path.
Any idears?

Gibts eine Lösung dafür?
Ich fordere mehr und vorallem gerechtere Verteilung von Keksen und Süßkram für die "Magischen 20"! Daher wählen Sie jetzt die DPFGKV, die Deutsche Partei für gerechtere Keks - Verteilung!

Deniskos
Posts: 146
Joined: Wed, 11. Jun 08, 21:40
x4

Post by Deniskos » Mon, 26. Feb 18, 03:15

Deniskos wrote:If I create a new script in x-studio with Custom Syntax, then after changing and saving the script in the game editor, x-studio does not recognize new commands. :evil:
Understood, it's all about the script engine version.

User avatar
Perahoky
Posts: 450
Joined: Fri, 22. Aug 08, 16:04
x4

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by Perahoky » Wed, 28. Nov 18, 12:42

Could we make a github project for this tool? :)
Thanks :)

PS sorry if that was asked before, couldnt found.

We could expand this tool alltogether...
"Hope is the last force i have"
"This is how liberty dies, with thounderous applause"
***Modified***

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by SirNukes » Wed, 1. May 19, 01:39

As a workaround for the DATATYPE_PASSENGER bug, I put together a short python script that scans the x3 scripts for the bug when using "is datatype" commands and patches them. The intention is to run it after editing a script in X-Studio that might suffer from this bug. This requires Python 3.6+ and the lxml package, and the buggy script should be in xml format. Feel free to edit the scanning/saving behavior as desired for convenience.
Spoiler
Show

Code: Select all

'''
All xml scripts will be opened and scanned for an x-studio bug with
datatype codes.

Usage:
    - Run from the directory with the scripts to be checked.
    - When a bug is found and patched, press 'y' or 'n' and <enter>
      to confirm the file overwrite.
'''
'''
This will look for script command 125 ("%0 is datatype[%1] == %2"),
aiming to repair DATATYPE_PASSENGER, which xstudio saves as 0x0001A
when it should be 0x1001A.

Example:
    <sval type="array" size="6">
    	<sval type="int" val="125" />
    	<sval type="int" val="1" />
    	<sval type="int" val="131074" />
    	<sval type="int" val="0" />
    	<sval type="int" val="20" />
    	<sval type="int" val="26" />
    </sval>
The last "26" will become "65562".
'''

from lxml import etree as ET
from pathlib import Path

for file_path in Path('.').glob('*.xml'):

    # First, do a raw text search to determine if this is x-studio generated.
    with open(file_path, 'r') as file:
        if '<!-- Generated using X-Studio -->' not in file.read():
            continue

    print('Scanning {}...'.format(file_path))

    tree = ET.parse(str(file_path))
    root = tree.getroot()

    # Pull out the codearray, holding the script details
    #  (args, commands, etc.).
    # Note: this has one child, <sval type="array" size="10">, which in
    #  turn has a fixed set of 10 children that give different aspects
    #  of the script, where [6] is the script commands.
    codearray = root.find('.//codearray')
    assert codearray != None
    command_array_node = codearray[0][6]

    # Flag when a change occurs.
    change_occurred = False

    # Loop over all script commands.
    for code_node in command_array_node:

        # The first child holds the command code.
        # Skip if not 'is datatype'.
        if code_node[0].get('val') != '125':
            continue

        # Search for the buggy code, the last item of the node.
        data_type_node = code_node[-1]
        if data_type_node.get('val') == '26':
            # Update it.
            data_type_node.set('val', '65562')
            change_occurred = True

    if change_occurred:
        user_response = input(' Patch applied; okay to save?  y or n \n')
        if user_response == 'y':
            # Lxml loses the standalone attribute, so put it back here.
            # Also, ensure the declaration line is included.
            tree.write(str(file_path), standalone = True, xml_declaration = True)
            print(' Saved')
        if user_response == 'n':
            print(' Skipped')

terodil
Posts: 149
Joined: Sat, 12. Aug 17, 22:13
x4

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by terodil » Wed, 1. May 19, 09:36

SirNukes, you're an angel.

Will try this at home and post back if I run into any issues, but for now: thank you very much indeed!
My X3 mods: Ship Autoclaimer - Ship Services - Friendlier War Sectors - in development: Logistics Centre

User avatar
N8M4R3
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 392
Joined: Fri, 24. Nov 06, 15:48
x4

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by N8M4R3 » Sun, 21. Jul 19, 22:32

I have added missing commands that were now available at AP3.3 over a Custom Syntax File. For interest have a look here: viewtopic.php?f=94&t=417934
Neue Erweiterung für X3 verfügbar: Farnham's Legacy | +Optional: weitere Verbesserungen im inoffiziellen Patch v1.3.14 *** Modified*** :khaak: :thumb_up:
Diese Woche im Angebot: HUD-GUI-Mix (FL) | Text-DB 0001-L049 (FL) | Textkorrekturen & Verbesserungen (FL)
Weitere Veröffentlichungen hier: N8workX
Nützliches Tool für nicht mehr vorhandene Downloads: web.archive.org
Externes Archiv für MOD/SCR Ressourcen: xdownloads.co.uk | code.google.com/archive/p/x3tcscripts/

MegaBurn
Posts: 278
Joined: Mon, 30. Jan 06, 15:52
xr

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by MegaBurn » Sat, 1. May 21, 00:09

Found Mr Bear on Github, XS1 source: https://github.com/nick-crowley/X-Studio
"Only the dead have seen the end of war." -Plato

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by mr.bear » Mon, 2. Jan 23, 01:53

Hello everyone,

I hope everybody is well.

I haven't been on this forum for a long long time.

I've been wondering lately if anybody still uses this software that I wrote, X-Studio or X-Studio II?

I realize I haven't released any updates for nearly 10 years.. *awkward cough*
and Egosoft have even released several games over that period :oops:

I don't actually game much anymore but I realized I should be putting some effort into keeping this software up-to-date for all of you folks who are using it for developing your mods.

I'd like to get a sense of
  • a) how many people still use this software?
  • b) what are the known bugs?
  • c) what are you feature requests?
Thanks & Happy New Year!
Rapunzel, Rapunzel, let down your bear...

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

Re: [PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

Post by alexalsp » Mon, 2. Jan 23, 12:52

I think at least officially add support :)

viewtopic.php?f=201&t=444078

I don't develop mods, but I use a program to view scripts, txt files and some minor edits.

And I think it would be great to update the program.

Post Reply

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