Dude, there is a sea of hooraisins in a large vat. I am reveling in this sea of hooraisins!Whimsy wrote:You can revel in your hooraisins as the new version includes this function.
Exscriptor - new external script editor
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
-
- Posts: 1585
- Joined: Wed, 19. Nov 08, 15:58
I forget to set the path to my modified .cat but if I set the path I can't open scripts and couldn't see any command/objects on the right side.Whimsy wrote:It should do, yes - Exscriptor reads the TShips file too, and as long as the entries there have corresponding entries in an XML file too (to give them a name), then they should show up. If not, then something may be wrong...
This is the text of the errorlog.txt:
Error Log
---------
Exception occurred:
Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Stack Trace: bei X3_Script_Editor.XData.resolveXMLReference(String xmlref)
bei X3_Script_Editor.XData.removeXMLrefsFromString(String text)
bei X3_Script_Editor.XData.loadLanguageFiles()
bei X3_Script_Editor.XData.initialise(String pathToX3, String lang, Int32 gameID, String modfile)
bei X3_Script_Editor.Editor.LoadX3Data()
Source: X3 Script Editor V3
Target: System.String resolveXMLReference(System.String)
-------------------------------------------
Exception occurred:
Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Stack Trace: bei X3_Script_Editor.Editor.LoadFiles(String[] fileNames)
Source: X3 Script Editor V3
Target: Void LoadFiles(System.String[])
-------------------------------------------
Exception occurred:
Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Stack Trace: bei X3_Script_Editor.Editor.LoadFiles(String[] fileNames)
Source: X3 Script Editor V3
Target: Void LoadFiles(System.String[])
-------------------------------------------
-
- Posts: 167
- Joined: Mon, 9. Feb 04, 20:32
Is there any way you can upload your modified cat/dat for me to test? That way I can try to figure out what might be going wrong in this case.Schaf123 wrote:I forget to set the path to my modified .cat but if I set the path I can't open scripts and couldn't see any command/objects on the right side.
-
- Posts: 167
- Joined: Mon, 9. Feb 04, 20:32
Coincidentally enough, it was caused by an XML comment in your XML file - normally the program should handle them fine but there was one scenario that I obviously missed...Schaf123 wrote:Here is it. Thanks for jour help
Anyway I've fixed it in the latest version, V1.2.20. Give it a try and hopefully it should work now.

-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
-
- Posts: 1962
- Joined: Tue, 8. Jan 08, 18:19
Thanks for the quick fix! Now it works without any problems.I've improved the error handling for this now so that an invalid sector ID won't stop the whole file from loading.
The new 'Find calling scripts' is a cool thing! Might be very useful in case you don't know in how far your changes to a script will influence others.
Thanks again for the excellent work.
Greets,
ScRaT
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
You you what would produce even more hooraisins?
The very opposite of the "find all calling scripts" feature.
Say you've created a massive AL plugin with 23 scripts, and you want to distribute it on the S&M forum. It'd be neat to be able to "find all scripts called" to find everything you'd need to package in order to distribute. Of course, you'd probably run it on the main AL, or the setup script to ensure you're at the bottom level.
Just sayin' s'all.
The very opposite of the "find all calling scripts" feature.
Say you've created a massive AL plugin with 23 scripts, and you want to distribute it on the S&M forum. It'd be neat to be able to "find all scripts called" to find everything you'd need to package in order to distribute. Of course, you'd probably run it on the main AL, or the setup script to ensure you're at the bottom level.
Just sayin' s'all.
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
I just wanted to say thanks again, Whimsy. That feature let me clean up ALOT of scripts! *Really* handy feature to have. Thanks for listening.Whimsy wrote:That's a good idea - you're right, it could be quite useful. I'll give it a go and see what happens.Litcube wrote:You know what would be neat? An option in the Tools menu bar that checks all the scripts in your script directory to see if the current script is being used at all, and if so, opens all those scripts. If not, it lets you know.
-
- Posts: 167
- Joined: Mon, 9. Feb 04, 20:32
Firstly, glad you found the 'Find all calling scripts' thingy useful, Litcube! But then it was your idea after all. 

