[PROGRAM] X-Studio 2 Script Editor [Beta III : 30th Mar 14]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Shush
Posts: 242
Joined: Sat, 6. Dec 03, 17:21
x4

Post by Shush » Wed, 26. Mar 14, 17:15

mr.bear wrote:1) i completely forgot to mention that I haven't implemented macro commands yet, that's why 'dim' doesn't work!
Assuming it's trivial for you to do, (reuse of X-Studio code), is there any chance you can prioritise the macro stuff. I use way too many dim statements in way too many scripts for me to be able to effectively beta test X-Studio 2.

If not I can wait.

User avatar
mr.bear
Posts: 427
Joined: Sat, 11. Dec 10, 02:38
x2

Post by mr.bear » Wed, 26. Mar 14, 18:24

i'll make it a high priority, but i haven't worked out how i'm going to do them yet - so it'll take a few days. [the compiler is quite different from XS1]

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

User avatar
jack775544
Posts: 1118
Joined: Tue, 13. Dec 11, 09:27
x4

Post by jack775544 » Thu, 27. Mar 14, 08:59

I was just downloading the latest version and then i realised I have a couple of copies of X-Studio on my computer http://i.imgur.com/pLZpWAj.jpg?1 :D
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

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

Post by Litcube » Fri, 28. Mar 14, 10:21

Hey! Remember this file?

Custom.Syntax.txt


This thing looks good, but I can't test it yet due to the above. ;) Keep it up, Mr. Bear.

User avatar
mr.bear
Posts: 427
Joined: Sat, 11. Dec 10, 02:38
x2

Post by mr.bear » Sun, 30. Mar 14, 03:53

jack,
aww, it's a like a museum of X-Studio in there :)

litcube,
I've changed the format of the syntax file completely so i've provided an Import command in the file menu you can use to upgrade the file, and optionally merge commands loaded from the stock 'CommandSyntax.xml' into it.

X-Studio II loads just the one command syntax file btw, there's no 'CustomSyntax.xml' file. I haven't been able to test it, but if you select 'Yes' to the merge when importing then X-Studio should generate you a whole new syntax file with both the stock and your custom commands. If you don't want that then select 'No' to merge.

mr.bear

----------------------------------------------------------------------

Preceeding messages relate to Beta I

----------- BETA II RELEASED -----------

Following messages relate to Beta II

----------------------------------------------------------------------

• Variable argument commands: create new array, sprintf
• Macro commands: dim, for, foreach
• Status bar indicator of loaded game data version
• Subroutine indentation
• Implemented find & replace on scripts in project
• Add Compiler preference to enabling/disabling macro commands
• Fixed: 006: HOME key in the script editor doesn't scroll far enough left to display line numbers
• Fixed: 007: RichEdit shortcut keys can be used to right/centre align script editor text
• Fixed: 010: Changing the id/language property of X3R language files renames document using X3TC naming scheme
• Fixed: 011: Script editor variables drop-down isn't updated after modifying arguments


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

User avatar
mr.bear
Posts: 427
Joined: Sat, 11. Dec 10, 02:38
x2

Post by mr.bear » Sun, 30. Mar 14, 17:28

----------------------------------------------------------------------

Preceeding messages relate to Beta II

----------- BETA III RELEASED -----------

Following messages relate to Beta III

----------------------------------------------------------------------

• Fixed: Compiler bug in the 'foreach' macro

sorry about that guys, I forgot to run the compiler validation batch tests before releasing beta II.
it's all fixed now :)

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

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 02:43
x4

Post by Shimrod » Sun, 30. Mar 14, 19:57

I'll collate any feedback I produce in using beta 3 in this post:

Issues

Studio has made some insane alterations to glen.turret.smart.menu.xml on load. Example from original:

Code: Select all

  * ********** Missile Turrets *************
  add custom menu heading to array $globalmenu: title=$Text.Missile.Turrets
  
  $defaultIndex = $Config[$Config.Missile.Support.Wing]
  $values.missile.support.wing = create new array, arguments=-4, $Text.Fleet.Wing.Support, $Opt.Off.On, $defaultIndex, $Id.Fleet.Wing.Support
  append $values.missile.support.wing to array $globalmenu
  
  $defaultIndex = $Config[$Config.Missile.Support.Formation]
  $values.missile.support.formation = create new array, arguments=-4, $Text.Formation.Support, $Opt.Off.On, $defaultIndex, $Id.Formation.Support
  append $values.missile.support.formation to array $globalmenu
