[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: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01: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, 01: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: 444
Joined: Sat, 11. Dec 10, 01: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, 01: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: 244
Joined: Sat, 6. Dec 03, 16: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: 4254
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, 15: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: 2993
Joined: Sun, 25. Dec 05, 10: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);
[ 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
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01: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: 2993
Joined: Sun, 25. Dec 05, 10: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 :)
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

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

Post by Nicoman35 » Sat, 10. May 14, 12:46

2 Things:

1) I am not able to use X-Studio 2, because it crashes the moment I am starting it.
OS: Win7 64bit
Game: TC v 3.2
I followed the instructions, downloaded and executed the x86 Redistributable.
Everything was ok until I told X-Studio 2 the location of the game folder.
It tryed to load some language file, then it no longer worked.
Here an image for clarification.
Now every time I start X-Studio 2, it crashes the same way.



2) As I am not able to use X-Studio 2, I am still using X-Studio 1 v 1.08. So - if the following bugs have already been fixed, forget it :)
Bug in descriptions detected (producing a LOT of headace :gruebel: to me untill I sorted that out):
The descriptions to the random number commands are WRONG:

<ret/var> random value between <Var/Number1> and <Var/Number2>
Your description:
A random number, that coud be <Var/Number1>, <Var/Number2>, or any number in between.
Correct description:
A random number, that coud be <Var/Number1>, or any number between <Var/Number1> and <Var/Number2>.

<ret/var> random value from zero to <Var/Number>
Your description:
A random number, that coud be zero, <Var/Number2>, or any number in between.
Correct description:
A random number, that coud be zero, or any number between <Var/Number1> and <Var/Number2>.

In both cases the number will NEVER be <Var/Number2>!! I proved that by extensive testing.

User avatar
Aldebaran_Prime
Posts: 1386
Joined: Sat, 20. Feb 10, 17:47
x4

Post by Aldebaran_Prime » Fri, 16. May 14, 20:53

I have the same problem, that X-Studio 2 crashes when loading the game folder of the TOTT Mod 1.3 which was installed in the TC Folder of an AP installation. If I try the same with X-Studio 1 it is loadable without problems.

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

Post by mr.bear » Sat, 17. May 14, 14:19

hey Nicoman,

could you send me 0901-L044.pck language file please? X-Studio 2 doesn't seem to be able to load it.

re: the random number thing: yeah several people have mentioned this, it only generates a random number x -> y if y is a hard coded number. If y is a variable then it produces x -> (y-1). sorry about that. x-studio 2 doesn't work that way.


Aldebaran_Prime: could you send me the language file x-studio 2 loads immediately as it crashes? see nicoman's picture for an example.

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

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

Post by Nicoman35 » Sat, 17. May 14, 15:30

mr.bear wrote:could you send me 0901-L044.pck language file please? X-Studio 2 doesn't seem to be able to load it.
Here is my 0901-L044.pck language file...

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

Post by mr.bear » Sat, 17. May 14, 20:26

thanks Nicoman, I'll try and work out what X-Studio doesn't like about that file.

I've added the project to google code, I don't really expect contributions but they're welcome nonetheless. Link to repository is in the 'source code' section on first page.

mr.bear

UPDATE: I've added lots of missing files to the google code project, and set up the wiki/issues and listed the status of the issues from the first page. It should now be usable.
Rapunzel, Rapunzel, let down your bear...

User avatar
Aldebaran_Prime
Posts: 1386
Joined: Sat, 20. Feb 10, 17:47
x4

Post by Aldebaran_Prime » Sun, 18. May 14, 21:21

Here the language file where XS2 crashes. Hope you can download it - I never tried OneDrive to share something before...

"https://onedrive.live.com/?cid=FF929D21 ... 929657!103"

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

Post by Jakesnake5 » Wed, 28. May 14, 15:13

Crash when trying to load the Steam version of X3:Reunion. Point of crash is when it's trying to load the 440001 language file.

Crash report:

