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

draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

another major bug for yea:

problem with the right click menu:

for example if the button "object commands" (one of four buttons) is activated and the user right clicks in the scripting area and selects script command -> object command exscriptor crashes with a "unhandled exception has occurred"

X3TCCommandlist.txt:
currently
<RetVar> = <RefObj> -> get production cycle time: accoutn for secondary resources=<Var/Number>

should be:
<RetVar> = <RefObj> -> get production cycle time: account for secondary resources=<Var/Number>

currently
<RefObj> -> write to logboox <Value>

should be:
<RefObj> -> write to logbook <Value>

transport destination ----- should be ----- transport destiantion ----- to match .xml
get notoriety ----- should be ----- get notority ----- to match .xml
fight rank percentage ----- should be ----- rank precentage ----- to match .xml

edit:
with the *; if i type this in exscriptor for example:

Code: Select all

*    skip if not $config
the in game msci will not allow user to uncomment the line. it seems it doesn't like it when you use the * with multiple spaces.

this works thou for the game scriptor:

Code: Select all

*skip if not $config
as well as this:

Code: Select all

* skip if not $config

edit:edit
typos in x2commandparameters.txt
get khaak aggression ----- should be ----- get kha'ak
set khaak aggression ----- should be ----- set kha'ak
get max price ....... secondary resourcer ----- should be ----- get max price ...... secondary resource
get min price ...... secondary resourcer ----- should be ----- secondary resource
notoriery to race ----- should be ----- notoriety
notoriery from race ----- should be ----- notoriety
is in sector ----- should be ----- is in a sector ----- to match .xml

typos in x3commandparameters.txt
get khaak aggression ----- should be ----- get kha'ak
set khaak aggression ----- should be ----- set kha'ak
news availability: ----- should be ----- availibility: to match .xml
protect me or attacktarget= ----- should be ----- or attack target=
get max price ....... secondary resourcer ----- should be ----- get max price ...... secondary resource
get min price ...... secondary resourcer ----- should be ----- secondary resource
notoriery to race ----- should be notoriety
notoriery from race ----- should be ----- notoriety
is in sector ----- should be ----- is in a sector ----- to match .xml

X3TCCommandparameters.txt
these commands are missing:

General Object Commands
<RetVar>=<RefObj>get size of object
<RetVar/IF><RefObj> get notoriety to Race <Var/Race>

[both of these exist in the .xml but not in the .txt]

***** note the ones that state - match .xml ones are spelled exatly as in the 0001.xml file. so yes these are misspelled there as well.******

request:
where is the output from 2 nearly same scripts. the one on the left was created by exscriptor and one on the right was created using the ingame msci:
[ external image ]

can you have exscriptor format the codearray the same way? it would make it easier to find problems when scriptor isn't working properly.

also while debugging the code i remember you saying you were having issues with the @ symbol. in noticed in the sourcetext for the interruptable="@" in the ingame generated .xml it is before the indent=" but in exscriptor generated xml it is after the indent=". could that be the problem?

using the editing argument button doesn't add the * next to the script name letting the user know changes have been made and script needs to be saved. also when saving doesn't ask do you want to save before closing as a result.

think you can put a back button in the autocomplete so the user can return one level up instead of restarting from the beginning?

Add Arguments the drop down menu for Argument Type is missing the follow for TC:
(Var/Boolean)
(Var/Wing Command)
(Var/Wing)
(Var/Ship and Passenger)
(Var/Passenger of Ship)
(String)
(Relation)
(Number)
(Flight Retcode)
and can you have exsciptor sort this list alphebatically?
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 »

Okay, I've managed to find time to clear some of the bugs that have been queuing up...

ybo1233:

Missing script arguments
I've added in the new X3TC command arguments now, including Var/Wing. I've also alphabetised them, as draffutt suggested.

Reduced window vanishing bug
This was a strange one. I've fixed it for the moment by forcing it to relocate the window into the visible area on start, if it's not already there.


Loky77:
Thanks for spotting the typo - it should be fixed now. Also, glad you like the editor! :)


draffutt:

Where to start? :D

Call script problem
The parameter checking is and always has been a bit dodgy. You'll have to send me the scripts in question for me to check it out fully because as far as I can tell, it should work. Are you sure the scripts you're calling (e.g. the config.test ones) have the same number of parameters you're giving them?

