Exscriptor - new external script editor

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

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

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

Post by ScRaT_GER »

I have a question:

Where are the text files saved, when you choose "Quicksave as text"?
I can't seem to find them anywhere.

And a simple request:
When you have a "return null" somewhere in your script, the exscriptor does not add an additional one to the end of the script.
However if this is missing and the game does not exit the script "using" one of your returns, the game will crash.

The solution would be to simply add "return null" to any script at the end, if the last command isn't a return command.

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

Post by Whimsy »

ScRaT_GER wrote:Where are the text files saved, when you choose "Quicksave as text"?
I can't seem to find them anywhere.
They're supposed to be stored in the main script directory. However, it seems that the code actually stored it in the current working directory, which in some cases may be different. I've updated it so it always stores them in the scripts directory now.
ScRaT_GER wrote:And a simple request:
When you have a "return null" somewhere in your script, the exscriptor does not add an additional one to the end of the script.
However if this is missing and the game does not exit the script "using" one of your returns, the game will crash.

The solution would be to simply add "return null" to any script at the end, if the last command isn't a return command.
Easily done. It should work better now. :)
Litcube wrote:Does the command "branch out"? Meaning, will it find all called scripts within all called scripts?
I've added a third 'Find scripts' command to the Tools menu that searches recursively for all called scripts. It takes a little longer obviously but it seems to work okay (and I hope I've made sure it won't get stuck in a loop). I've also extended these functions to include all types of call commands (there are 25 now included) and also, when in recursive mode, it will ignore .pcks and the 'hidden' ! scripts.

As usual, latest version is available here.
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

just a notice if you are not aware the 2.5 patch was released with new commands. :wink:
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

draffutt wrote:just a notice if you are not aware the 2.5 patch was released with new commands. :wink:
V1.2.23 should include the new commands. Let me know if I missed any out though! :)
SneakersOToole
Posts: 13
Joined: Fri, 17. Apr 09, 21:52
x3tc

Post by SneakersOToole »

Hi!

Firstly can I say a massive thanks for taking the time to do this editor, as a newbie scriptor, I can say that this has made learning the language so much easier. Thank you for your efforts on this.

Secondly I have I have a query, all my wares show up in French, I can work around it with my rusty french (wish I studied more of the French language at school ;) ) but I would love to have it english. I have the options set to use the english option and I am using the latest version but no dice, just see these wonderful french wares. Any ideas what I am doing wrong ?

Thank you again.

Regards,

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

Post by Whimsy »

SneakersOToole wrote:Secondly I have I have a query, all my wares show up in French, I can work around it with my rusty french (wish I studied more of the French language at school ;) ) but I would love to have it english. I have the options set to use the english option and I am using the latest version but no dice, just see these wonderful french wares. Any ideas what I am doing wrong ?
Glad you find the program useful! As for your problem, I'm not sure why it's doing that; if you've set the option to use English then it shouldn't be loading the French language files (unless they've been renamed somehow). You can check the config.dat file and make sure it says "language = 44" in there somewhere; other than that, I don't know what to suggest. Have you modded the game at all, e.g. unpacked any cat/dat files? You could also try reinstalling Exscriptor (or - as a last resort - both the game and Exscriptor).

Hope that helps! If not, let me know. :)
SneakersOToole
Posts: 13
Joined: Fri, 17. Apr 09, 21:52
x3tc

Post by SneakersOToole »

Thanks Whimsy for your reply.

I checked the config.dat but it is pointing to language 44.

I do though have a modded game, I have a mod I choose from the main menu X3TC startup screen (MARS) and I have two installed as fake patches (Ys GUI Mod and Complex Cleaner), I am thinking this might have something to do with Y's GUI Mod though not sure how (MARS and Complex Cleaner are so popular that I suspect somebody else would have noticed it by now). Interestingly the in-game script editor shows the
wares in english.

I am going to install a separate dev environment for X3TC so I should be able to work out if it is Y's then. Might not be for a week or so depending on RL, so I'll let you know how I get on. Thanks again.

Regards,

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

Post by ScRaT_GER »

Hi Whimsy,

just a minor bug report here:

Sometimes the Exscriptor creates a "return null" at the end of a script, even if there was already one. I don't know under which circumstances this bug appears, but I found various scripts with up to three "return null" at the and.

Other than that, everything works fine (luckily the bug with the windows overlapping I reported some time ago, does not appear on my Windows 7 Laptop).

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

