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

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Thu, 15. Sep 11, 05:33

Something you can do to change the font size is
1) Get focus on the particular area (e.g. the main text area or the numbered area)
2) Hold control, spin the mouse wheel forwards


Although you will have to do this every time you reopen the exscriptor.


---
@Whimsy
Any chance we can get the source code?

Phezzan
Posts: 79
Joined: Mon, 12. Nov 07, 05:48
xr

Post by Phezzan » Thu, 22. Sep 11, 07:47

Did not know that! (despite using it in FF all the time)

Sweet! I can resize the line numbers !!!...
...

Ah, but the window redraw resets the text size as soon as you type a character.

:(

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

Post by Shimrod » Tue, 20. Dec 11, 00:20

I've uploaded some files to support exscriptor AP compatibility:
http://forum.egosoft.com/viewtopic.php?t=312689

My notes on getting exscriptor working with X3AP:-

To let exscriptor load up scripts with X3AP commands:
1. Extract 0001-L044.xml from addon\01.cat
2. Copy out text ids 1538 through 1618 into exscriptor's X3TCCommandParameters.xml
3. Decorate the new items with <command>, <type> and -> using existing entries as examples.

To let the new commands be inserted via the editor, add corresponding entries into X3TCCommandList.txt and organize to taste.

To let exscriptor see the new AP constants (e.g. Bullet.IgnoreShield):
1. Extract and edit a copy of addon\01.cat's 0001-L044.xml
2. Copy the constants from table 382002 into the 2002 table.
3. Package this into a cat file at <root>\t\0001-L044.pck
4. Set exscriptor's mod/cat file option to point at the new cat file
5. Restart exscriptor : constants should appear in the menu

Notes:

The constants aren't the only items exscriptor doesn't see. For example new ship entries. Though for my purposes I only needed to make availble the constants.

0001-L044.xml contains 3 page nodes for constants: 2002, 352002, 382002. The last 2 appear to be extensions to the original table, where the AP constants appear in 382002.

Exscriptor sees the 35 extension table but not the 38 table, where the 35 table contains wing constants. Wings are recent and exscriptor hasn't been updated for a while, so the question is why does exscriptor see the 35 extension table and not the 38 one?

I suspect exscriptor must find extension table IDs by consulting some other table, but what may be happening in the AP case is the new addon folder (also present inside the cat file folder structure) is confusing exscriptor and it only sees the vanilla data.

Possibly the cleanest solution would be to figure out how exscriptor identifies the extension tables, then supply this to exscriptor's mod cat file instead of the hacky method I employed for constants.

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

Post by Whimsy » Tue, 27. Dec 11, 06:13

Since Egosoft were kind enough to release a new expansion to lure me back, and since I had a few free days, I updated the Exscriptor with proper X3AP support (bugs notwithstanding). I also went through and fixed as many old bugs as possible, and even implemented a couple of simple new additions. It's a bit late for a Christmas present, but oh well.


Responses to previous entries in the thread:

Litcube - Finally fixed the dots-in-variables bug
h2o.Ava - Fixed the tradeskill bug.
ScRaT_GER - Preprocessor functions as you proposed are very possible, and I gave it a go in 1.2.40, but after running into a few issues it seemed like it'd take more time than I was willing to spend on it.
darkangel666 - Unfortunately I can't implement something like that as a preprocessor macro. I don't know why it doesn't exist in game...
Roger L.S. Griffiths - Glad you managed to get the DLL working, and thanks for the offer. I may also upload the code one day but first I'd have to tidy it up or I'd die of shame if anyone ever saw it.
FriedTrix - I caught the exception, but don't know what caused it. Sorry.
Phezzan - I think you just solved the mystery of the bug ScRaT_GER always experienced; I've redone the layout to use TableLayout now, so I hope it works much better for you now.
Shimrod - Firstly, thanks for uploading the AP command parameter files; it saved me a lot of time! In return (and because it was easy to do ;)), I added a drop-down list to select open scripts, and also added a 'script set' load/save as a kind of crude workspace.
Shimrod wrote:Exscriptor sees the 35 extension table but not the 38 table, where the 35 table contains wing constants. Wings are recent and exscriptor hasn't been updated for a while, so the question is why does exscriptor see the 35 extension table and not the 38 one?

I suspect exscriptor must find extension table IDs by consulting some other table, but what may be happening in the AP case is the new addon folder (also present inside the cat file folder structure) is confusing exscriptor and it only sees the vanilla data.

Possibly the cleanest solution would be to figure out how exscriptor identifies the extension tables, then supply this to exscriptor's mod cat file instead of the hacky method I employed for constants.
To answer your questions, in case you're still curious, the 35xxxx pages were added by X3TC, so I added those when I added X3TC support. Exscriptor didn't know to look for the 38xxxx pages at all, but hopefully it gets all the new information correctly now, although X3AP still had a few strange surprises in store that I had to work around.


On Cat/Dats, TFiles, and mods