Bizarre corrupted text
I figured out from your instructions (very helpful by the way) what had happened. When you use 'save' directly, not 'save as', it doesn't check to see whether the file you opened was a .pck - which it cannot save as. So the new version was saved as XML but named .pck, while the backup remains a .pck file but gets renamed. So when you open the backup, it tried to read a .pck as a .xml, and when you open the new version, it tried to read a .xml as a .pck. :roll:

Anyway, I've made it check to make sure it doesn't save as a .pck now so it should avoid the problem. I'll add more rigorous format checking when loading in V2.

Crash problem with the right click menu
Fixed now.

Typos + missing commands
Also fixed (hopefully). Given that I had to type out all the commands manually, I'm just glad there weren't any more mistakes!

Spaced comment bug
This one is a bit odd. It only seems to affect conditional commands (ifs, skips etc), and only if there's more than one space. The reason you can't uncomment it in the MSCI is because it's not saved it as a commented command, but as a normal (text) comment.

I've left this one unfixed for now, since it's quite complex but comparatively harmless.

Formatted XML output
The reason the codearray was unformatted is because in X2/X3, a formatted codearray would not load (something that caused me no end of frustration during testing). I've altered it for X3TC now so it should output in formatted XML if it's in X3TC mode.

@ symbol
The position of the @ in the sourcetext doesn't really make any difference; I only left it out partly because I hated having to remember to type it and partly because it complicated the parser. Well spotted though!

Script arguments
As I said above, the new arguments should all be added now. I've also made it add the unsaved * thing when you edit one.
draffutt wrote:think you can put a back button in the autocomplete so the user can return one level up instead of restarting from the beginning?
I don't quite understand what you mean here... What levels do you mean? In any case, I don't really want to make any more changes in this version (which usually just introduces more bugs anyway).

Anyway, thanks everyone - especially draffutt - for all your diligence in finding and reporting bugs. Sorry it took so long to fix them! :)

V1.2.6 is available here for further ritual bug dissection.
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Whimsy wrote:Call script problem
The parameter checking is and always has been a bit dodgy. You'll have to send me the scripts in question for me to check it out fully because as far as I can tell, it should work. Are you sure the scripts you're calling (e.g. the config.test ones) have the same number of parameters you're giving them?
to make a long story short. after have spent several days figuring this one out. it is 80% user error :oops: and 20% exscriptor. the part that is exscriptor: when saving with a script with a call script imbedded and there is a problem with the script. when you click save the first time it give an error like it should I.E.:

Code: Select all

$config.d = [THIS]->call script 'anarkis.plugin.lib.config' : config=$config  startid=231  global=233  max=234  titleid=230  label=236  ship=$ship
it'll give an error saying invalid parameters (due to it not finding the call script). good thing :thumb_up:

now if i do this (you will notice i removed the .lib):

Code: Select all

$config.d = [THIS]->call script 'anarkis.plugin.config' : config=$config  startid=231  global=233  max=234  titleid=230  label=236  ship=$ship
and click on save again. guess what happens? it saves it. it seems if you make a change and then click on save a second time it doesn't re-check the script. which causes this when you open the script at a later time and MSCI doesn't like it even if the call script can be found:

Code: Select all

$config.d = [THIS]->call script 'anarkis.plugin.lib.config' : arg0=$config  arg1=231  arg2=233  arg3=234  arg4=230  arg5=236  arg6=$ship


i doubt anyone else any time soon will stumble across this one.
@ symbol
The position of the @ in the sourcetext doesn't really make any difference; I only left it out partly because I hated having to remember to type it and partly because it complicated the parser. Well spotted though!
with this @ then; if and when do the next update (no rush by any means) can you have autocomplete ignore this symbol when displaying available commands? currently if i select @<RetVar/IF/START><RefObj>call script<Script Name>:<Parameter> from the autocomplete window and hit accept it displays it just like i typed it. and if i forget to remove that @ when i compile depending on how it is used it gives various errors: invalid caharacter in expression: ; object reference not set to an instance of an object; etc....

hopefully that is the last of the major bugs :D

don't want to keep you from putting what time you can into v2. really looking forward to it. again thanks for the continued support for this awesome program!!!
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 »