Post by Whimsy »

ScRaT_GER wrote:Sometimes the Exscriptor creates a "return null" at the end of a script, even if there was already one. I don't know under which circumstances this bug appears, but I found various scripts with up to three "return null" at the and.
I've not been able to recreate this yet - have you any more clues about when it happens? What were the ends of those scripts with 3 returns like? Was it just three returns in a row, for example, or were there spaces or empty lines between them etc?
Other than that, everything works fine (luckily the bug with the windows overlapping I reported some time ago, does not appear on my Windows 7 Laptop).
Glad to hear it! :)
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

I've not been able to recreate this yet - have you any more clues about when it happens? What were the ends of those scripts with 3 returns like? Was it just three returns in a row, for example, or were there spaces or empty lines between them etc?
Unfortunately I already corrected the scripts the bugs occured at. However, one thing I am sure about, is that there were always spaces between the "return null"s - clearly a sign of the Exscriptor's work. =)

As soon as I encounter another script with multiple "return null"s I'll report.

Greetings,
ScRaT

EDIT: Do you somehow flag the script, that already have a "return null" at the end? Because I have the feeling, that this bug appears, when I save a script I previoulsy opened in the internal SE. Maybe this removes the flag (if there is one).
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

hello whimsy:

here is a test script for you.

test.rar

cut line 122 threw 127; paste to line 132 and now save. you'll have 2 return nulls at the end of the file.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

ScRaT_GER wrote:EDIT: Do you somehow flag the script, that already have a "return null" at the end? Because I have the feeling, that this bug appears, when I save a script I previoulsy opened in the internal SE. Maybe this removes the flag (if there is one).
At the minute it just checks to see if the last non-empty line (i.e. the last one with text) is a return; if not, it adds one. But clearly there must be something wrong there somewhere...
draffutt wrote:here is a test script for you.
Thanks draffut, this should help a lot. I'll take a look and see if I can track the problem down. :)
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

Okay, I think I managed to find and fix the problem. As usual, it was something trivial and idiotic. :)

The new version should work okay, but if it still happens, let me know.
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

Hi Whimsy,

Love your editor, but found a small problem.

One of my scripts references the sector Queen's Retribution directly, but when I open that script in your editor, it replaces the sector name with {7,30012}. This isn't too much of a problem, except that when you try and save the script, it fails with the error "Error on line 97 - Unresolved literal: {7, 30012}".

There are several other sectors missing, I've noticed: Patriarch's Collusion, Senator's Badlands, Vestibule of Creation and Weaver's Tempest. Presumably most of their adjoining sectors are missing too.

Also, the version number is incremented even if the save fails.

I know this is the thread for X3R, not X3TC, but it's the only link in the editor, sorry.
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

TECSG wrote:One of my scripts references the sector Queen's Retribution directly, but when I open that script in your editor, it replaces the sector name with {7,30012}. This isn't too much of a problem, except that when you try and save the script, it fails with the error "Error on line 97 - Unresolved literal: {7, 30012}".
It seems that this has gone unnoticed since Exscriptor V1.2 for X3TC was released, so well spotted! Apparently almost none of the new sectors were being read in correctly. I have fixed this now in the new V1.2.25.
I know this is the thread for X3R, not X3TC, but it's the only link in the editor, sorry.
This is the the only thread on the Exscriptor, so feel free to report bugs found with any of the games (X2, X3, X3TC) here. :)
Freggel.Doe
Posts: 310
Joined: Wed, 6. Nov 02, 20:31
x2

Post by Freggel.Doe »

I didn't have time to work on my x3tc-script for some time. came here to download the new version of this fine tool but it somehow got broken :(

I wrote a script calling a menu-script:

Code: Select all

$data.array = [THIS]->call script 'freggel.lib.menu' : description=$description  info.lines=$info.lines  data.array=$data.array  preselect.array=null  empty.selection.allowed=[FALSE]  abort.allowed=[TRUE]  multiple.selection=[TRUE]
This exact line was giving me quite a headache yesterday until I found the problem. When I change the multiple.selection-argument to [FALSE] and save+compile with exscriptor, the script WILL NOT be called.
Whenever I use the internal script editor (which is a pain in the ... in comparison btw), I can change the argument and everything works as expected.
I wrote the 'freggel.lib.menu'-script and the script issuing this call some time ago in june I think and the exscriptor-version I used back then worked fine (meaning the script worked ingame).
Beats me why the older version had no trouble but now the script won't work anymore when compiled by exscriptor...

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