Speaking of cat/dat files and mods, in theory Exscriptor should have been able to load both external language (.xml) and T files (.txt) from mod cat/dat files for a while now, and yet nobody seems to have been able to get it to work. I took another look at it for 1.2.40 and it seemed to work when I tested it on the XRM mod (after a few bug fixes). If anyone's still having problems with it, let me know ASAP while I still have time to look into it, and I'll try to sort it out once and for all.


Latest Version

Anyway, V1.2.40 is available in the usual place. Apart from X3AP support, highlights include:

- Drop down list to select tabs.
- Better layout to support non-standard font sizes etc.
- Fixes to the font sizes (line numbers should now finally change size properly with the rest of the fonts - yay!).
- Loading and saving of 'script sets': basically lists of open scripts. You can save your list of currently open scripts to a file, close them all, then open the script set file and Exscriptor will reload the full set of scripts again. It's not a proper workspace/project solution, but hopefully it's still useful.
- Following a great idea from mr.bear, I renamed the "random value from 0" command to "random value from zero" to avoid ambiguity.
- Made some fixes to the cat/dat loading, so hopefully it should load from TFiles properly now (but see note above).
- Several other fixes to other things, especially wing commands and a few other compiler bugs.

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

Post by Shimrod » Tue, 27. Dec 11, 15:47

Thanks Whimsy. I had a problem initially with 1.2.40 'could not load X3AP data', but I found that this fixed itself if I configured X3TC paths in addition to X3AP ones.

I love the script set feature and the dropdown with alphabetical order.

A minor point, if its not too much trouble perhaps the dropdown could size to fit more than 8 entries as a future enhancement. It's easy enough to scroll it with the mouse wheel otherwise though.

Cheers

User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER » Tue, 27. Dec 11, 17:00

Hi Whimsy,

nice to see you back.
Is there any chance you could make the source code available (i.e. on GitHub)? I think there are quite a few who'd be willing to contribute and it could be a good source of knowledge.
ScRaT_GER - Preprocessor functions as you proposed are very possible, and I gave it a go in 1.2.40, but after running into a few issues it seemed like it'd take more time than I was willing to spend on it.
Yes, I know. I'm currently trying to implement them myself (in a project of my own). Besides that, compiling is still a problem (especially resolving jumps), so it'll be a while until I get there.

Greetings,
ScRaT

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

Post by Shimrod » Sun, 1. Jan 12, 17:58

2 of the 'get user input' command entries are missing '->' in the TC and AP command parameters files. I suspect:

%1 %0 get user input without sector
%1%0 get user input

Needs to be:

%1 %0->get user input without sector
%1 %0->get user input

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

Post by Whimsy » Mon, 2. Jan 12, 18:15

Shimrod wrote:2 of the 'get user input' command entries are missing '->' in the TC and AP command parameters files.
Well spotted - I've fixed them now. I also extended the size of the drop-down tab selection box thingy.
ScRaT_GER wrote:Is there any chance you could make the source code available (i.e. on GitHub)? I think there are quite a few who'd be willing to contribute and it could be a good source of knowledge.
Perhaps. :wink:

Anyway, latest version (V1.2.41) is available on the first page or here.

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

Post by Shimrod » Mon, 2. Jan 12, 21:02

Thanks, the dropdown now encompasses all of Smart :)

Minor issue: after renaming a script the name isn't changed in the dropdown selector. The renamed script can no longer be tabbed to in the dropdown under its old name.

User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER » Fri, 6. Jan 12, 12:19

Perhaps. ;)
That would be cool.

A small bug I'm encountering sometimes: When opening Exscriptor it is minimized and cannot be maximised. I noticed that it always sets "window maximised" to False and also the "window y pos" gets a huge negative value (something like -32700 (maybe -2^15?)). To get it working again I have to delete these values from the config.dat.
Unfortunately I don't know how to reproduce that bug.

Greetings,
ScRaT

Sir_Maniac
Posts: 2
Joined: Sun, 26. Apr 09, 08:57
xr

Post by Sir_Maniac » Sat, 7. Jan 12, 04:46

Hey, Whimsy. First let me thank you for all your hard work in making Exscripter, I am very grateful to have it and use it more then I do the MCSI.

If you are looking for input on exscriptcmd, I have a couple of bugs to report, and a suggestion for an enhancement to make it easier to use:

1. I have noticed that it expects some data files to be in the current directory, forcing one to start it in the directory it is installed. I recommend you add code that searches for those files in the same location as the executable instead of just the current directory. (for example you can use the directory name argv[0], except if the program was in the PATH)

I get the following error when using an absolute path name (e.g. "K:\devel\workspace\makeitso\modules\x3tc\scripts\*.txt"):

Code: Select all

Unhandled Exception: System.ArgumentException: Second path fragment must not be a drive or UNC name.
Parameter name: path2
   at System.IO.Path.InternalCombine(String path1, String path2)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)http://forum.egosoft.com/viewtopic.php?t=211689
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at CmdLineVersion.Program.Main(String[] args)
And a different error attempting to use a relative path (e.g. "..\scripts\*.txt"):