Call script problem
I still don't quite understand what's going on with the call script problem, draffutt. In your first example, you say you try to call a script that doesn't exist (the anarkis.plugin.lib.config one) and Exscriptor complains about the parameters, but what it should do (and does seem to, when I check it) is tell you the script doesn't exist.

Then if you change it to a script that does exist (anarkis.plugin.config, I assume), then it should check the parameters; too many is an error and too few is a warning. The part about making a change then saving also doesn't seem to make sense to me - it re-checks the script every time you save (it has to, otherwise it won't work) so it shouldn't save it if there's something incorrect about the call script.

Could you tell me more about the scripts involved, e.g. which ones exist and what parameters they should have? That might help me to understand what's going wrong.
draffutt wrote:with this @ then; if and when do the next update (no rush by any means) can you have autocomplete ignore this symbol when displaying available commands?
I don't want to remove the @ from autocomplete (which also means removing it from the command lists) because it's useful to know which script commands are interrupt points. However, I'm confused again now because the compiler should ignore the @ anyway, e.g. if you type:

Code: Select all

@=[THIS]->call script 'a.script': param1='parameter'
then it should compile fine, even with the @ there. If it's giving you invalid character or object reference errors then something else must be wrong. Could you give me any example of where it happens?
draffutt wrote:hopefully that is the last of the major bugs :D
Hopefully, but I doubt it! :wink:
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Whimsy wrote:
Call script problem
I still don't quite understand what's going on with the call script problem, draffutt. In your first example, you say you try to call a script that doesn't exist (the anarkis.plugin.lib.config one) and Exscriptor complains about the parameters, but what it should do (and does seem to, when I check it) is tell you the script doesn't exist.

Then if you change it to a script that does exist (anarkis.plugin.config, I assume), then it should check the parameters; too many is an error and too few is a warning. The part about making a change then saving also doesn't seem to make sense to me - it re-checks the script every time you save (it has to, otherwise it won't work) so it shouldn't save it if there's something incorrect about the call script.

Could you tell me more about the scripts involved, e.g. which ones exist and what parameters they should have? That might help me to understand what's going wrong.
unfortunetly it seems i am not going to be able to with this version. when i attempted to open one of my scripts that i was going put up as an example it gave me an error "could not check parameters...... ('arithmetic operation resulted in an overflow.')" and did not open the script. but on the bright side when i put the called script in the same folder; opened the original script; moved the call script out and attempted to compile/save. gave me the same error message but saved. i don't know if i am going to like it not being able to open unless the call script exists. time will tell. :) what i find odd thou is if the call script is in the same folder as the script making the call and i compile it; it gives a warning "....does not seem to exist!" even thou it required the file to load.

anyways i have uploaded the two files i have created for you to look at:
scripts.rar

draffutt wrote:with this @ then; if and when do the next update (no rush by any means) can you have autocomplete ignore this symbol when displaying available commands?
I don't want to remove the @ from autocomplete (which also means removing it from the command lists) because it's useful to know which script commands are interrupt points. However, I'm confused again now because the compiler should ignore the @ anyway, e.g. if you type:

Code: Select all

@=[THIS]->call script 'a.script': param1='parameter'
then it should compile fine, even with the @ there. If it's giving you invalid character or object reference errors then something else must be wrong. Could you give me any example of where it happens?
ok this one is easier to show then explain. in the script i wrote that i have uploaded. open the anarkis.cmd.config.menu on line 66 put a @ in front and compile. it should give you an error "object reference not set to an instance of an object". i have verified with the ingame MSCI that it does put one there but exscriptor doesn't seem to like it when you use one.

as for autocomplete i didn't it explained it correctly. so i'll show you:
[ external image ]

in the left image is self explantory. the right image is the output i was looking for. i agree with you. i like being able to like at the autocomplete list and see which ones are associated with interrupts. no biggie thou just need to remember to remove it before compiling. :D

*edit*
just a couple of more small things for you

when switching to x3 mode i get error messages:
-could not load from page 2008 (object commands) of file 440001.xml

and this error for this script it tried to load 448770.xml:
an error occurred while parsing entityname. line 30, position 21

this is the only thing on that line:
<t id="072">\\033G&gt\;&gt\;&gt\;\\033X Start Converter. This might freeze the game for a while.</t>

position 21 is the &. it doesn't seem to have a problem with this symbol in other parts of the script.

