Exscriptor - new external script editor

The place to discuss scripting and game modifications for X³: Reunion.

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

Draslin
Posts: 199
Joined: Sat, 11. Feb 06, 22:07
x4

Post by Draslin » Sat, 2. Aug 08, 19:48

Awesome I have tons of plans for scripting in X3 but the clunky interface has alway frustrated me enormously. This external editor looks much cleaner and easier to use. Might have to reload X3 after all. :)
Its not a hug so much as "Help me I'm dieing!"

Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy » Sat, 2. Aug 08, 20:09

Enrico777 wrote:I told you why it's crashing underneath the crash log. It doesn't find a function to handle double clicks.
Edit: In 1.0009 it doesn't crash anymore.
It's actually crashing inside the double click handling function - which is really simple, so I couldn't see why it might be crashing. Hence my confusion. But I'm glad it's not crashing now, anyway... :wink:
Enrico777 wrote:I haven't been scripting for a while, but isn't it supposed to show clear text instead of things like COMMAND_TYPE_NAV_46? That looks to me as if it doesn't find the texts. This was happening on the other lists as well, until I fixed the files.
No, it's currently working as intended - it's supposed to use the COMMAND_WHATEVER form, since that's what the ingame editor uses. If it picks up any user defined names from other files then they should be shown beneath the default name (using +/- thingies). Multiple entries under a command mean a conflict (more than one name for the same command). Though you can actually use any of these names in a script, since in the end it all gets converted back to the same number.

Thanks for finding the other bugs, though - you've been a great help. :)
Draslin wrote:Awesome I have tons of plans for scripting in X3 but the clunky interface has alway frustrated me enormously. This external editor looks much cleaner and easier to use. Might have to reload X3 after all. :)
Glad to be of service! :D

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Sat, 2. Aug 08, 23:51

Whimsy wrote: Thanks for finding the other bugs, though - you've been a great help. :)
My pleasure! :wink:

I'll let you know if I find anything else. Thanx again for this tool!

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Sun, 3. Aug 08, 14:47

Me again!

Great manual you have written. It's actually worth reading! :)
And thanx for mentioning us there!

I've found a strange thing when making comments: I put * in front of some lines and when I reopened the script later, the commented code was changed! Here is the result:

Code: Select all

   * $Quest = $Needed $Total {==}
   * $Time = playing time
   * $Quest = $Time $End {>}
   * $Message = sprintf: pageid=$Page.ID textid=2025, $Employer, $Time, $End, null, null
   * $Message = sprintf: pageid=$Page.ID textid=2025, $Employer, $Total, $Ware, null, null
   * set quest state with message: quest=$Quest state=[Quest.Aborted] msg=$Message
   * send incoming message $Message to player: display it=[TRUE]
   * return null
   * end
   * end
It removed some ifs and put the logical operands into {} at the end of the lines. I think that's all what has changed (despite the fact that indenting is gone).

Edit: Oh, and I just got another exception "The stack is empty" - after compiling with Exscriptor:
************** Ausnahmetext **************
System.InvalidOperationException: Der Stapel ist leer.
bei System.Collections.Stack.Pop()
bei X3_Script_Editor.Compiler.finaliseJumps()
bei X3_Script_Editor.Compiler.parse(ArrayList code, ArrayList arguments)
bei X3_Script_Editor.Editor.menuCompile(Object sender, EventArgs e)
bei System.Windows.Forms.MenuItem.OnClick(EventArgs e)
bei System.Windows.Forms.MenuItem.MenuItemData.Execute()
bei System.Windows.Forms.Command.Invoke()
bei System.Windows.Forms.Command.DispatchID(Int32 id)
bei System.Windows.Forms.Control.WmCommand(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The log is empty, too. :wink:

Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy » Sun, 3. Aug 08, 15:59

Enrico777 wrote:Great manual you have written. It's actually worth reading! :) And thanx for mentioning us there!
No problem! Glad someone read it. :)
Enrico777 wrote:I've found a strange thing when making comments: I put * in front of some lines and when I reopened the script later, the commented code was changed!
I must have forgotten to add this to the known bug list in the manual. If you use conditionals in a commented out command (like an if, or a while) then the Exscriptor basically ignores them since it cannot calculate where the corresponding end might be. That's why your ifs are disappearing (and thus the indentation).