Code: Select all

Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	XStudio2.exe
  Application Version:	1.0.0.0
  Application Timestamp:	533836b2
  Fault Module Name:	MSVCR120.dll
  Fault Module Version:	12.0.21005.1
  Fault Module Timestamp:	524f7ce6
  Exception Code:	40000015
  Exception Offset:	000a7676
  OS Version:	6.1.7601.2.1.0.256.48
  Locale ID:	1033
  Additional Information 1:	2d36
  Additional Information 2:	2d367e0fd672fe98d183554358525913
  Additional Information 3:	93ef
  Additional Information 4:	93ef5756abf3ec248f2b152498ee3b6e
The OP says to dl the x86 version of the MSVC 13 redistribution. I did, but your program seems to ignore it in favor of 12.

However, when I check the Resource monitor for the program, it shows version 10 is also loaded by XStudio 2 beta 3. Should that happen?

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

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

JakeSnake5,
the honest answer is I don't know. I'll have to look into it.

However on another note - are you sure it's crashing for the 440001 file and not the file immediately afterwards? eg. your lowest numbered language file after 0001. Please can you post the 'Console.rtf' file generated in the x-studio folder? (or email xstudio.development@gmail.com)

Sorry for the delay btw
mr.bear

UPDATE: Nicoman35/AldeberanPrime - I've fixed the issues you were having, they'll be included in the next update
Rapunzel, Rapunzel, let down your bear...

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

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

I don't really need XS2 for Reunion, Exscriptor handles it just fine. It's the 'do if's that give it issues and I use XS2 for in TC and AP.

Other issues:
I also have encountered, Cycrows Plugin Manager causes problems with the t file 0901-L044.pck and the types file TWareT.pck. Specifically, XS2 crashes when it tries reading them.

Posabily because they are packed. When I remove them from their respective directories, XStudio 2 has no trouble loading all other files.

The missing text file isn't a major issue, but the data in the TWareT file means some scripts have invalid data that they reference from it.

I then UN-pck'd them, replacing the pcks with the xmls, and XS2 loaded them ok. There were several non-critical errors with the TwareT, but that's understandable. So something with the pack format is confusing XS2 enough to cause it to crash.

I also have a file from the MARS scripts that it just won't save, with a couple of errors. 1 is typical of external editors I think, but another is odd.

First one, is the use of ' in a string. Specifically:

Code: Select all

      send incoming message 'MARS 9000:  I'm sorry Dave, I'm afraid I can't do that.' to player: display it=[TRUE]
XS2 interprets the 2nd ' as the end of the string, and get's lost there after. :) Exscriptor has issues with strings like this as well, so I don't know how that could be resolved (other than using a place holder and typing the string in while in the game, after all editing is done).

Another is reported as: type mismatch - '[THIS]' is not a valid Var/Script Data Type '[THIS]'

This appears in the script line:

Code: Select all

   $RefPos = [THIS] -> call script 'lib.ut.pos.from.2.grades.and.rad' : alpha=null beta=null dis=-8000 pos.argument=[THIS]
I do believe it's the 2nd [THIS] (it shows in red, not yellow) that it has trouble with.

Last problem is the search function. I'm not sure it's working right. I tried to find the word 'Repair' in Current Document (actually, tried all 'Look In' sections, only Scripts worked) and got the error:

The operation is invalid: Unsupported target type

Sink: GUI::Windows::FindDialog::OnFind_Click() on line 213
Source Logic::Threads::SearchWorkerData::SearchWorkerData() on line 52

Searching in Scripts seems to work just fine.

Beyond those problems, I find XS2 excellent. Thanks for the program. :)

EDIT:

The TWareT.pck file

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

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

hi JakeSnake,
Yes the current version can't handle packed files, that's the problem Nicoman and AldeberanPrime were having, but I've fixed that now. (0901-L044.pck + TWareT.pck)

apostrophes in strings will take me a little while to figure out, so i'll open an issue for that and work on it later.

Code: Select all

$RefPos = [THIS] -> call script 'lib.ut.pos.from.2.grades.and.rad' : alpha=null beta=null dis=-8000 pos.argument=[THIS]
the reason this doesn't compile is due to a new compiler setting: type checking script-call arguments. (You can disable it in preferences) It's saying the type of the "pos.argument" argument is "Var/Script Data Type" (eg. Int, String, Array) and you're trying to pass [THIS], which is inappropriate.

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

Post Reply

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