here is a copy of the script in question (its been converted to ANSI since i thought it might have been a problem when it was UTF-8 ):
448770.xml
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:when i attempted to open one of my scripts that i was going put up as an example it gave me an error "could not check parameters...... ('arithmetic operation resulted in an overflow.')" and did not open the script.
It shouldn't do that - that sounds like an error. Could you upload that script for me to check?
draffutt wrote:but on the bright side when i put the called script in the same folder; opened the original script; moved the call script out and attempted to compile/save. gave me the same error message but saved.
Which error? If you take away the called script (anarkis.plugin.lib.config) it should say stuff like:

Code: Select all

- Could not check parameters for call to: anarkis.plugin.lib.config: file not found. (line 61)
- Script 'anarkis.plugin.lib.config' does not seem to exist! (line 61)
and those are only warnings, which means it should still compile anyway.
draffutt wrote:i don't know if i am going to like it not being able to open unless the call script exists. time will tell.
The called script being missing shouldn't stop you from loading the script. It should just say the same thing ("does not seem to exist!") and the parameter names will be replaced with arg0, arg1, arg2 etc because it can't check the names.
draffutt wrote:what i find odd thou is if the call script is in the same folder as the script making the call and i compile it; it gives a warning "....does not seem to exist!" even thou it required the file to load.
As I said above, it doesn't require it to load (though it helps). I'm more confused that you're still getting the "does not exist" message even if the scripts are together in the same directory... :?
draffutt wrote:ok this one is easier to show then explain. in the script i wrote that i have uploaded. open the anarkis.cmd.config.menu on line 66 put a @ in front and compile. it should give you an error "object reference not set to an instance of an object". i have verified with the ingame MSCI that it does put one there but exscriptor doesn't seem to like it when you use one.
I see now. It only gives you the error when you use a return variable, e.g. "@ $config.a = [THIS]->call script ...." would fail but "@ = [THIS]->call script ...." would not. Anyway, I've fixed this bug and I've also stopped it from adding the @ in the first place if you use autocomplete, as you suggested.
draffutt wrote:-could not load from page 2008 (object commands) of file 440001.xml
Fixed this one. It was trying to load X3TC data from the X3 files... :roll:
draffutt wrote:and this error for this script it tried to load 448770.xml:
an error occurred while parsing entityname. line 30, position 21
The problem is the backslash. It works elsewhere because ">" is fine, but "&gt\;" is not. Remove the backslashes and it should work fine.

I won't release another update just yet, in case we manage to solve the call script problem! :wink:
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

the quickest way to get that arithmetic problem for the call script: use the two scripts i put up and put the anarkis.cmd.config.menu onto your desktop. make sure you don't have anarkis.plugin.lib.config in a place exscriptor can load/call from. I.E. put the ...lib.config in a seprate folder. when you attempt to open ...config.menu it will give you a arithmetic error and will not load.

and if you want to check on the saving arithmetic problem. (that was the error i was referring to. same as loading.) move the ...lib.config from where ever you have it and put it on your desktop. load up ...config.menu then move the ...lib.config back to where ever you got it from and try to save. should give you the same error as the load error.

thanks for the info on the &gt\ did not realize it did not like that sequence.

by chance when switching to x3 mode is the "could not load from page 350007 (extended sector names) of file 440001" also a TC loading issue for reunion?

and "could not load from page 300007 (extended sector names) of file 440001" when switching to x2 mode a TC loading issue?

almost forgot. when you fix the arithmetic issue you can use my 2 scripts to take a the original call problem and see if it is still happening. quickest way: drag both to the desktop load up ...config.menu in exscriptor and move the ...lib.config somewhere else. now try to save the ...config.menu it should give you an error about parameters. now on each of the call lines you'll have to change the call script from lets say anarkis.plugin.lib.config to anarkis.plugin.config. once you do that see what happens when you save again.
Last edited by draffutt on Mon, 9. Feb 09, 07:06, edited 1 time in total.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice »

I have a version 1.2.2 which someone sent me, and I've just now found this thread.

I notice that it does not use the current game files, and so ignores mods. When you edit a script that contains reference to a mod, it generates an error and actually damages the script, trying to replace what works in game with something close that doesnt. As such, since most of my scripting revolves around mods, its not a lot of use to me.