However, there might still be something weird going on with those operators - could you post the original code, before the Exscriptor screwed it up? That way I can recreate the problems myself and hopefully fix them. :)

Alternatively I might just change it to ignore commented commands altogether and just treat them as text, since they're more trouble than they're worth... You'd only notice the difference if you tried to uncomment it in the ingame editor anyway.
Enrico777 wrote:Edit: Oh, and I just got another exception "The stack is empty" - after compiling with Exscriptor:
Hmm, I think I know what caused that - it's probably because the ends don't match up with ifs or whiles (or vice versa). I'll fix it in the next version.

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Sun, 3. Aug 08, 17:39

Whimsy wrote: However, there might still be something weird going on with those operators - could you post the original code, before the Exscriptor screwed it up? That way I can recreate the problems myself and hopefully fix them. :)
Sure, there you go:

Code: Select all

   if $Needed == $Total 
      $Time = playing time
      if $Time > $End 
         $Message = sprintf: pageid=$Page.ID textid=2025, $Employer, $Total, $Ware, null, null
         set quest state with message: quest=$Quest state=[Quest.Aborted] msg=$Message
         return null
      end
   end

Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy » Mon, 4. Aug 08, 01:57

Okay, I've rummaged around a little in the innards of the Exscriptor and fixed a few problems, resulting in V1.010. In particular:

- fixed the weird {==} thing that appeared
- fixed a subtle problem with the script loading process that meant it was unable to check the parameters of call commands (it will now tell you if you try to use too many parameters)
- changed it so that all comments are now compiled as simple text, not as commands (this means you won't be able to uncomment them in the game, but does mean there will be less bugs). Note you can still load commented commands as normal.

And with any luck, I haven't broken anything important in the process. :D

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Mon, 4. Aug 08, 09:43

Whimsy wrote: - fixed the weird {==} thing that appeared
- fixed a subtle problem with the script loading process that meant it was unable to check the parameters of call commands (it will now tell you if you try to use too many parameters)
- changed it so that all comments are now compiled as simple text, not as commands (this means you won't be able to uncomment them in the game, but does mean there will be less bugs). Note you can still load commented commands as normal.
Great! I wanted to post the problem with the call commands yesterday, but I thought you already noticed - and now you even fixed it. :)
Btw, I successfully wrote a script with Exscriptor yesterday. Only one Exception(most probably my own fault) and one odd situation afterwards. Nothing to worry about. :wink:

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Mon, 4. Aug 08, 20:04

Relaxed Compiler:
-> Your compiler doesn't moan about this:

Code: Select all

      
if $min_tc == $tc_array_s [$tc_a_i]

But it seems to be invalid code (or another problem) because this is what the internal editor makes of it:
[ external image ]
The red thing is counted as a variable by the internal editor. So I had to separate that into two lines.


-> Also I tried to assign multiple values to an array (before I learned that it's not possible) like this:

Code: Select all

      
$array = 'A', 'B', 'C'

That was totally okay for your compiler, while it doesn't work in X3. Maybe it's possible to block that to make noobs like me realize that it won't work? :wink:


Request:
Could you add drag and drop to the script window? I have lots of scripts in the folder and usually close the script when I (think I) am done. So I always have to scroll to the right script. Just a minor request if it's easy to do. :)

Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy » Tue, 5. Aug 08, 02:19

Enrico777 wrote:Relaxed Compiler:
-> Your compiler doesn't moan about this:

Code: Select all

      
if $min_tc == $tc_array_s [$tc_a_i]

But it seems to be invalid code (or another problem)
Ah, expressions. I loathe parsing these things - virtually anything goes. But in this case, it is invalid - I'm pretty sure that you can't use array variables like that; you have to extract the value out first. It would be easier but X3 sadly doesn't seem to allow it (though please correct me if I'm wrong).

Nevertheless, you're quite right - the compiler should pick up on it, which it now does (in theory, anyway!).
Enrico777 wrote:-> Also I tried to assign multiple values to an array (before I learned that it's not possible) like this:

Code: Select all

      
$array = 'A', 'B', 'C'

That was totally okay for your compiler, while it doesn't work in X3. Maybe it's possible to block that to make noobs like me realize that it won't work? :wink:
Yeah, this would be nice to have too! I actually thought about extending the syntax with extra features - the one I had in mind was a "for" command that would convert from

Code: Select all

for i = 0 to $size inc 1
to

Code: Select all

$i = -1
while $i < $size
   $i = $i + 1
automatically, so you could use it as a sort of shortcut or macro. Array initialisation could have been another possibility. But in the end I decided that it was a lot of effort and likely nobody would use it anyway... :D

Anyway, back to the point - V1.011 should pick up on this too (it will complain about invalid characters in the expression).
Enrico777 wrote:Request:
Could you add drag and drop to the script window? I have lots of scripts in the folder and usually close the script when I (think I) am done. So I always have to scroll to the right script. Just a minor request if it's easy to do. :)
Good idea - I wish I'd thought of it! It's now implemented in the new version. You can even open multiple files at once (just like you can the normal way). :)

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Tue, 5. Aug 08, 02:34

Yeah, this would be nice to have too! I actually thought about extending the syntax with extra features - the one I had in mind was a "for" command that would convert from

Code: Select all

for i = 0 to $size inc 1
to

Code: Select all

$i = -1
while $i < $size
   $i = $i + 1
automatically, so you could use it as a sort of shortcut or macro. Array initialisation could have been another possibility. But in the end I decided that it was a lot of effort and likely nobody would use it anyway... :D
I would. :wink: But I understand that it's a lot of work for something that isn't your fault. Exscriptor is already better than the internal editor in my opinion, so you don't have to strive for perfection. 8)

I really appreciate the time and work you invest into Exscriptor, to make it as good as possible! :thumb_up: :D :thumb_up:

Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy » Tue, 5. Aug 08, 19:18

Enrico777 wrote:I really appreciate the time and work you invest into Exscriptor, to make it as good as possible! :thumb_up: :D :thumb_up:
Thanks! I'm glad to know that it's proving useful for people. :)

Anyway, further to my comments earlier, I've cooked up a new version that allows you to use preprocessor macros. The ones I've done so far are a foreach, two for loops, and a dim - the array initialisation you mentioned. Basically, you can use them as normal commands and then before it compiles, it expands them to the equivalent script commands. For example, the foreach looks like this:

Code: Select all

foreach $x in $array
and gets converted to

Code: Select all

$iterator = size of array $array
while $iterator
   dec $iterator =
   $x = $array[$iterator]
There's also the option to have the macros put back to normal after compile, in which case hopefully you won't even notice it was there. The commands are all available in a new section of the script command list, just like the rest.

Let me know if you think of any more macros that might be useful (and not too complicated to implement!). :wink:

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Tue, 5. Aug 08, 22:55

Whimsy wrote: Anyway, further to my comments earlier, I've cooked up a new version that allows you to use preprocessor macros. The ones I've done so far are a foreach, two for loops, and a dim - the array initialisation you mentioned. Basically, you can use them as normal commands and then before it compiles, it expands them to the equivalent script commands.
Complete AWESOMENESS!!! :mrgreen:

At the moment I cannot think of other useful macros, but I am far from being a pro scripter in X3. Btw, I just finished my little script project (* 100% done with Exscriptor) so I might be scripting less until I start something new. So maybe less input from me.