I've not been ignoring this, honest - I just haven't had chance to look at it yet properly. However, I will eventually get round to it and release a new version with this function.Litcube wrote:Say you've created a massive AL plugin with 23 scripts, and you want to distribute it on the S&M forum. It'd be neat to be able to "find all scripts called" to find everything you'd need to package in order to distribute. Of course, you'd probably run it on the main AL, or the setup script to ensure you're at the bottom level.
-
- Posts: 2033
- Joined: Wed, 29. Jun 05, 01:45
Just an idea for the future version,
I don't suppose its possible to set up multiple folders for scripts?
e.g. I have all my stock scripts in the \scripts folder
And then I have all of my scripts for a particular package I'm working on in the scripts\package
Any chance you can make it work from a folder (e.g. scripts\package) but use also use all scripts in another folder (e.g. \scripts)
Also, I can't seem to find the [ACTION_JUMP]
As from fight.defend.earth
066 ||skip if not $action == [ACTION_JUMP]
But the exscriptor doesn't recognise it
Thirdly
(Lines 18 and 19)
$ship -> add secondary signal: signal={SIGNAL_KILLED}, script='test1', prio=0, name=$scr.var.data
$ship -> add secondary signal: signal={SIGNAL_DAMAGED}, script='test1', prio=0, name=$scr.var.data
- Error on line 19 - Unresolved literal: {SIGNAL_DAMAGED}
It doesn't seem to like that signal
*edit resolved
{SIGNAL_DAMAGED 1010} should be used (The select menu on the side, just uses prints it out with out the 1010 thou)
Fourthly
I don't know whether or not I've posted this before, but I've found the source of the compiler warnings that are incorrect.
if $int >= 0
$pos = [TRUE]
else
$pos = [FALSE]
$int = - $int <------------- Variable int is being used on line 11 before being assigned to.
end
But $int is an argument, so it always exists. It appears to happen when ever you use a minus sign before the variable.
Fifthly, the write to log book commands
write to log file # <Var/Number> append=<Var/Number> value=<Value> (and the other ones too)
only work if you do not include the # character. So it might be best to not include the # in the commands list
I don't suppose its possible to set up multiple folders for scripts?
e.g. I have all my stock scripts in the \scripts folder
And then I have all of my scripts for a particular package I'm working on in the scripts\package
Any chance you can make it work from a folder (e.g. scripts\package) but use also use all scripts in another folder (e.g. \scripts)
Also, I can't seem to find the [ACTION_JUMP]
As from fight.defend.earth
066 ||skip if not $action == [ACTION_JUMP]
But the exscriptor doesn't recognise it
Thirdly
(Lines 18 and 19)
$ship -> add secondary signal: signal={SIGNAL_KILLED}, script='test1', prio=0, name=$scr.var.data
$ship -> add secondary signal: signal={SIGNAL_DAMAGED}, script='test1', prio=0, name=$scr.var.data
- Error on line 19 - Unresolved literal: {SIGNAL_DAMAGED}
It doesn't seem to like that signal
*edit resolved
{SIGNAL_DAMAGED 1010} should be used (The select menu on the side, just uses prints it out with out the 1010 thou)
Fourthly
I don't know whether or not I've posted this before, but I've found the source of the compiler warnings that are incorrect.
if $int >= 0
$pos = [TRUE]
else
$pos = [FALSE]
$int = - $int <------------- Variable int is being used on line 11 before being assigned to.
end
But $int is an argument, so it always exists. It appears to happen when ever you use a minus sign before the variable.
Fifthly, the write to log book commands
write to log file # <Var/Number> append=<Var/Number> value=<Value> (and the other ones too)
only work if you do not include the # character. So it might be best to not include the # in the commands list
-
- Posts: 1585
- Joined: Wed, 19. Nov 08, 15:58
Hi Whimsy,
at first you did a great work.
But try this in your exscriptor
The same line in the InGame SE works, but your Exscriptor say this:
at first you did a great work.
But try this in your exscriptor
Code: Select all
if 90 < $hull < 99
What's wrong with it?Exscriptor wrote:- Error on line 2 - Invalid expression - tokens remaining. Have you missed something out?
Too geek for real life.
-
- Posts: 22559
- Joined: Sat, 23. Apr 05, 21:42
Define "works". What is it supposed to do? what does it actually do?Schaf123 wrote:The same line in the InGame SE works
It does look like you do attempt:
Code: Select all
IF ( 90 < $hull ) AND ( $hull < 99 )
Code: Select all
IF $hull BETWEEN 90 AND 99
Code: Select all
IF ( 90 < $hull ) < 99
Which in turn evaluates to
Code: Select all
IF true < 99
Code: Select all
IF false < 99
Code: Select all
IF true
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
Insanity included at no extra charge.
There is no Box. I am the sand.
-
- Posts: 1585
- Joined: Wed, 19. Nov 08, 15:58
with "works" I mean there was no error.
I wanted to test whether I can compare $hull with other values because I want to have different solutions for different cases of $hull. (Hope you can understand it)
I will try your propositions. Thanks for halp and sorry for my cryptic question.
Code: Select all
$hull = [THIS] -> get hull percent
if 90 < $hull < 99
write to player logbook 'hi'
end
I will try your propositions. Thanks for halp and sorry for my cryptic question.
Too geek for real life.
-
- Posts: 167
- Joined: Mon, 9. Feb 04, 20:32
I'm not sure what you mean here - what do you want it to be able to do over multiple folders? The 'find all calling scripts' function? If so, I'm not sure it would be very worthwhile in that case.s9ilent wrote:I don't suppose its possible to set up multiple folders for scripts?
It should be under 'Constants', the fourth button. All the ACTION ones are at the top of the list.Also, I can't seem to find the [ACTION_JUMP]