Is this just that particular version or something not handled yet ? Like the X3Editor uses the actual game version of everything after including all patches and mods, so too must this external editor, imo.

Just wondered.
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

apricotslice wrote: I notice that it does not use the current game files, and so ignores mods. When you edit a script that contains reference to a mod, it generates an error and actually damages the script, trying to replace what works in game with something close that doesnt. As such, since most of my scripting revolves around mods, its not a lot of use to me.

Is this just that particular version or something not handled yet ? Like the X3Editor uses the actual game version of everything after including all patches and mods, so too must this external editor, imo
just to clarify apricotslice. exscriptor does not check the mods folder. but for the rest of you commit excriptor does use the current game version as well as any .cat/.dats a user might have added ( that is why i asked whimsy a while back to add a counter under the objects button to tell when something is added or deleted easily). i also use a lot of mods and this program works very well when dealing with them. Just not "mods" in the mods folder. maybe whimsy will add that function for you.
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:the quickest way to get that arithmetic problem for the call script: use the two scripts i put up and put the anarkis.cmd.config.menu onto your desktop. make sure you don't have anarkis.plugin.lib.config in a place exscriptor can load/call from. I.E. put the ...lib.config in a seprate folder. when you attempt to open ...config.menu it will give you a arithmetic error and will not load.
I still can't reproduce the problem. I tried what you said, putting the config.menu script by itself on the desktop and again in a folder on its own, but it always loads fine (well, with the "does not exist" warnings). No artihmetic problem. I also tried it with saving, but even if you load the script, delete/remove the called script, and try to save, it still works (just with warnings again). :?

I'll take another look at the code to see if I spot anything suspicious, but if it's still doing it for you then the problem might be something else. Could you try repeating the steps with two other different scripts? See if the problem still occurs? Maybe there's another factor involved that we can identify by process of elimination.
draffutt wrote:by chance when switching to x3 mode is the "could not load from page 350007 (extended sector names) of file 440001" also a TC loading issue for reunion?
Yes. I fixed that one at the same time. :)
draffutt wrote:and "could not load from page 300007 (extended sector names) of file 440001" when switching to x2 mode a TC loading issue?
Didn't spot this one though! But yes, it's the same issue. I think actually the 300007 sectors were added in an X3 patch (maybe Bala Gi?) but I can't remember for sure.
apricotslice wrote:I notice that it does not use the current game files, and so ignores mods. When you edit a script that contains reference to a mod, it generates an error and actually damages the script, trying to replace what works in game with something close that doesnt.
It shouldn't damage a script (certainly not unless you save it), but it depends on what it is. If it's a ship command that it doesn't recognise, it should give it a default name, e.g. COMMAND_TYPE_FIGHT_2. If it's an unrecognised ship or ware etc then yes it might not work properly (if I remember correctly I think it loads it up with a question mark and then it won't compile; this prevents you from saving so it shouldn't corrupt the script file).
apricotslice wrote:Is this just that particular version or something not handled yet ? Like the X3Editor uses the actual game version of everything after including all patches and mods, so too must this external editor, imo.
I use the same libraries that X3Editor uses to deal with the game files, so in theory it has the same capabilities. However, as far as I'm aware, the libraries don't load any mods automatically, just the normal game data files (i.e. the cat/dats and any unpacked files inside the normal directories, as draffutt said) and the mod has to be loaded separately. I didn't realise this until later and since then I've never got around to adding the option to select a mod or load the active mod automatically. :oops: In the mean time, if you want to use a mod file, you'd have to unpack them into the normal directory or use it as a false patch.

