[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
User avatar
TECSG
Posts: 1604
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG » Sat, 22. Mar 14, 17:43

Hi,

I've just tried using X-Studio after many years of working with Exscriptor and I've found a few issues and got a couple of suggestions.

Although extremely fast, your generated code adds 500K to one of my largest script files (similar to Exscriptor).

If I save the file in X3, it takes 15.3 seconds and is 2,136K, Exscriptor took 265 seconds (4.5 minutes) to save and the file was 2,608K and X-Studio took only 4.6 seconds but produced the biggest file at 2,637K.

The tabs are difficult to navigate because of the different sizes, multiple rows and the files are not in alphabetical order. for example, these are the scripts I usually have open:

http://www.tecsg.co.uk/scs/Tabs.jpg

The '.xml' could also be removed from the text on the tab (I would assume the most common file type to have open would be .xml). It would be useful if there was a 'Reload Script' option for when scripts are modified in X3 that are open in X-Studio, or, even better, for X-Studio to detect when a script is modified and prompts to reload (like Exscriptor).

Can an option to turn off the Script Engine version number errors be added? I use scripts written in AP which work perfectly well in X3 as long as none of the additional commands are used, but they throw up errors because the game version is 'too high'.

Finally, found this bug if you have too many 'end' commands:

[ external image ]

Other than that, you've written a pretty efficient and handy editor there. Many thanks.


Update: Also now noticed X-Studio has renamed several of my variables 'XStudio.Hidden' and screwed up some of my scripts.

Shush
Posts: 244
Joined: Sat, 6. Dec 03, 16:21
x4

Post by Shush » Sun, 23. Mar 14, 07:10

TECSG wrote:The tabs are difficult to navigate because of the different sizes, multiple rows and the files are not in alphabetical order. for example, these are the scripts I usually have open:

http://www.tecsg.co.uk/scs/Tabs.jpg
This is not in anyway a complaint or even a feature request, (X-Studio is a magnificent tool), but I wanna' play to!

http://s0.uploads.im/sihbW.jpg

P.S. I don't browse for my scripts using the tabs, (that's almost impossible), I use the Project Explorer pane; so if I was going to make a feature request, (which I have already stated I am not), then I would ask for a simple toggle to turn the tabs on and off.

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

Post by mr.bear » Sun, 23. Mar 14, 13:34

TECSG wrote:Although extremely fast, your generated code adds 500K to one of my largest script files (similar to Exscriptor).

If I save the file in X3, it takes 15.3 seconds and is 2,136K, Exscriptor took 265 seconds (4.5 minutes) to save and the file was 2,608K and X-Studio took only 4.6 seconds but produced the biggest file at 2,637K.
it's probably formatting. exscriptor/msci outputs all the code on a single line, but x-studio writes every value on a separate line so i can debug easier.


Re: tabs on multiple lines - I can't do anything about the annoying tabs. i just use the project window too.
TECSG wrote:It would be useful if there was a 'Reload Script' option for when scripts are modified in X3 that are open in X-Studio, or, even better, for X-Studio to detect when a script is modified and prompts to reload (like Exscriptor).
TECSG wrote:Can an option to turn off the Script Engine version number errors be added? I use scripts written in AP which work perfectly well in X3 as long as none of the additional commands are used, but they throw up errors because the game version is 'too high'.
i could both of those to x-studio 2.

TECSG wrote:[ external image ]
I've never seen that before.

TECSG wrote:Update: Also now noticed X-Studio has renamed several of my variables 'XStudio.Hidden' and screwed up some of my scripts.
those are variables that've been replaced as part of a macro (maybe a 'for' loop). they don't change the logic of your code though.

mr.bear
Rapunzel, Rapunzel, let down your bear...

User avatar
TECSG
Posts: 1604
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG » Sun, 23. Mar 14, 21:15

Hi,

I think I've found the issue with my scripts being corrupted.

When X-Studio saves a script, it seems to ignore the case sensitivity of variables.

I have several scripts with the same name is used for a variable but with different case (ie, ships and SHIPS) which X3 treats as different variables.

However once such a script is saved with X-Studio, the two variable will both be converted to the same.

As a test I created a script in X3 that defined 2 variables
  • VARIABLEone and
    variableONE
When loaded in to X-Studio the script still displays the 2 different formats, but once re-saved in X-Studio and loaded back into X3 the variables have both changed to VARIABLEone.

Hope that helps.

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

Post by mr.bear » Sun, 23. Mar 14, 22:04

yeah x-studio doesn't support case sensitive variables, I designed it that way on purpose. x-studio 2 does though.

mr.bear
Rapunzel, Rapunzel, let down your bear...

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

Post by jack775544 » Mon, 24. Mar 14, 03:04

Bear, every time you talk about x studio 2 it sounds better and better. I think when it is released I might have to play the game again just so I can test it because it is sounding great :)
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

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

Post by mr.bear » Tue, 25. Mar 14, 22:59

hey jack,

I've just posted a beta of the new X-Studio II. It's available here

mr.bear
Rapunzel, Rapunzel, let down your bear...

Jakesnake5
Posts: 2880
Joined: Fri, 17. Feb 06, 04:55
x4