How very strange - I can't see why it would need the 1010 (or at least why it wouldn't show it in the list). I will investigate and try to fix it in the next version.{SIGNAL_DAMAGED 1010} should be used (The select menu on the side, just uses prints it out with out the 1010 thou)
I almost wish I'd never included these compiler warnings as they've never quite worked properly. The problem isn't the minus - I think it's more to do with $int being an argument. I'll try to fix it (again) but at this point I think with every fix to the warnings I end up making it break in some other situation, so no guarantees...I don't know whether or not I've posted this before, but I've found the source of the compiler warnings that are incorrect.

Well spotted - I've fixed this now, so the command list doesn't have the #.So it might be best to not include the # in the commands list
As jlehtone said, if you want to check that $hull is between 90 and 99, you need to use an expression like this:Schaf123 wrote:I wanted to test whether I can compare $hull with other values because I want to have different solutions for different cases of $hull. (Hope you can understand it)
I will try your propositions. Thanks for halp and sorry for my cryptic question.
Code: Select all
if $hull > 90 AND $hull < 99

Incidentally if you want to test for different cases of $hull, one way might be to do something like this:
Code: Select all
if $hull > 75
... * Do something when hull is > 75
else if $hull > 50
... * Do something when hull is > 50 and <= 75
else if $hull > 25
... * Do something when hull is > 25 and <= 50
else
... * Do something when hull is <= 25
end

-
- Posts: 1585
- Joined: Wed, 19. Nov 08, 15:58
-
- Posts: 167
- Joined: Mon, 9. Feb 04, 20:32
Okay, I've created a new version, V1.2.21. In it I have:
- Fixed the # in the log commands (they should no longer appear in the list)
- Fixed yet another 'used before defined' bug
- Sorted out the SIGNALs; SIGNAL_DAMAGED should work correctly now
- Added a 'Find called scripts' function
Note on the find scripts functions - they both only work on actual calls, i.e. the 'call script', 'interrupt with script', and 'start task' commands. There are other commands (like the global script maps, connecting signals to scripts etc) where scripts are used but not directly called, and these aren't included.
I'm not sure whether that's all that people wanted, or if they want every reference to another script to be included in the search.
Anyway, as usual, let me know if you find any bugs etc.
- Fixed the # in the log commands (they should no longer appear in the list)
- Fixed yet another 'used before defined' bug
- Sorted out the SIGNALs; SIGNAL_DAMAGED should work correctly now
- Added a 'Find called scripts' function
Note on the find scripts functions - they both only work on actual calls, i.e. the 'call script', 'interrupt with script', and 'start task' commands. There are other commands (like the global script maps, connecting signals to scripts etc) where scripts are used but not directly called, and these aren't included.
I'm not sure whether that's all that people wanted, or if they want every reference to another script to be included in the search.

Anyway, as usual, let me know if you find any bugs etc.

-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
Hey, Whimsy! Good job!
Find called scripts probably should include global script maps. This command is going to be useful for those wanting to package their scripts to the public. I envision someone opening up the scripts "setup" fuction, running this command, and finding all of the script required to support the setup function.
It's quite a frequent problem. I've done it myself, where I forgot to include a particular script in a package, and it causes all sorts of issues.
Does the command "branch out"? Meaning, will it find all called scripts within all called scripts?
Find called scripts probably should include global script maps. This command is going to be useful for those wanting to package their scripts to the public. I envision someone opening up the scripts "setup" fuction, running this command, and finding all of the script required to support the setup function.
It's quite a frequent problem. I've done it myself, where I forgot to include a particular script in a package, and it causes all sorts of issues.
Does the command "branch out"? Meaning, will it find all called scripts within all called scripts?
-
- Posts: 167
- Joined: Mon, 9. Feb 04, 20:32
Not presently. I can see if I can make it recursive when I extend it to the other commands. Do you think it's worthwhile restricting it only to .xml files? That way it should ignore the Egosoft .pck files.Litcube wrote:Does the command "branch out"? Meaning, will it find all called scripts within all called scripts?
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02