Adding the option to load a specific mod cat/dat would definitely be useful, but as it's quite a major undertaking and likely to introduce lots of bugs, it's something I'd rather leave for the V2 rewrite. I'll have a look and see what's feasible, but I think for now at least, it's not possible to use files in the mods directory. :( Sorry!
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Whimsy wrote:
draffutt wrote:the quickest way to get that arithmetic problem for the call script: use the two scripts i put up and put the anarkis.cmd.config.menu onto your desktop. make sure you don't have anarkis.plugin.lib.config in a place exscriptor can load/call from. I.E. put the ...lib.config in a seprate folder. when you attempt to open ...config.menu it will give you a arithmetic error and will not load.
hmmm.... after reading this i rebooted my computer; delete the exscriptor folder; created a new exscriptor folder; pulled up my sleeves and prepared to start the process of elimination. (not necessarily in that order) except for an odd behaviour (using the call script command and no i can not reproduce) every now and then; the call script is working in ver 1.2.6...... (maybe a blue moon was in phase?!??!)
draffutt wrote:and "could not load from page 300007 (extended sector names) of file 440001" when switching to x2 mode a TC loading issue?
Didn't spot this one though! But yes, it's the same issue. I think actually the 300007 sectors were added in an X3 patch (maybe Bala Gi?) but I can't remember for sure.
i believe you are right. it was from the bala Gi.....

while preparing for the process of elimation i stumbled across another "unhandled exception error":

example: load up exscriptor; rename, move, delete, do something with the scripts folder in your game folder. click on tool / reload game data after and vola'.

small cosmetic bug?
not really worth fixing but i thought i would mention it.

just finished compiling a bunch of scripts at once. even thou there was a total of 41 warnings; on the very bottom, exscriptor reported only 9 warnings. it was only reading the last compiled warning rather then the total of all.
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:(maybe a blue moon was in phase?!??!)
Probably... :D I'm glad it's working for now, anyway!
draffutt wrote:example: load up exscriptor; rename, move, delete, do something with the scripts folder in your game folder. click on tool / reload game data after and vola'.
I couldn't reproduce this as Windows wouldn't let me rename the folder while Exscriptor was using it. However, I added some extra handling so it should at least report the error properly and not just throw an unhandled exception. Let me know if it works as I couldn't test it myself!
draffutt wrote:just finished compiling a bunch of scripts at once. even thou there was a total of 41 warnings; on the very bottom, exscriptor reported only 9 warnings. it was only reading the last compiled warning rather then the total of all.
It tells you how many errors & warnings there are after each script compile, not at the very end - there are no totals provided. So the other 32 warnings should be listed earlier on, I think. :)

V1.2.7 is now available and includes the additional fixes from earlier (e.g. the @ one).
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Whimsy wrote:
draffutt wrote:example: load up exscriptor; rename, move, delete, do something with the scripts folder in your game folder. click on tool / reload game data after and vola'.
.....let me know if it works
works like a charm :thumb_up:
draffutt wrote:just finished compiling a bunch of scripts at once. even thou there was a total of 41 warnings; on the very bottom, exscriptor reported only 9 warnings. it was only reading the last compiled warning rather then the total of all.
It tells you how many errors & warnings there are after each script compile, not at the very end - there are no totals provided. So the other 32 warnings should be listed earlier on, I think. :)
just to clarify are you referring to this (the area i circled in red):
[ external image ]


or this:
[ external image ]

i was referring to the count in image2. but to me it's just cosmetic. hopefully now this version can head into sustainment mode. also i went ahead and verified (if you hadn't already done so) version 2.0 patch about to be released isn't adding any new commands/var. (or at least not what has been released in 2.0rc1 so far :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:works like a charm
Excellent. :)
draffutt wrote:i was referring to the count in image2. but to me it's just cosmetic. hopefully now this version can head into sustainment mode.
Ah, I see what you mean. I've fixed it now (it'll say things like "10 scripts compiled okay") but as it's only cosmetic, it's not worth releasing a new version.
draffutt wrote:also i went ahead and verified (if you hadn't already done so) version 2.0 patch about to be released isn't adding any new commands/var. (or at least not what has been released in 2.0rc1 so far :wink: )
I hadn't checked, but it's good to know - thanks! And thanks again for your help in battling the bugs. :wink:
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Just a quick question. If I wanted to script away from my main computer. Which files do I need (from the game folder)

As copying the entire game to a USB will use up all the space :S



Presumably I'd need the tfile as a minimum, the X3TC.exe (as thats what the program looks for, I think)
The scripts + schema


Then with the Cat/dats, do I need them? And which ones?
(Is just the types + t files good enough?)
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

s9ilent wrote:Just a quick question. If I wanted to script away from my main computer. Which files do I need (from the game folder)
The program uses the files in the \types directory (tships, tmissiles, etc) and the XML language files in the \t directory. However, these are mostly in the cat/dats, so you either need to find the right cat/dats that contain them and copy those or unpack the types and t files and use those directly. You don't need to copy X3TC.exe itself.

Then obviously you also need any scripts you want. :)