Post by Whimsy »

Freggel.Doe wrote:This exact line was giving me quite a headache yesterday until I found the problem. When I change the multiple.selection-argument to [FALSE] and save+compile with exscriptor, the script WILL NOT be called.
Whenever I use the internal script editor (which is a pain in the ... in comparison btw), I can change the argument and everything works as expected.
I wrote the 'freggel.lib.menu'-script and the script issuing this call some time ago in june I think and the exscriptor-version I used back then worked fine (meaning the script worked ingame).
Beats me why the older version had no trouble but now the script won't work anymore when compiled by exscriptor...
That's extremely odd. I took a quick look and can't see anything obviously wrong - could you upload the relevant broken scripts (both the calling script and the called script) somewhere? That way I can compare the Exscriptor-compiled versions against the ingame-compiled versions and hopefully figure out what's going on.

Without that I don't know where to start. I can't begin to think why changing a parameter from true to false would stop the script from being called.... :?
Freggel.Doe
Posts: 310
Joined: Wed, 6. Nov 02, 20:31
x2

Post by Freggel.Doe »

Code: Select all

write to log file $log.file  append=[TRUE]  printf: fmt='data.type: %s', $data.type, null, null, null, null
if $data.type == {DATATYP_SHIP} 
  write to log file $log.file  append=[TRUE]  printf: fmt='ship', null, null, null, null, null
  $data.array = [THIS]->call script 'freggel.lib.menu' : description=$description  info.lines=$info.lines  data.array=$data.array  preselect.array=null  empty.selection.allowed=[FALSE]  abort.allowed=[TRUE]  multiple.selection=[FALSE] 
else if $data.type == {DATATYP_STATION} 
  write to log file $log.file  append=[TRUE]  printf: fmt='station', null, null, null, null, null
end
I did some further inverstigation and the problem is not the script call itself.
The call is enclosed in an if-else if where data.type comparisons are made. These don't work as intended anymore. Output in log.file gives me just this:

Code: Select all

data.type: DATATYP_SHIP
The code inside the if wont be executed - there is no 'ship' output in log.file. The line where I made the argument-change I referred to in my last post is not even reached. This worked in an older version of Exscriptor and still does if the ingame SE compiles these scripts.
Suggestions?

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

Post by Whimsy »

Freggel.Doe wrote:I did some further inverstigation and the problem is not the script call itself.
The call is enclosed in an if-else if where data.type comparisons are made. These don't work as intended anymore. Output in log.file gives me just this:

Code: Select all

data.type: DATATYP_SHIP
The code inside the if wont be executed - there is no 'ship' output in log.file. The line where I made the argument-change I referred to in my last post is not even reached. This worked in an older version of Exscriptor and still does if the ingame SE compiles these scripts.
Suggestions?
There was an issue with the datatypes before, which I fixed in a previous version. It's possible that change somehow broke your script. However, I can't reproduce the same problem you're getting - I get the same result from both Exscriptor and the ISE: both versions work correctly (they get into the if $data.type == DATATYP_SHIP part). I checked the produced codearrays and they're the same, so the problem must be elsewhere, before the code you showed me. How are you getting $data.type?

Here is my test code ([THIS] was my ship at the time):

Code: Select all

$data.type = datatyp[ [THIS] ]
write to player logbook $data.type
if $data.type == {DATATYP_SHIP} 
  write to player logbook 'datatype ship'
else if $data.type == {DATATYP_STATION} 
  write to player logbook 'datatype station'
else
  write to player logbook '?'
end
If you upload your whole script somewhere, I can check it more thoroughly, but other than that I don't know what else to suggest... :?
Freggel.Doe
Posts: 310
Joined: Wed, 6. Nov 02, 20:31
x2

Post by Freggel.Doe »

Whimsy wrote:There was an issue with the datatypes before, which I fixed in a previous version.
I thought long and hard about this since your fix came around the time, when I last worked on all the involved scripts.
I finally found the problem or rather a solution to it: I recompiled all my scripts with the up-to-date version of Exscriptor and now the error is gone.
I'm still puzzled by the fact, that ONE change in ONE of the scripts broke the entire thing when compiled by Exscriptor but not when this one script got compiled by the ingame SE.
Thanks for your help and I'm sorry for any inconvenience I may have caused.

freggel

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