Code: Select all

Unhandled Exception: System.ArgumentException: Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory names, as in "a..b".
   at System.IO.Path.CheckSearchPattern(String searchPattern)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at CmdLineVersion.Program.Main(String[] args)

wga
Posts: 34
Joined: Thu, 19. Feb 09, 15:04

Post by wga » Wed, 25. Jan 12, 03:32

Huh, maybe this is a syntax checking bug

Use the example on
http://forum.egosoft.com/viewtopic.php?t=296301
will get a red line for
$marine.fight.skill = $marine -> get marine fighting skill

saying

Code: Select all

Saving file...
Save failed because of compilation errors - please compile again
Save failed due to compilation errors!
- Error on line 6 - Unrecognised symbol in expression: get
It seems that Exscriptor can not recognise all 'get marine xxx skill'

Using Exscriptor, Version 1.2.41, Released 2 January 2012

mib666007
Posts: 78
Joined: Fri, 27. Jan 12, 04:32
x3tc

Post by mib666007 » Wed, 1. Feb 12, 22:22

What am I doing wrong for set-up? for Albion :

addon

C:\Program Files (x86)\Steam\steamapps\common\x3 terran conflict\addon

scripts

C:\Program Files (x86)\Steam\steamapps\common\x3 terran conflict\addon\Scripts

Mod/cat dat

C:\Program Files (x86)\Steam\steamapps\common\x3 terran conflict\addon\01.cat

Says "Could not load X3AP data" always ...

AshToDust
Posts: 166
Joined: Thu, 5. Jan 12, 11:12
x3tc

Post by AshToDust » Thu, 9. Feb 12, 19:59

Got the same issue but my path for Mod/cat don't take the 01.cat into account ;)

Maybe your issue is there. But well, I hope not, I would like not to be the only one with that issue :D

EDIT : just got it resolved! You have to specify X3:TC options too! Then it takes 10 secondes to me to load data and I was operationnal :)

moviemaker100
Posts: 25
Joined: Sat, 4. Feb 12, 00:46

Post by moviemaker100 » Sat, 11. Feb 12, 00:24

Has anyone any idea in which files I could edit away the "jet trails" of ships ?

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

Post by DrBullwinkle » Mon, 20. Feb 12, 03:05

Thank you for the excellent tool, Whimsy. It is much easier to write good code with Exscriptor than with the Script Editor!

Report: Version 1.2.41 cannot decode ware names use by the Color Coded Freight Menu Mod, which adds color codes to t\0004.xml.

Workaround: Uninstall Color Coded Freight Menu Mod before editing session, then reinstall when done. :)

A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Problem

Post by A.Persyn » Sat, 25. Feb 12, 10:42

Greetings,

Thanks for a great program, I wouldn't be writing any scripts if Exscriptor didn't exist.

Unfortunately, I have a bug report. Ever since the X3AP 2.0 update, when a script is opened (X3AP Mode) that contains "skip if not," Exscriptor 1.2.41 changes it to "do if," which is a Mission Director command. And it returns a fatal error when trying to save the script because it doesn't recognize "do if" as being valid.

If it is changed back to "skip if not" and saved, everything is fine until the script is closed and reopened where is goes back to "do if" again.

EDIT1: Correction: it's a mistake in the T-file not Exscriptor. I'll submit a bug report to EGOSOFT.

EDIT2: Apparently, it is not a mistake in the T-file but rather an intended change by EGOSOFT. "skip if not" is now "do if" but Exscriptor doesn't recognize it as being valid.

Have a nice day!

A.Persyn

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

Post by Litcube » Sun, 26. Feb 12, 20:31

A.Persyn is correct.

It's also having trouble opening some new 2.0 scripts such as:

Graph.get.data
Graph.pl.obj.killed
Graph.pl.property.bysector

They don't load at all. "Loading..."

AshToDust
Posts: 166
Joined: Thu, 5. Jan 12, 11:12
x3tc

Post by AshToDust » Mon, 27. Feb 12, 20:17

Great tool!

I would like to see an improvment : would it be possible to organize opened file by name in a tree, each dot in name being a node of that tree?

exemple

plugin
-- myMod
---- script1
---- script2
-- yourMod
---- script1
---- script2

It would make this editor the ultimate script resource for mod with lot of script :)

chms
Posts: 165
Joined: Thu, 21. Oct 04, 19:17
x4

Post by chms » Sun, 4. Mar 12, 18:51

Thanks für this great tool.

Could have saved much work if I only found earlier ;)

Besides of the "skip if not" problem mentioned above would it be possible to:
  • Add a copy/paste to context menu?
  • Make variables, expressions and text in brackets (like "<RetVar/IF>" - including the brackets), selectable as whole?
  • Make conditions collapsable (would make finding of misplaced or missing ENDs much easier)?
Maybe I missed answers to my requests but reading 34 pages of text in other than my native language isn't very easy to me...
In this case: Sorry - but please tell me the page the information can be found. Thanks.

Post Reply

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