The best way I think is to unpack the files, then you just need a fake "X3TC" directory containing:

- types (.pck or .txt, it doesn't matter)
- t (.pck or .xml)
- scripts (.pck or .xml)

and it should work fine. Plus the whole lot fits into less than 10 mb, whereas the cat/dats would be much bigger.
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

small issue i don't know if you want to call this one cosmetic or not. this gives a misleading error message:

i don't know if you still have my 2 example scripts handy. if not used.zip here are 2 different ones. it deals with when using the *

in the ...lib.config remove the shipID argument and save. now remove all the ship=$carrier except on line 78.

when you save or compile it gives the error message "comment on line 78 contains XML symbols such as &, < or >. X3 cannot...... avoid using them." nothing wrong with the symbols; the argument is invalid. but as i mentioned i don't know if you want to call this cosmetic or not since you still can save without problems.
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:when you save or compile it gives the error message "comment on line 78 contains XML symbols such as &, < or >. X3 cannot...... avoid using them." nothing wrong with the symbols; the argument is invalid. but as i mentioned i don't know if you want to call this cosmetic or not since you still can save without problems.
You can still save since it's only a warning, not an error. I agree it's a bit misleading in this case, however, because the issue is quite subtle. To understand what's happening, you have to know how Exscriptor deals with commented commands - which have been an unrelenting source of trouble since day 1.

When the Exscriptor finds a comment, it tries to parse it as if it was a normal command. If it gets a parse error (i.e. it doesn't recognise the command) then it assumes it was just normal text and treats it as a normal comment instead. What's happening in this case is that Exscriptor realises there's an extra parameter and decides it's an error... so the program then treats it as a normal text comment... in which case the text comment contains funny symbols.

So everything is actually working properly, it's just that the error message makes it look confusing because you don't expect it. :D

Anyway, I think this bug falls into the "interesting but minor" category. It's not really a showstopper and fixing it would require more effort than it's worth. Well spotted though - this bug is a very subtle one!
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Whimsy wrote:Anyway, I think this bug falls into the "interesting but minor" category. It's not really a showstopper and fixing it would require more effort than it's worth. Well spotted though - this bug is a very subtle one!
Understandable :thumb_up:

small request:

i've been getting random lock-ups in TC mostly using call scripts. i think i have narrowed it down to the script version number. when i was converting a script from reunion to TC it had a version number of 1. when i resaved in TC mode it save it as ver 2. then i attempted to use this script in TC it would randomly lock-up the game. i remember reading somewhere about the version number. when i changed the setup script version to 1 (it was originally 141) and started a new game TC wouldn't even load the setup file. so my request is this when in TC mode if a user choses ver 1 thru 39 and attempts to save; exscriptor automatically saves it to ver 40. i have verified ver 40 is the first number accept by TC with the setup file. (whenever you release the next update)

small bug: just clicking in the block next to "script location" causing the * to appear next to the script name.

i am also have a little problem with the M8 class of ships. if i type out for example $ship.class == {M8} the script will not load in game. but if i type out $ship.class == then click on objects / object classes / M8 from the "menu" it prints out the {M8} then the script will load in game. is there is hidden command associated with the M8? i will test this further when i get more time to make sure there isn't something else that is preventing it from loading.
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:i've been getting random lock-ups in TC mostly using call scripts. i think i have narrowed it down to the script version number.
You seem to find the weirdest bugs... In this case though I'm not sure what's going on. The script version number shouldn't make any difference. However, are you sure you mean the script version number, and not the engine version? X3TC's engine version is 40 (original) or 41 (with patch) and a lower engine version won't work (which is why X3R scripts didn't work initially). So if you changed your setup script manually by editing the XML file maybe you changed the wrong one? If that's not the problem then I don't know what is, because I know scripts with lower script version numbers (e.g. 1, 2 etc) load okay.
draffutt wrote:small bug: just clicking in the block next to "script location" causing the * to appear next to the script name.
Weird - okay, I'll fix that for next time.
draffutt wrote:is there is hidden command associated with the M8? i will test this further when i get more time to make sure there isn't something else that is preventing it from loading.
This is even more strange! No, there's no hidden stuff going on - it's just text. To make sure, I made two scripts, one just typing {M8} and one selecting it, and both produce exactly the same file, so I don't know what might be going on here. What else is in the problem script?

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