[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
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Fri, 28. Feb 14, 23:03

ok, it sounds like you're taking quite a different approach than i did.

best of luck,

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

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

Post by Shush » Wed, 5. Mar 14, 14:38

Hey Mr. Bear,

Firstly; thank you for an extremely professional MSCI editing environment!

Now that I have buttered you up, a bug report:

Code: Select all

Issue:      using a % sign as the last character of a string within an MSCI script causes your parser on re-loading the script to remove the % sign.
Example1:   $string = '100%' becomes $string = '100'
Example2:   $string = '100%%' becomes $string = '100%'
Cause:      reloading of the script or restarting of X-Studio
Workaround: do not re-load scripts and do not exit X-Studio
Cheers.

User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse » Tue, 11. Mar 14, 16:02

mr.bear wrote:ok, it sounds like you're taking quite a different approach than i did.

best of luck,

mr.bear
Progressing... Still ugly. :p
http://www.hostingpics.net/viewer.php?id=36485667MC.jpg

Known bugs in the "Start" cue (miss a "new" before the cue, it's how I translate "instanciate = true) and non translated conditions (still thinking of a design for that, I stoped there @00:00AM yesterday).

(very very) partial scanner only for MD -> MC for the moment. MC -> MD in a month or more.

Again, my intention is not to go against your stuff, in fact I'll make the scanners/compiler public, or something like that I don't really know, once done if you like that you'll be free to use them.
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.

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

Post by Nicoman35 » Tue, 11. Mar 14, 17:55

When you work on a mod located is some place, lets say: D:/games/X3/mods/BigBang1, Xstudio will open any script, if you right klick on a script call and then choose "Open Target Script", if that script is is the same folder.

BUT, if a script, like a vanilla script, is being called, this script will be in the C:/gamefolder.
Trying to open that script will lead to this error:
The external MSCI script 'script.in.some.place' is unavailable or could not be accessed
Could you add an option, to add paths, where Xstudio should also look for scripts, or is that option included, and I am not able to find it?

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

Post by DrBullwinkle » Tue, 11. Mar 14, 18:59

Rather than right-click, just drag-and-drop files onto X-Studio.

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

Post by mr.bear » Tue, 11. Mar 14, 19:09

Shush wrote:using a % sign as the last character of a string within an MSCI script causes your parser on re-loading the script to remove the % sign.
I haven't seen that before. I will look into it.
mr.bear

RedEclipse wrote:Progressing... Still ugly. :P
http://www.hostingpics.net/viewer.php?id=36485667MC.jpg
that screenshot looks promising. some syntax colouring might help make things easier to understand.
mr.bear

Nicoman35 wrote:When you work on a mod located is some place, lets say: D:/games/X3/mods/BigBang1, Xstudio will open any script, if you right klick on a script call and then choose "Open Target Script", if that script is is the same folder. BUT, if a script, like a vanilla script, is being called, this script will be in the C:/gamefolder.
Could you add an option, to add paths, where Xstudio should also look for scripts, or is that option included, and I am not able to find it?
hi nicoman,
I hadn't thought of that. it's a bit late in the day to be adding features to x-studio (i'll be releasing x-studio 2 next week) so i've added your feature to that instead. it searches the document folder first, then the game folder.
mr.bear
Last edited by mr.bear on Tue, 11. Mar 14, 21:19, edited 2 times in total.
Rapunzel, Rapunzel, let down your bear...

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

Post by Nicoman35 » Tue, 11. Mar 14, 20:01

DrBullwinkle wrote:Rather than right-click, just drag-and-drop files onto X-Studio.
I DO drag-and-drop them now, but as a lazy man, I do much apreciate things that make things even easyer than that. :D


mr.bear wrote:..it's a bit late in the day to be adding features to x-studio (i'll be releasing x-studio 2 next week) so i've added your feature to that instead. it searches the document folder first, then the game folder.
WOOT - once again - many thanks for your support, Mr. Bear!

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

Post by mr.bear » Tue, 11. Mar 14, 21:23

here's a preview of some of the new features: code refactoring, difference viewer, language file tag editor

[ external image ] [ external image ] [ external image ]

global find & replace, named script-arguments in all script-call commands, intellisense-style commenting, and better syntax-error feedback

[ external image ] [ external image ] [ external image ] [ external image ]

i don't have a picture yet but x-studio II has in-built script version control, and some commands now support variable arguments. (eg. 'sprintf', 'create new array', and all script-calls)

also, all the 'normal' editing features work properly throughout the program: undo/redo, cut/copy/paste, code indentation, national symbol input etc.

mr.bear
Last edited by mr.bear on Tue, 11. Mar 14, 21:33, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...

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

Post by DrBullwinkle » Tue, 11. Mar 14, 21:28

Diff... sweet! Looks like a lot of great stuff!

(any chance of properly indenting if/else/end statements inside of subs?)

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

Post by mr.bear » Tue, 11. Mar 14, 21:35

I came to hate x-studio's automatic indentation because it made my code bounce around too much when I was editing it. identation is manual in x-studio 2 (like visual studio).
It automatically places the cursor for you when you start a new line, and there are 'format selection' and 'format document' editor commands.
simple answer is 'yes', subroutine code is properly indented

mr.bear
Last edited by mr.bear on Tue, 11. Mar 14, 21:38, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...

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

Post by DrBullwinkle » Tue, 11. Mar 14, 21:37

Nice. :thumb_up:

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

Post by Nicoman35 » Wed, 12. Mar 14, 09:07

*slobber*

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

Post by Jack08 » Tue, 18. Mar 14, 02:22

Nicoman35 wrote:*slobber*
/agree

Loving the new visual studio look 'n' feel
[ 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
hourheroyes
Posts: 346
Joined: Mon, 9. Apr 12, 05:14
x4

Post by hourheroyes » Wed, 19. Mar 14, 03:49

Website down? Doesn't look like I can get on the site

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

Post by Nicoman35 » Wed, 19. Mar 14, 08:51

hourheroyes wrote:Website down? Doesn't look like I can get on the site
Works for me...

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...

Post Reply

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