After load:

Code: Select all

      * ********** Missile Turrets *************
      add custom menu heading to array $Config.Ver.Major: title=$Text.Missile.Turrets
      
      $Config.Laser.Recache.Timestamp = $Config[$Config.Missile.Support.Wing]
      $Config.Missile.Support.Formation = create new array: -4, $Text.Fleet.Wing.Support, $Opt.Off.On, $Config.Laser.Recache.Timestamp, $Id.Fleet.Wing.Support
      append $Config.Missile.Support.Formation to array $Config.Ver.Major
      
      $Config.Laser.Recache.Timestamp = $Config[$Config.Missile.Support.Formation]
      $Config.Missile.Support.All = create new array: -4, $Text.Formation.Support, $Opt.Off.On, $Config.Laser.Recache.Timestamp, $Id.Formation.Support
      append $Config.Missile.Support.All to array $Config.Ver.Major
I'm scared to use it any more after that one!

Find Text pops an error messagebox when hitting 'find next or 'find all':

Code: Select all

The operation is invalid: Unsupported target type
Sink: GUI::Windows::FindDialog::OnFind_Click() on line 213
Source: Logic::Threads::SearchWorkerData::SearchWorkerData() on line 52
When I reopen X-Studio 2 I have to do Game Data-> Reload before it works.

The intellisense menu only pops up if I begin typing a new variable with $. It doesn't pop up if I modify an existing variable, and I couldn't find any key combination to force it to pop up.

When pasting from notepad into studio I noticed that the first click in a studio's script window after copying from notepad doesn't move the cursor to the position I clicked. It requires a second click, as if the first one had only switched focus to studio in general and not the editor window I clicked in.

On the win7 taskbar icon I can mouse over it to see separate icons for each loaded script (cool). However when I tab between scripts using this method instead of the in-editor tabs, the editor flickers as if its redrawing itself a hundred times in quick succession.

When I open a file from the project the editor window doesn't get input focus so I have to click on the document before I can use the scroll wheel.

Enhancements

Need the ability to multi-select files in the file-open dialog.

It'd be nice if the project file used relative instead of absolute paths so it could be portable.

I'd like to a see the 'close all tabs but this' contextmenu option on the editor tabs.

I'd like the ability to insert a textfile entry with a specific ID in addition to the new behaviour of numbering the entry one above the highlighted entry.

I couldn't find a way to modify the ID of an existing textfile entry.

When I closed a project via the file menu, before switching to another one, I found the open scripts in the editor window stayed open. Feels like they should close off too.

I'd love some setting to disable tearoff controls so I don't accidentally tear them off and spend ages figuring out how to redock them.

Ideally the stripping of the view-in-browser part of the script files could be made optional; I tend to rely on this for quickly reviewing scripts with the stylesheet and would prefer to turn it on.

Positive

I like the 50% size reduction in compiled scripts.
Studio 1: 444,568 glen.trade.ok.action.xml
Studio 2: 222,311 glen.trade.ok.action.xml

I like the colour coding of menu tabs as I typically have about 10 scripts on the go and its easier to find what I'm looking for now.

Super fast save time on big scripts.
Last edited by Shimrod on Sat, 5. Apr 14, 01:42, edited 1 time in total.

User avatar
mr.bear
Posts: 427
Joined: Sat, 11. Dec 10, 02:38
x2

Post by mr.bear » Sun, 30. Mar 14, 23:56

hi shimrod,
I can't replicate the bug with the rearranged variables, I have absolutely no idea how that happened. :cry:

I can add most of your suggestions, except for project files using relative paths - i thought it would be useful too, but i had to make a design decision early on that now prevents me from using relative paths.

You can modify the ID of a textfile entry using the properties window.

lol, i didn't even know about the documents on the win7 taskbar :)