Anyway, due to my laziness, I have some small requests:
- Could you add the path to /scripts automatically after selecting the X3 folder? I know, it's literally NO WORK to select two folders, but since I have set up Exscriptor quite often these days, I thought it would probably be easy to change in the setup process. :wink:
- Another request of laziness: Could you make a .bak copy of overwritten scripts, so one can easily revert to the previous version? This is actually not only laziness: I made a mistake yesterday and overwrote my modified script with the original version. So all efforts were lost. If I had a auto .bak, I could have restored the previous version before the mistake at least.
- A more serious suggestion: Would it be possible to edit Script Arguments - or change their position (move them up/down)? It's rather annoying if you "change" (delete/create) one argument, you probably have to redo the others too, to fit the hierarchy. Although it happens rarely.

You see, I am running out of bugs, starting nit-picking. :P

Edit - found more to pick:
- Would it be hard to include a search function to quickly find some code segments in the editor?
- Your Options window can be maximized. Looks odd. Okay, okay I'll stop. :D

If you still like me after this post, I would appreciate if you use my other nick 'Cebraio' in the manual - not that it would be much better, but ... yeah it is better than this crappy name that I selected. :wink:

I'll run around and do some advertising for Exscriptor now ....

Ceb.

Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy » Wed, 6. Aug 08, 03:29

Enrico777 wrote:Anyway, due to my laziness, I have some small requests:
- Could you add the path to /scripts automatically after selecting the X3 folder? I know, it's literally NO WORK to select two folders, but since I have set up Exscriptor quite often these days, I thought it would probably be easy to change in the setup process. :wink:
I got sick of having to do that as well, every time I tested a new version. Done.
Enrico777 wrote:- Another request of laziness: Could you make a .bak copy of overwritten scripts, so one can easily revert to the previous version? This is actually not only laziness: I made a mistake yesterday and overwrote my modified script with the original version. So all efforts were lost. If I had a auto .bak, I could have restored the previous version before the mistake at least.
Good idea. Done.
Enrico777 wrote:- A more serious suggestion: Would it be possible to edit Script Arguments - or change their position (move them up/down)? It's rather annoying if you "change" (delete/create) one argument, you probably have to redo the others too, to fit the hierarchy. Although it happens rarely.
Done.
Enrico777 wrote:- Would it be hard to include a search function to quickly find some code segments in the editor?
Trickier than it looks... but still Done.
Enrico777 wrote:- Your Options window can be maximized. Looks odd. Okay, okay I'll stop. :D
Fixed. Or rather, Done. :D
Enrico777 wrote:If you still like me after this post, I would appreciate if you use my other nick 'Cebraio' in the manual - not that it would be much better, but ... yeah it is better than this crappy name that I selected. :wink:
Done, since you asked so nicely. :wink:

And as a bonus feature the Exscriptor now remembers if you had any scripts open when you closed it and will reload them again next time it starts. All this and more in the sparkly new V1.013. Which means poor V1.012 was probably the shortest lived version ever... :D

CS
Posts: 13
Joined: Sat, 30. Dec 06, 03:39

Post by CS » Wed, 6. Aug 08, 04:34

I must say, even though I'm not a scripter but just a dabbler in other people's code ( :D ), I do like this handy program a lot. So I've found a few suggestions as well, although I don't really expect these to go high up on your priority list... Still:
  • Do you think it might be possible to make file tabs (when you have multiple documents open) closable on double / middle click, just like in Firefox or Visual Studio? When I "work" with scripts it's most often because I try to resolve some conflicts in different scripts, so I have to go through a lot of files following the chain of sub-scripts, most of which won't be changed at all. Of course there's Ctrl+W, but I'm a mouse guy... :oops: This is purely for convenience, really.
  • From the same approach I think a 'compare scripts' function might be useful - that is, something like WinMerge, where you choose two files that will be displayed next to each other. Highlighting of differences would be awesome, but just having them on the screen right next to each other would be great. WinMerge is useless for X-scripts because it doesn't process the .xsl file, so all the useless clutter ES uses to format the script files destroys any chance of actually noticing any differences. Exscriptor might be perfect for such a function.
  • And one more convenience item: I'd like to be able to shift the dividing bar between the code and the command panes to the right, i.e. resize them in favor of the code view pane.
