Exscriptor - new external script editor
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Exscriptor - new external script editor
==========
EXSCRIPTOR
==========
Summary
----------------
The Exscriptor is an (unofficial) external script editor for X2, X3, X3TC, and X3AP that allows you to:
- Open existing X2/X3/TC/AP scripts in both .XML and .PCK format
- Create new X2/X3/TC/AP scripts (.XML)
- Compile the script to check for any syntax errors
- Save scripts as .XML or in simple .TXT format
The editor uses the X2, X3, X3TC, and/or X3AP data files, so all the possible commands, wares, ships, stations and so forth will be available, including those present in unpacked mods or patches (but not files in the 'mods' directory). The program also supports the use of data files in different languages (though the editor's interface and the script commands themselves are only in English). Since X3 offers a large number of commands and objects, these are visible in a list onscreen, so you do not have to remember them all.
You will need Windows and the Microsoft .NET Framework for the program to run. You will also need either X2 or X3 or X3TC or X3AP installed (or all of them) as the editor uses the game's data files - it will ask you where to find them when it first runs.
Screenshot of interface: screenshot
Features of current version includes:
- Command Line version
- Preprocessor macros like foreach, for loops, and inline array initialisation.
- Prototype Script comparator, highlighting differences between two scripts.
- Checking of scripts for things like use of unassigned variables, invalid expressions, and if/while commands not matching up with corresponding else/ends.
- Backs up scripts (copying as a .bak) before overwriting them.
- Conflict viewer: view ID conflicts in language files.
- Change appearance - colours and fonts etc
- Check to see if script file has changed since you loaded it
- Lots and lots of bug fixes!
Current version is:
Version 1.2.43 - X3AP support, several more bug fixes and a few other minor improvements
Alternatively, why not try out mr.bear's X-Studio - a newer script editor with even more features?
Downloads:
V1.2.43 (For X3AP, X3TC, X3, and X2)
-------------------------------------
Use at your own risk and make regular backups!
From Blackpanthergroup (courtesy of Blacky_BPG - thanks!)
Available as an installer here or as a zip here.
From Mediafire:
Available as an installer here or as a zip here.
Thanks to all the people who have pointed out bugs and suggested improvements so far!
[Edited to update links to V1.2.43]
EXSCRIPTOR
==========
Summary
----------------
The Exscriptor is an (unofficial) external script editor for X2, X3, X3TC, and X3AP that allows you to:
- Open existing X2/X3/TC/AP scripts in both .XML and .PCK format
- Create new X2/X3/TC/AP scripts (.XML)
- Compile the script to check for any syntax errors
- Save scripts as .XML or in simple .TXT format
The editor uses the X2, X3, X3TC, and/or X3AP data files, so all the possible commands, wares, ships, stations and so forth will be available, including those present in unpacked mods or patches (but not files in the 'mods' directory). The program also supports the use of data files in different languages (though the editor's interface and the script commands themselves are only in English). Since X3 offers a large number of commands and objects, these are visible in a list onscreen, so you do not have to remember them all.
You will need Windows and the Microsoft .NET Framework for the program to run. You will also need either X2 or X3 or X3TC or X3AP installed (or all of them) as the editor uses the game's data files - it will ask you where to find them when it first runs.
Screenshot of interface: screenshot
Features of current version includes:
- Command Line version
- Preprocessor macros like foreach, for loops, and inline array initialisation.
- Prototype Script comparator, highlighting differences between two scripts.
- Checking of scripts for things like use of unassigned variables, invalid expressions, and if/while commands not matching up with corresponding else/ends.
- Backs up scripts (copying as a .bak) before overwriting them.
- Conflict viewer: view ID conflicts in language files.
- Change appearance - colours and fonts etc
- Check to see if script file has changed since you loaded it
- Lots and lots of bug fixes!
Current version is:
Version 1.2.43 - X3AP support, several more bug fixes and a few other minor improvements
Alternatively, why not try out mr.bear's X-Studio - a newer script editor with even more features?
Downloads:
V1.2.43 (For X3AP, X3TC, X3, and X2)
-------------------------------------
Use at your own risk and make regular backups!
From Blackpanthergroup (courtesy of Blacky_BPG - thanks!)
Available as an installer here or as a zip here.
From Mediafire:
Available as an installer here or as a zip here.
Thanks to all the people who have pointed out bugs and suggested improvements so far!
[Edited to update links to V1.2.43]
Last edited by Whimsy on Wed, 24. Jul 13, 01:01, edited 84 times in total.
- Blacky_BPG
- Posts: 2030
- Joined: Mon, 23. Feb 04, 23:42
Ok, the idea is great, i love external SE for use with X3.
I used the X3-ExternalScriptEditor by Cool_SnipeR ... and i like it.
I wanted to test yours now because he reads the data directly from the X3 directory there.
But now the Problem:
My configuration of X3:
- RAW-Mode (all cat/dat unpacked -> NO cat/dat in X3 dir)
- ONLY 49xxxx textfiles in t directory (yes, i changed the config.dat language to 49)
- XTM installed
QUESTION 1:
Can you add a advanced ErrorMessage with the file name to find the invalid character. Line 18961, position 1 file???
QUESTION 2:
I could not try it out yet but reads your program the script commands from the <codearray> or from the <sourcetext> section of a Script?
I used the X3-ExternalScriptEditor by Cool_SnipeR ... and i like it.
I wanted to test yours now because he reads the data directly from the X3 directory there.
But now the Problem:
Code: Select all
Unhandled Exception: System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 18961, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Int32 pos, Char invChar)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean prese
rveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at X3_Script_Editor.XData.loadLanguageFiles()
at X3_Script_Editor.XData.initialise(String pathToX3, String lang)
at X3_Script_Editor.Editor.Initialise()
at X3_Script_Editor.Editor..ctor()
at X3_Script_Editor.Editor.Main()
- RAW-Mode (all cat/dat unpacked -> NO cat/dat in X3 dir)
- ONLY 49xxxx textfiles in t directory (yes, i changed the config.dat language to 49)
- XTM installed
QUESTION 1:
Can you add a advanced ErrorMessage with the file name to find the invalid character. Line 18961, position 1 file???
QUESTION 2:
I could not try it out yet but reads your program the script commands from the <codearray> or from the <sourcetext> section of a Script?
*Blinks* I wish I had heard of one of these sooner..
Dont suppose anyone could link me to the other so I can compare them?
Btw, how come neither are listed in the tutes + resources sticky
*Edit*
I'm having troubles running it, I'm running on Windows XP Service pack.. something with Net framework 3.5 and it wont open. When I start it goes to the command prompt black screen, I select my install directories, then that closes and it gives a generic error message
Exscriptor.exe has encountered a problem and needs to close. We are sorry for this inconvenience.
Dont suppose anyone could link me to the other so I can compare them?
Btw, how come neither are listed in the tutes + resources sticky
*Edit*
I'm having troubles running it, I'm running on Windows XP Service pack.. something with Net framework 3.5 and it wont open. When I start it goes to the command prompt black screen, I select my install directories, then that closes and it gives a generic error message
Exscriptor.exe has encountered a problem and needs to close. We are sorry for this inconvenience.
Okay, update on this - I tested it on a fresh install (X3 v2.5) with just the EMP and yes, it does work - but only wares that have been given names in a language file will show up. So if you want to use an EMP ware in the editor you need to give it a name first.Draakon wrote:Does this support EMP?
I've updated the program to beef up the error reporting - it should be better at reporting errors and now a log file (errorlog.txt) is made too. You can get the new version here - just unzip and copy over the old one (I'll edit the first post to update the links in a minute).Blacky_BPG wrote:Can you add a advanced ErrorMessage with the file name to find the invalid character. Line 18961, position 1 file???
I'm a bit confused by your error though - I'm pretty sure it's having trouble loading your 490001.xml (that's the one I forgot to add the filename to). Could you open up that file and check that location to see if there's anything weird there? It shouldn't be the raw/unpacked stuff that's the problem - I tested that and it seems to work okay.
It reads from the codearray. The program basically ignores the sourcetext when loading a script; when saving a new script it will generate both the codearray and the sourcetext so it should be visible both in and out of the game.Blacky_BPG wrote:I could not try it out yet but reads your program the script commands from the <codearray> or from the <sourcetext> section of a Script?
It sounds like you might not have the latest .NET Framework installed. You can obtain it from Microsoft here - see if that fixes the problem.s9ilent wrote:I'm having troubles running it, I'm running on Windows XP Service pack.. something with Net framework 3.5 and it wont open.
It does now I've updated it. I improved the error detection too so hopefully it'll give us more information about why its crashing. It sounds like something is probably going wrong when loading the data files - what sort of mods/scripts do you have installed, if any? Maybe it's getting confused by one of them.s9ilent wrote:I don't suppose your program makes an error log somewhere?
If the new version doesn't help, I might try adding in some sort of option to temporarily disable loading of extra/mod files, to help narrow it down.
Ok, I've run the new version now (1.001) and it opens, but it says...
Error Log
---------
Exception occurred:
Message: Could not read from the main language XML file, 440001.xml: '.', hexadecimal value 0x00, is an invalid character. Line 18794, position 1.
Stack Trace: at X3_Script_Editor.XData.loadLanguageFiles()
at X3_Script_Editor.XData.initialise(String pathToX3, String lang)
at X3_Script_Editor.Editor.Initialise()
Source: X3 Script Editor V3
Target: Void loadLanguageFiles()
-------------------------------------------
I'm making my own mod atm, so I've got a few extra scripts and my own cat/dat (but its a mod and uses 447042 or something like that, and not false patched or anything)
My x3 directory is very messy thou as its actually 8 gb, (i'm guessing 3 from the game, 5 from me unpacking all the games files)
Where is it trying to read the file from?
Error Log
---------
Exception occurred:
Message: Could not read from the main language XML file, 440001.xml: '.', hexadecimal value 0x00, is an invalid character. Line 18794, position 1.
Stack Trace: at X3_Script_Editor.XData.loadLanguageFiles()
at X3_Script_Editor.XData.initialise(String pathToX3, String lang)
at X3_Script_Editor.Editor.Initialise()
Source: X3 Script Editor V3
Target: Void loadLanguageFiles()
-------------------------------------------
I'm making my own mod atm, so I've got a few extra scripts and my own cat/dat (but its a mod and uses 447042 or something like that, and not false patched or anything)
My x3 directory is very messy thou as its actually 8 gb, (i'm guessing 3 from the game, 5 from me unpacking all the games files)
Where is it trying to read the file from?
As far as I'm aware (I use doubleshadow's library to open the files), it should try to load an unpacked file first, then a packed one if it can't find that, then the one in the cat/dat as a last resort, so if you have 440001.xml or 440001.pck in your "\t" directory it should load that one. If your directory is really complex though I'm not sure which versions of all the different files will get loaded in the end...s9ilent wrote:I'm making my own mod atm, so I've got a few extra scripts and my own cat/dat (but its a mod and uses 447042 or something like that, and not false patched or anything)
My x3 directory is very messy thou as its actually 8 gb, (i'm guessing 3 from the game, 5 from me unpacking all the games files)
Where is it trying to read the file from?
I've uploaded a new version (1.002) that should hopefully fix the hexadecimal value 0x00 problem though, so try that.
- Blacky_BPG
- Posts: 2030
- Joined: Mon, 23. Feb 04, 23:42
@s9silent
Here the link for the ExternalScriptEditor by Cool_SnipeR:
Version 0.9.9.0 RC1
Hotfix 0.9.9.1
But I think if the Exscriptor running fine it would be better to use this tool because the Exscriptor reads the data directly from the X3 directory.
Version 1.003(*) can't read & in text files, but this is a smaller error. I fixed the & to an +. But now I have this error at programm start:
And yes, the 0x00 error is fixed up now.
Second test: I've made a cat/dat with the t and types directory and start Exscriptor again, the error is the same.
(*) The new Version in the program (Help -> About) is 1.003 not 1.002.
Here the link for the ExternalScriptEditor by Cool_SnipeR:
Version 0.9.9.0 RC1
Hotfix 0.9.9.1
But I think if the Exscriptor running fine it would be better to use this tool because the Exscriptor reads the data directly from the X3 directory.
Version 1.003(*) can't read & in text files, but this is a smaller error. I fixed the & to an +. But now I have this error at programm start:
Code: Select all
Exception occurred:
Message: Object reference not set to an instance of an object.
Stack Trace: at X3_Script_Editor.XData.loadLanguageFiles()
at X3_Script_Editor.XData.initialise(String pathToX3, String lang)
at X3_Script_Editor.Editor.Initialise()
Source: X3 Script Editor V3
Target: Void loadLanguageFiles()
Second test: I've made a cat/dat with the t and types directory and start Exscriptor again, the error is the same.
(*) The new Version in the program (Help -> About) is 1.003 not 1.002.
Which text file? If it's a .XML file then the & sign will cause problems, but you can get around it by replacing an & with &. It'll load in Internet Explorer then too. Similarly if you need to use < or >, which have the same problem, you can replace them with < and >.Blacky_BPG wrote:Version 1.003(*) can't read & in text files, but this is a smaller error. I fixed the & to an +
Hmm. I've tried to figure out what's causing this, so let's see if I've guessed right with the new version. If I'm right, it was trying to load from a page id that wasn't there.But now I have this error at programm start:
Exception occurred:
Message: Object reference not set to an instance of an object.
"If" being the important word! The other editor has some cool features though, like the autocomplete, and I think it likely has a better command parser.Blacky_BPG wrote:But I think if the Exscriptor running fine it would be better to use this tool because the Exscriptor reads the data directly from the X3 directory.
Oops... The new one definitely is 1.003 now! Though thinking about it, I forgot to change the manual...Blacky_RPG wrote:(*) The new Version in the program (Help -> About) is 1.003 not 1.002.
- Blacky_BPG
- Posts: 2030
- Joined: Mon, 23. Feb 04, 23:42
Yes, I mean an xml text file. Thats right, I can change it to &
Now I have the file for the error:
What do you mean with it was trying to load from a page id that wasn't there? The ID is not in text file or a not existing reference in a types file?
The 498400.xml is my test text file with many different data in it. If you wish you can download the file for testing: 498400.xml (in RAR)
Yeah, "IF" is important, thats right. But I am confident that the Exscriptor works soon.
AAARRGGGHH, the invalid hex 0x00 error for script files is back.
Now I have the file for the error:
Code: Select all
Error while loading: E:\X3\t\498400.xml: Object reference not set to an instance of an object.
The 498400.xml is my test text file with many different data in it. If you wish you can download the file for testing: 498400.xml (in RAR)
Yeah, "IF" is important, thats right. But I am confident that the Exscriptor works soon.
LOL, thats coolExscriptor ABOUT Menu wrote:Version 1.003 - for real this time
AAARRGGGHH, the invalid hex 0x00 error for script files is back.
I checked the file and figured out what it was - it was trying to read an ID from a comment and was getting confused.Blacky_BPG wrote:Now I have the file for the error:Code: Select all
Error while loading: E:\X3\t\498400.xml: Object reference not set to an instance of an object.
I thought it was still the xx0001 language file, and maybe trying to read a page that didn't exist in the file.What do you mean with it was trying to load from a page id that wasn't there? The ID is not in text file or a not existing reference in a types file?
AAARRGGGHH, the invalid hex 0x00 error for script files is back.
Hopefully I managed to fix it (again). New version here and I'll update the first post (again).
- Blacky_BPG
- Posts: 2030
- Joined: Mon, 23. Feb 04, 23:42
Ok, Version 1.004 has a text file comment detection included ... IT WORKS FINE WITH NO ERROR ... at the moment [ external image ]
Great Work, I have opend a large script file (470kb only codearray) without problems (a little slow maybe but I think that is my weak machine here )
Great Work, I have opend a large script file (470kb only codearray) without problems (a little slow maybe but I think that is my weak machine here )
- [EDIT]
Yeah, its my machine, ExSE open the script in same time
For now, at least! Thanks very much by the way, you've been a great help in fixing these bugs!Blacky_BPG wrote:And what I said? -> If it running fine... -->> [And its running fine.] [ external image ]
- Blacky_BPG
- Posts: 2030
- Joined: Mon, 23. Feb 04, 23:42
Yeah, for now, but when I found an error I report it immediately
I know that even. I also program a little bit. The tool for the XSP-database was more than 4 weeks in version 2 and nobody asked me about an error. Until someone has dared ... now I am at 2.2.0.3.
I know that even. I also program a little bit. The tool for the XSP-database was more than 4 weeks in version 2 and nobody asked me about an error. Until someone has dared ... now I am at 2.2.0.3.
Unknown author wrote:I can live with criticism, negative as positive. But nothing is worse than that nobody says something about my work.
I hope that I translated the quote correct
That depends on how much changes. But given that the files and scripting engine didn't change much from X2 to X3, hopefully it will only take a few minor modifications for Exscriptor to work with X3TC.Erilaz wrote:Best news (the cherry on top), would be if you have similar intensions for X3-TC.
True - I prefer to know that it's not working than to go on thinking it is when it isn't. If that makes sense...Blacky_BPG wrote:Yeah, for now, but when I found an error I report it immediately
-
- Posts: 48
- Joined: Thu, 9. Dec 04, 18:10
I'm loving the app, Whimsy!
Found an issue in CommandList.txt:
should actually be
Keep up the great work. This is exactly what I needed to get me excited again about X3, aside from TC.
Found an issue in CommandList.txt:
Code: Select all
@<RetVar/IF>wait randomly for <Var/Number> to <Var/Number>ms
Code: Select all
@<RetVar/IF>wait randomly from <Var/Number> to <Var/Number> ms