do you really want a command to insert a textfile entry with a specific ID? X-Studio 1 did that and I found it really clunky...

thanks trying the program,
mr. bear

PS. the script filesizes are only smaller because I've stripped the view-in-browser stuff out of them, it's not some kind of magic optimization :) although you could just save them as PCK if you want a smaller filesize.
Rapunzel, Rapunzel, let down your bear...

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 02:43
x4

Post by Shimrod » Mon, 31. Mar 14, 00:54

Did you try downloading Smart Turrets and opening glen.turret.smart.menu.xml? I opened an earlier version of the script and still see those menu selection blocks getting jumbled.

Yeah I kind of liked the string ID box that would appear in studio 1 when inserting a text entry, I'm a bit ocd about grouping my IDs into ranges corresponding to particular functionality. But if it's possible to edit the IDs then I can live with that.

Many thanks to yourself for building the editor!

Shush
Posts: 242
Joined: Sat, 6. Dec 03, 17:21
x4

Post by Shush » Fri, 4. Apr 14, 02:22

Hey mr.bear,

Thanks for working in the macro expansion functions as quickly as you did; the only real issue I have found so far is that one of my X-Studio 1 scripts fails to load in X-Studio 2, but if I manually paste it in to a X-Studio 2 New Script window it parses correctly.

If you want to see the error for yourself, then download "LIFE-V0.91b1 Scripts.zip" from here https://www.dropbox.com/sh/uqdh1bvlujrw5ze/fCGDguWIO3, (396KB), and try and load "plugin.LIFE.mdcomms.setup.xml".

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

Post by Litcube » Fri, 11. Apr 14, 11:05

Mr. Bear, I'll commit to testing this on the next update. Looking forward to importing my custom syntax.

User avatar
MaxVatutin
Posts: 200
Joined: Thu, 7. Nov 13, 16:41
xr

Post by MaxVatutin » Mon, 14. Apr 14, 21:56

Hey, Mr.Bear!)

First of all thanks a lot for working on such a great tool for scripters. I even can't imagine doing anything without X-studio!)

Everything in X-studio 2 seems to be working apart from some mysterious crash errors time to time. Forgot to capture some screens or crash logs atm, but i'm going to do so if i'll get same troubles ever again (i'm using X-studio on Win 7 installed via Parallels Desctops on my Mac). Another non-crucial issue is that i can't open language file in .pck format for some reasons. It was created and compiled via first generation X-studio and it's ok, but X-studio 2 just do nothing if i try to open it...

Anyway, it's a beta now, so looking forward to trying future updates.

Cheers

User avatar
Jack08
Posts: 2971
Joined: Sun, 25. Dec 05, 11:42
x3tc

Post by Jack08 » Thu, 8. May 14, 04:20

Hi Mr.Bear.

I ran into a bug with the script commands list, it seems to show only X3:TC commands, regardless of version selected. I digged through the code a little and located what i think the problem is, changing the following has resolved the issue:

Code: Select all

CommandWnd.cpp line 49


return SyntaxLib.Query(GetSearchTerm(), GameVersion::TerranConflict, grp);

Changed To

return SyntaxLib.Query(GetSearchTerm(), PrefsLib.GameDataVersion, grp);
Image
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
mr.bear
Posts: 427
Joined: Sat, 11. Dec 10, 02:38
x2

Post by mr.bear » Thu, 8. May 14, 21:55

hey jack, thanks for spotting that.
how easy/hard did you find navigating the code?

mr.bear

PS. thankyou to everyone who has tried the beta. i've been busy changing jobs for the last few weeks, so i haven't made any recent progress
Rapunzel, Rapunzel, let down your bear...

User avatar
Jack08
Posts: 2971
Joined: Sun, 25. Dec 05, 11:42
x3tc

Post by Jack08 » Thu, 8. May 14, 23:17

mr.bear wrote:hey jack, thanks for spotting that.
how easy/hard did you find navigating the code?
Quite easy once i got my head around MFC/AFX - I've never used it and dislike because of all the annoyingly obscure macros that have to be used left right and centre :D. Its well written and i love all the commenting :)
Image
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Post Reply

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