I realize these might not have the best ratio of value vs. effort, but still I think they'd be handy... If nothing else, you could add these to 'possible ideas for the future'. :) Anyways, thanks for the great program!

Starcub
Posts: 84
Joined: Sat, 7. Apr 07, 23:39
x4

File Loading Problem

Post by Starcub » Wed, 6. Aug 08, 05:48

This looks like a really nifty program that obviously took some time to write, and good job on the documentation.

However, I have a problem in that none of the script files in my \t directory are loading (the files in \script load fine).

If I try to open an xml or pct file, the error log looks like this (I took the example directly from my error log file):

Code: Select all

Exception occurred: Could not read from J:\Program Files\EGOSOFT\X3 Reunion.XTM\t\443557.xml
Message: Data at the root level is invalid. Line 1, position 1.
Stack Trace:    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.Load(TextReader txtReader)
   at X3_Script_Editor.Decompiler.openScript(String scriptName, String path)
Source: System.Xml
Target: Void Throw(System.Exception)

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

Exception occurred: Could not read from J:\Program Files\EGOSOFT\X3 Reunion.XTM\t\443557.xml
Message: Found but could not read from script file: J:\Program Files\EGOSOFT\X3 Reunion.XTM\t\443557.xml ('Data at the root level is invalid. Line 1, position 1.')
Stack Trace:    at X3_Script_Editor.Decompiler.openScript(String scriptName, String path)
Source: X3 Script Editor V3
Target: System.Xml.XmlDocument openScript(System.String, System.String)

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

Exception occurred: 
Message: Found but could not read from script file: J:\Program Files\EGOSOFT\X3 Reunion.XTM\t\443557.xml ('Found but could not read from script file: J:\Program Files\EGOSOFT\X3 Reunion.XTM\t\443557.xml ('Data at the root level is invalid. Line 1, position 1.')')
Stack Trace:    at X3_Script_Editor.Decompiler.decompile(String filename)
   at X3_Script_Editor.Editor.LoadFiles(String[] fileNames)
Source: X3 Script Editor V3
Target: X3_Script_Editor.Script decompile(System.String)
Any ideas?

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Wed, 6. Aug 08, 10:19

Whimsy wrote:Which means poor V1.012 was probably the shortest lived version ever... :D
But still, will remain in my memories for being the first version to introduce for loops and easy array assignment. :wink:

Great work as usual :!:

@Starcub: This program isn't meant to open the files in the \t folder. They are text files with some xml tags, not scripts. I recommend using "Notepad 2" to open the text files.

bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate » Thu, 7. Aug 08, 15:52

I have been using the script editor with some good success, however I wanted to notify you of a couple of bugs and give some feature requests.

Probably someone already mentioned some of these but hopefully I can help you improve it.