Post by Jakesnake5 » Wed, 28. May 14, 16:27

Just found I can't use X-Studio. Reason: it can't handle the path length to the game directory steam requires. For example:

C:\Program Files (x86)\Steam\SteamApps\common\X3 Terran Conflict

It get's to the Terr part, and cuts off. It can't find the file because of that.

And the beta 3 of XS2 doesn't work, as I posted in that thread.

Edit:

After looking, I tried adding a - in the executable file name Steam uses for TC and AP. Surprisingly, it worked.

However, Steam no longer thinks the game is installed. So now I have 2 copies of the exes in the directory. One for Steam, one for XStudio. What a mess. :)

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Sun, 1. Jun 14, 21:56

Tiny bug :

When you put a "<" or a ">" in the script's description, it will mess the XML and X-Studio won't be able to read the script properly. Maybe do a check in X-Studio 2 :)

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Sun, 8. Jun 14, 14:50

Hu huuu dear Mr sleeping Bear!

As I can not use X Studio 2, I am still using this, and gess what - I got another issue for you!
Inside of this script, there are two sections. The upper one works flawless. The second (it is marked....pretty well) does not. Thow the two sectios should work in an identical way.
Only difference: The non functional one uses your macro command dim $array = 1, 2, 3, ...
Maybe you have a look, if this issue is a problem for the ney Xstudio2.
Regards

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

Post by mr.bear » Sun, 8. Jun 14, 14:53

Joubarbe,

Yes X-Studio will be sensitive to the < > symbols, I doubt I can fix that unfortunately. Just avoid using them in script titles or descriptions.

mr.bear


Jakesnake5,

The maximum length for a path is around 258 characters, I'm afraid I can't fix that. however that should be significantly longer than the 'terr' part of 'x3 terran conflict' in the path you quoted - that's only 53 characters. When did you see this issue?

can you post more details on the executable name issue? i might be able to fix that.
(If this is an x-studio 2 issue, please post in the x-studio 2 thread)

mr.bear
Rapunzel, Rapunzel, let down your bear...

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

Post by mr.bear » Sun, 8. Jun 14, 15:06

Nicoman

I'm looking at your script now.

So when you execute the first half it works fine, but when you execute the bottom half - something goes wrong? You said in a comment that it 'causes a weird loop error', what does that mean?

mr.bear
Rapunzel, Rapunzel, let down your bear...

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Sun, 8. Jun 14, 15:13

No no, I do know that. I mean, that there is some wierd loop ingame, when the part with the dim macros is run (I called the script in a setup script as a global task, and it runns over and over like in an enless loop - it stopped TC form working, I had to kill the task manually)

Jakesnake5
Posts: 2880
Joined: Fri, 17. Feb 06, 04:55
x4

Post by Jakesnake5 » Sun, 8. Jun 14, 15:49

I figured out the issue with mine. It wasn't the length of the path, but the filename itself.

Steam names TC and AP executable x3tc.exe and x3ap.exe. When I put a '-' between the X3 and game initials, XStudio saw them just fine.

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

Post by mr.bear » Sun, 8. Jun 14, 16:00

Nicoman - ok this is going to require some experimentation. i'll let you know what i find.

Jakesnake - have you got that the wrong way around? x-studio searches for X3R.exe, X3TC.exe, X3AP.exe. It doesn't check for hyphenated names, eg. X3-TC.exe (it shouldn't detect that)

mr.bear
Rapunzel, Rapunzel, let down your bear...

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Tue, 29. Jul 14, 22:03

Litcube's Universe wouldn't have been possible without this thing.

Jack08 says I should also say thank you. So thank you!

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

Post by mr.bear » Tue, 5. Aug 14, 19:53

Litcube wrote:Litcube's Universe wouldn't have been possible without this thing.

Jack08 says I should also say thank you. So thank you!
i should bloody well think so mr cube! now where's my money?

i want a pound for every second you've used x-studio...
Rapunzel, Rapunzel, let down your bear...

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

Post by jack775544 » Wed, 6. Aug 14, 01:10

mr.bear wrote:
Litcube wrote:Litcube's Universe wouldn't have been possible without this thing.

Jack08 says I should also say thank you. So thank you!
i should bloody well think so mr cube! now where's my money?

i want a pound for every second you've used x-studio...
Ha I think you would bankrupt the poor fella three times over.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sat, 9. Aug 14, 23:07

Hello, Mr.Bear!

I have run up against a slight bug with the compiler that ran me around in circles for a little while.

The compiler will allow compilation of a <RetVar> command into an IF statement regardless of if its a <RetVar/IF> acceptable command, resulting in a lost statement (jump tree) error in the script engine.

Example code, this should not compile, but does:

Code: Select all

if not $Missile-> get array of missiles aiming to me
end
return null
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

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

Post by Perahoky » Fri, 15. Aug 14, 18:39

Hello together,

is this project available on a project hosting platform e.g. bitbucket oder github?

We could send you patches to implement new features for which you dont have time.

greetings,
// Pera
"Hope is the last force i have"
"This is how liberty dies, with thounderous applause"
***Modified***

Post Reply

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