Bug: saving a file throws an uncaught exception.
Steps to reproduce: open a new file, attempt to save it anywhere; or open an existing file and attempt to save it under a different name
Details:

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not find file "C:\Program Files\Steam\SteamApps\common\x3 - reunion\scripts\new7.xml".
File name: "C:\Program Files\Steam\SteamApps\common\x3 - reunion\scripts\new7.xml"
   at System.IO.__Error.WinIOError(Int32 errorCode, String str)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
   at X3_Script_Editor.Editor.menuSaveAs(Object sender, EventArgs e)
   at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.MenuItem.ShortcutClick()
   at System.Windows.Forms.Menu.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.ThreadContext.System.Windows.Forms.UnsafeNativeMethods+IMsoComponent.FPreTranslateMessage(MSG& msg)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2407
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
X3 Script Editor V3
    Assembly Version: 1.0.3140.2291
    Win32 Version: 1.0.3140.2291
    CodeBase: file:///C:/Documents%20and%20Settings/Bunker%20Private/Desktop/x3scripter/Exscriptor/Exscriptor.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2407
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
RegexAssembly3_0
    Assembly Version: 0.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Xml
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Accessibility
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
Bug: textfield snaps to the top after most operations:
Steps to reproduce: have a textfield which is scrollable and, use 'redo' (already documented), insert a command with a doubleclick on the scrollfield. Some others too I think.

Bug: saving with errors is not allowed
Details: I'm reporting this as a bug because it means I cannot backup my work as I go which could result in data loss.

Bug: compile never finds referenced script files.
Steps to reproduce: Eg write

Code: Select all

=[THIS]->call script 'bunker.resupply.list.cmd':
The compiler always reports an error, though bunker.resupply.list.cmd.xml is existing in the same directory as the script. Perhaps it would be better to do a kind of include file organisation, where it will first search the pathname of the current file, and then the x3 script directory. For example, on Unix, when you include a file in C, it will by default search /usr/local/include/, then /usr/include so you get to override library files in this way.

Bug: after compile, the indentation is lost.
Details: not really a bug I suppose, but it would save time to run the indent procedure automatically after saving.

Bug: assignments are given extra values
Steps to reproduce:

Code: Select all

$var = 'string literal'
When loaded in X3, the line is (note the two single quotes at the end):

Code: Select all

$var = 'string literal' ''
Bug: syntax colouring is wrong for literal array indices
Steps to reproduce:

Code: Select all

$array[0] = 'something'

The '[0' will be blue, instead of just the 0. (I just noticed this is actually noted in the documentation anyway.)

Feature requests:
- Warn for undeclared variables, eg

Code: Select all

  $errorLine = 'An error!'
  sprintf: fmt: $errorln, etc <-- results in a compiler warning due to typeo.
  
- Search function for expressions
- Descriptions for each expression (also searchable). Would be nice if you could also search the descriptions of other scripts.

Please don't mistake my pedantry with ungratefulness; this is a whole lot better than the internal script editor! It's possible that if you open the source of your program, I might be able to help in a more meaningful way though actually I'm a C++ programmer and I only looked at windows.Forms long enough to go 'yuck' and get back to my Qt program :)

Thanks for your hard work.

Atrocious
Posts: 165
Joined: Mon, 15. May 06, 20:13

Post by Atrocious » Thu, 7. Aug 08, 16:58

bunkerprivate wrote: Bug: saving a file throws an uncaught exception.
Strange, I never had any problems saving files.
bunkerprivate wrote: Bug: compile never finds referenced script files.
I think it only doesn't find them when the file wasn't there when the Editor was started - so newly created files. Maybe refreshing X3 data helps (under "Tools")?

bunkerprivate wrote: Bug: after compile, the indentation is lost.
Details: not really a bug I suppose, but it would save time to run the indent procedure automatically after saving.
Actually indenting IS run after compile. Maybe you have some errors in the script, like missing ends etc? Because then the indenting doesn't work correctly, but after fixing these things, it should work again.

I hope whimsy will come online soon to give you guys some feedback. He was very quick at fixing things lately. :)

bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate » Thu, 7. Aug 08, 22:18

Actually indenting IS run after compile.
You're right. I made a typeo: I meant after saving.
...only doesn't find them when the file wasn't there when the Editor was started
Also right, but it would still be nice if it would search the directory for you; also I caused myself problems by saving outside of the script directory. Oh and for some reason, it seemed to open all my files again when I did the reload. At least I think it did. It might just not have been paying attention properly :/

Post Reply

Return to “X³: Reunion - Scripts and Modding”