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

bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate »

Moonrat wrote: Evertime I load in my script into Exscriptor I get the message :

"Loading files...
Load failed! Object reference not set to an instance of an object.
Load failed"
I remember having this at one point. I thought I corrupted the file somehow as I was moving things around a lot. I vaguely remember it having something to do with 'call script', so maybe you could try commenting call script lines out in MSCI to rescue the data (if it will load it of course)...
draffutt wrote: the ID= as displayed by exscriptor was causing me to scatch my head on what it was looking for. what var was supposed to be defined/assigned to it.
I actually really like this behavior, because it means you can use rather more verbose descriptions for parameter names without every script call taking up five lines of text.
draffutt wrote:if you have more then one script open; say 10 scripts, and you decide you are done working on script 2 and you close it. can you change it so that it opens the next script in line rather then opening the last script every time.
Ditto here. I think I might have requested this behavior actually! ^^

--

I found only one weird thing:

$followTask = random value from 100 to 65536
reports: - Index was out of range. Must be non-negative and less than the size of the collection.

The command should have '- 1' on the end of it.
User avatar
Moonrat
Posts: 1354
Joined: Sun, 20. Apr 08, 16:20
x4

Post by Moonrat »

Good (if you know what I mean) that others are seeing my "null comment" bug.....so it's not just me, and my code.

A new feature suggestion : :idea:

When you use "Save" or "Save as" is it possible to have the "compile" pass display errors+warnings like it does on the "Compile" option. Once or twice I have saved and then only on a subsequent "Compile" have I noticed that I had potentially got stuff wrong.

Thanks as always
Azaniah
Posts: 15
Joined: Tue, 21. Feb 06, 20:24
x3tc

Post by Azaniah »

I wish to make a small change to one of the files included in the bonus pack ( the CAG stuff).

I can see where and what I need to changes as the logic is fairly clear. My problem is that the file is a .pck and I believe you can only save as .xml or .txt.

Can anyone explain how I would make a change to a .pck file?

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

Post by draffutt »

bunkerprivate wrote: I actually really like this behavior, because it means you can use rather more verbose descriptions for parameter names without every script call taking up five lines of text.
not everyone is an awesome scripter as yourself but i do see you point. :)
Azaniah wrote:I wish to make a small change to one of the files included in the bonus pack ( the CAG stuff).

I can see where and what I need to changes as the logic is fairly clear. My problem is that the file is a .pck and I believe you can only save as .xml or .txt.

Can anyone explain how I would make a change to a .pck file?

Thanks
Make whatever change you want and save it as a .xml then either move or rename the .pck file. if you don't then whatever changes you made will be ignored as .pck's take precedence.


another small issue(s):
but are these worth the effort to fix?:

whenever you get the change can you take a look at this. in a dual montor setup. when you open exscriptor it will open in your main window. when you drag exscriptor to the seconday window and close the scriptor. when you re-open exscriptor it opens up in the main window (rather then the secondary) and resets to the default settings.


cosmetic bug:
otas race ships are listed as argon ships I.E. argon otas elite
sohnen race ships are listed as xenon ships I.E. xenon sohnen mantis

figured out what was causing my ship list to get truncted not why. i think this one is over my head on what could be causing this. but if you want to check it out yourself for an example. download the xperimental shuttle for xtm and with xtm installed your ship count should drop. for me i had 329 listed before and 324 after installing that and that one only caused a small drop. ( the vanilla one doesn't seem to cause the same problem with the vanilla game as the xtm version with the xtm game.) i have another that causes half of the list to disappear. Maybe make a note in the readme about installing customs ships or customs fixes that are not part of a package I.E. Roguey, XTM's, etc...
Last edited by draffutt on Fri, 22. Aug 08, 16:31, 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
bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate »

draffutt wrote:not everyone is an awesome scripter as yourself but i do see you point. :)
Thanks, but you didn't see my script yet! ^^ I only make the point in case the feature I like disappears in future versions. Of course, everyone has their preference.
otas race ships are listed as argon ships I.E. argon otas elite
sohnen race ships are listed as xenon ships I.E. xenon sohnen mantis
I'm using XTM and have the same problem, but I'm pretty sure it's because of the way XTM has done things, not exscriptor. I don't think it's possible to add races in a very complete way so ships have to be assigned either to a generic 'neutral race', 'enemy race' etc., but when the ship info is used, they have to be assigned to a 'real' race. So, to get round the problem they just add their new race's name to the actual ship name. If you look at the Otas shipyard, you'll see that all the ships are sold there as 'Otas whatever', instead of just the actual name as at race shipyards.
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

bunkerprivate wrote:Thanks, but you didn't see my script yet! ^^ I only make the point in case the feature I like disappears in future versions. Of course, everyone has their preference.
i may not have seen your script yet but how many people would have realized this "$followTask = random value from 100 to 65536" was missing a -1? i know i wouldn't have. so by my book you know what you are doing. :)
I'm using XTM and have the same problem, but I'm pretty sure it's because of the way XTM has done things, not exscriptor. I don't think it's possible to add races in a very complete way so ships have to be assigned either to a generic 'neutral race', 'enemy race' etc., but when the ship info is used, they have to be assigned to a 'real' race. So, to get round the problem they just add their new race's name to the actual ship name. If you look at the Otas shipyard, you'll see that all the ships are sold there as 'Otas whatever', instead of just the actual name as at race shipyards.
if you are correct then that means that possibly exscriptor isn't handling the terran named/assigned ships correctly. if you notice on the list all the new terran ships are all over the list (they are not assigned to any race) and supposely terran is a predefined race already. is it possible the terran name is getting striped and it doesn't know to group them as terran? as for the other "races" personnelly i would leave the otas and sohnen right where they are. they are already grouped together for easy of use.

Bug?

if i create a line or load a script with the follow command:

Code: Select all

$index = get index of $hbID in array $ar2 offset = -1 +1
Exscript leaves off the +1

Cosemtic Bug:
Commondity Logistics Software MK2 is displayed as Kri'ME SDS Station Delivery Software

wishlist:
the find menu stays on top
Last edited by draffutt on Sat, 23. Aug 08, 21:53, edited 2 times in total.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate »

After a fair bit of stress testing, I have started to get this error:
Loading files...
Load failed! Error on line 0 - Unknown command ID '2'
Load failed
It's another case of writing the script in Exscriptor, saving in X3, and trying to reload with Exscriptor again. Here is a script which has the error: rightclidk, save as. It still runs fine in X3.

Edit: I just noticed that all the if statements are 'if not = [THIS] -> is docked'. Not sure whether the in-game editor caused that or not... I will try and fix it with MSCI and see what happens later.

Only one other small issue: removing a script argument doesn't affect the 'has been saved' status.
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

Okay, there's a lot to get through, so I'll condense it a bit:

@draffutt
- {LITERAL} insert issue: all fixed now (hopefully).

- Call script parameter IDs: I'm going to have to side with bunkerprivate on this one and leave it as it is, partly because I think it's neater but mainly because using the descriptions rather than the names would cause lots of problems for the parser.

- Open last used script when closing: I thought I'd done this already, but either I broke it or it never worked right. :roll: Anyway, I've looked at it again and it should work now.

- Dual monitor issue: I don't have a dual monitor to test it with, but I've got it to store the location of the window and whether or not it was maximised, so hopefully this will work for you now. You may have to have it unmaximised though, I'm not sure.

- Ship/Race names: As bunkerprivate mentioned, it's set up like that in the data files. The Terran names were indeed missing but I've reinstated them now.

- Ship list truncation: I downloaded the Xperimental shuttle and you're right, it can cause a few ships to go missing. Though I found it did that only if I unpacked it and used the fake patch method; if I used Cycrow's installer it didn't do it. I suspect this is an issue with the file system where some TShips files (with less ships) are taking precedence over ones with more ships, but I can't be certain.

- get index of $x from array: Fixed this one too now.

- Commodity Software: It's a conflict in the language files somewhere. The new Conflict Viewer will be able to give you more info but I'm not sure where the culprit file is from; I think it might be a Bonus Pack language file.

- Find/Replace stays on top: Done this too. :)


@Moonrat
- Weird empty comment problem: I tracked this one down and I think I've solved it. I've recoded it so that it won't do it any more and also so that you can open files that have already been "corrupted" by this bug. If you then resave them they should be fine. Hope that helps! :)

- Save/Save As shows warnings: I've added this in as well now so it'll show warnings all the time (if there are any).


@bunkerprivate
- random value: I've fixed the error message for this one now so it's more informative and isn't just an array out of bounds error. :oops:

- if not = : I think I accidentally caused this when I changed the variable checker. In any case I've fixed it now, I think.

- removing argument should set dirty flag: also fixed.

- Conflict checker: You asked a while back for a more comprehensive conflict checker, which I've now included (partly to help me solve draffutt's Commodity software issue above). It's in the Tools menu and shows all the various language file conflicts.


@Azaniah
You've probably got it working already by now but draffutt's advice was good - just save as XML then get rid of the PCK somehow. In fact I think you can repack an XML into a PCK using one of the modding programs but I can't remember which one.


Anyway, hope V1.025 fixes all these problems, and thanks again for all your help spotting them! :D
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Whimsy wrote:
- Dual monitor issue: I don't have a dual monitor to test it with, but I've got it to store the location of the window and whether or not it was maximised, so hopefully this will work for you now. You may have to have it unmaximised though, I'm not sure.
Works like a charm. thanks for all the hard work and effort you are putting into this.

I have another bug for you thou:

When you select All open scripts with find and you click find next it will find the first object. But when you click on find next again the screen will flash and it will stay on the object it found before. It seems it is stuck on the first object it finds. Also lets say on line 3, 4, and 5 you have a "wait" statement and with "all open scripts" selected and you are searching for wait. it doesnt move from line 3 but when you change the option to current script the highlight will highlight the "wait" on line 4. now if you change it back to all open scripts rather then moved down to the next line (line 4 in this case) it returns to line 3 and is stuck again.

Warnings: gives wrong line number. Example = $station-> set command: {COMMAND_TURRENT_PROTECT) when i compile it gives a warning "Unsed variable '$staion' on line 0. even thou line 0 dosen't exist


Cosemtic:

Pg 23 of the manual is blank. :P

Is it worth fixing?:

would it be to much to ask if when the option Auto-open empty script is selected that a * isn't added to the "new1" or when a script is opened it replaces the empty script or even both options?
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Bug Report

Type: Typo
When: Auto Indent / Auto-Indent on Save feature
Cause: Using an EndSub makes indentation go back one

Desc: Go-Sub shouldn't make indentent in, as labels don't indent out
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

draffutt wrote:Works like a charm. thanks for all the hard work and effort you are putting into this.
No problem. Glad it worked! :)
draffutt wrote:When you select All open scripts with find and you click find next it will find the first object. But when you click on find next again the screen will flash and it will stay on the object it found before. It seems it is stuck on the first object it finds.
Okay, I've overhauled the Find/Replace code a bit now so it should behave more sensibly. Swapping from search current to search all mid-find may still cause it to start from scratch but it shouldn't get stuck any more (hopefully).
draffutt wrote:Warnings: gives wrong line number. Example = $station-> set command: {COMMAND_TURRENT_PROTECT) when i compile it gives a warning "Unsed variable '$staion' on line 0. even thou line 0 dosen't exist
I can't seem to reproduce this - it just tells me it's being used before being defined, or if I define it, then there's no warning. However, I looked at the code and did spot one place where maybe I'd missed out the check, so maybe I've fixed it now. If not, you'll probably need to give me a bit more of the script in question so I can track it down.
draffutt wrote:Pg 23 of the manual is blank. :P
Well spotted... :wink:
draffutt wrote:would it be to much to ask if when the option Auto-open empty script is selected that a * isn't added to the "new1" or when a script is opened it replaces the empty script or even both options?
I've got it so it starts off in the "saved" state, i.e. no *; I don't want to replace the empty script automatically though.
s9ilent wrote:Using an EndSub makes indentation go back one
Another well spotted bug - thanks! I've fixed it now and changed it a bit, so hopefully there shouldn't be any more "false ends".

Anyway, V1.026 is available here. Hopefully you'll find these bugs fixed now.
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

whimsy wrote:
draffutt wrote:When you select All open scripts with find and you click find next it will find the first object. But when you click on find next again the screen will flash and it will stay on the object it found before. It seems it is stuck on the first object it finds.
Okay, I've overhauled the Find/Replace code a bit now so it should behave more sensibly. Swapping from search current to search all mid-find may still cause it to start from scratch but it shouldn't get stuck any more (hopefully).
this appears to be fixed now with whatever you did

ok check this out:
http://www.4shared.com/file/60577301/9d ... tring.html

load this script in exscriptor then either add or remove a blank line at the end and save change. then open up compare and see what it does when you compare the original to the bak. for me nearly every line is red now. i have also noticed with these types of scripts when you are compairing but you make no changes in the left window and you close compare. Now a * appears after the script name leading to believe something now has changed and you the scripter didn't make any changes. don't know if this is good or bad.

Find / all open scripts: i don't know if this is what you intended or not. when i put in "amount" as the search string i had 15 tabs of scripts open with 4 tabs with this search word. when i hit find next it found the first one on tab 3 like it is suppose to. now when you hit next nothing appears to happen if there are no more "amount" in that tab. (but if you have more "amount" in the same tab it works fine as far as moving on to the next one). now if you wait about 30 to 45 secs (sometimes longer)and hit next it moves to the next tab (i had an "amount" in tab 4) or if you don't want to wait and you know which tab has the string you are looking for and select that tab and hit find next it works on the spot. what is happening i think is this: i checked the other tabs that had the string i was looking for and "amount" was highlighted in each of them so it seems there is a small issue with find moving to the next tab.

the close tab still doesn't quite work. but it is liveable. what happens is this: whatever tab you are working on and you close it; it opens the last tab and if you close it. then open the first tab and when you close that one it opens the last tab and repeats from there.

i know you put a disclamer in the manual about * but there are still additional problems. I.E it appears to change some of the contents of a line marked with a *

Code: Select all

 * skip if not $i MOD 5 == 0
to

Code: Select all

 * skip if not $i 5 MOD 0 ==
and this was in the bak file that was initially created (when first creating a .bak file there shouldn't have been any changes made.) when you save the original code the * contents get changed as well.

if you want to check it out yourself here you go: http://www.4shared.com/file/60586179/e5 ... ainin.html

modify any line you want except the ones marked * save so it creates a backup. then compare the original to the backup. also you will not know it changed the original * until you close then reopen the .xml

FYI:

just some geewiz info. if attempting to open a lot of scripts in exscriptor either A) becomes unresponsive (after 50 or so) or B) CTD's (over 100) :D
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Bug Report 1

Type: Typo
Where: Source Text

Desc: Using an EndSub makes indentation go back one in the Source Text (ie, if you open the script file in a xml viewer/browser)



Bug Report 2

Type: [SECTOR] Not functioning correctly
Where: Source Text, Unsure about code array

Desc:
http://members.optuszoo.com.au/whyistha ... nrange.xml
Line 37, It should read "if $sector = [SECTOR]". No matter how I try to set up that line, it refuses to put anything with the [SECTOR] constant.
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

draffutt wrote:load this script in exscriptor then either add or remove a blank line at the end and save change. then open up compare and see what it does when you compare the original to the bak. for me nearly every line is red now.
When it loads, it sometimes adds extra white space (spaces, tabs etc). The comparator was too sensitive and it was seeing these as differences. I've told it to ignore white space and now when the files are compared, there's no difference.
draffutt wrote:i have also noticed with these types of scripts when you are compairing but you make no changes in the left window and you close compare. Now a * appears after the script name leading to believe something now has changed and you the scripter didn't make any changes. don't know if this is good or bad.
Remember, once loaded into Exscriptor the script is just text - if you can't see any changes, then it's most likely nothing has changed. It's only when you save that anything potentially invisible happens, at which point you won't know until you reload / refresh it. Anyway, this particular issue only happens when it highlights any differences (highlighting sometimes triggers the *) so you can safely ignore it unless you changed anything yourself. :)
draffutt wrote:Find / all open scripts: <snip>... it seems there is a small issue with find moving to the next tab.
Yeah - it seems I forgot to skip a tab if it doesn't contain the search item, so you'd have to keep pressing it (advancing one tab each time) until it found the next tab with the search item. Anyway, it should all be fixed now!
draffutt wrote:the close tab still doesn't quite work. but it is liveable. what happens is this: whatever tab you are working on and you close it; it opens the last tab and if you close it. then open the first tab and when you close that one it opens the last tab and repeats from there.
It only remembers the last tab - once you've closed the first one, it doesn't remember the rest. In the future I may extend it to remember all in the future but I'm not sure it's worth the effort... :wink:
draffutt wrote:i know you put a disclamer in the manual about * but there are still additional problems. I.E it appears to change some of the contents of a line marked with a *

Code: Select all

 * skip if not $i MOD 5 == 0
to

Code: Select all

 * skip if not $i 5 MOD 0 ==
I knew there was another reason I hated commented commands... The expressions are really weird. Anyway, I think I've fixed it now so hopefully commented expressions will behave properly.
draffutt wrote:just some geewiz info. if attempting to open a lot of scripts in exscriptor either A) becomes unresponsive (after 50 or so) or B) CTD's (over 100) :D
Actually I'm amazed it even gets to 50! :D
s9ilent wrote:Using an EndSub makes indentation go back one in the Source Text (ie, if you open the script file in a xml viewer/browser)
I hate it when I forgot something obvious... Okay, I've fixed this as well now.
s9ilent wrote:Line 37, It should read "if $sector = [SECTOR]". No matter how I try to set up that line, it refuses to put anything with the [SECTOR] constant.
Two things are going on here. The first problem is that the code should really be "if $sector == [SECTOR]"; that's why it's giving you weird results, because it's ignoring the bit it doesn't like. However, it's still a bug because it should tell you, not just ignore it. So now Exscriptor will give you an error message if you try to use an assignment and a conditional together like this in an expression. :)

V1.027 is here - hope it works better this time!
draffutt
Posts: 4293
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt »

Received an error today "Could not check parameters for call to: "file name": file not found. it seems some scripters when creating scripts for uninstall routes put uninstall scripts into a folder called uninstall. can you have exscriptor check for this directory when compiling and/or saving?

Is this intended? if i highlight a item in a line for instance {video enchancement goggles} and i want to replace it with something else I.E. {docking computer} rather then replacing it. it does this: {docking computer}{video enchancement goggles}

can you change the close all pop-up to something like this:

Save all and close
Save none and close
Save highlighted/selected and close (the user has the ability to either highlight(if it is a command type menu) or slected which one are to be saved since it would list which scripts were changed)
Do not close
Last edited by draffutt on Sun, 31. Aug 08, 23:48, edited 2 times in total.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate »

I didn't really do much scripting, but so far the last few versions have been bug free, so good job! I did have a slight problem where empty comments, when saved by X3, would be rendered as '* ?' in Exscriptor. I'm not positive this has been fixed yet.

I had one feature suggestion: when you are changing multiple files, sometimes the arguments change or perhaps a file is moved, so it would be good to have a 'compile all; stop on errors' (or optionally on warnings) function which sends you to the tab which had errors.

Edit:
OK I was mistaken:

CTRL+F
replace: <value>, <value>, <value>, <value>, <value>
with: null, null, null, null, null

Nothing happens.

When you replace "<value>," with "null," only every other correct match is found.

Other similar tests also result in missed matches.

Edit 2:
The find box stays on top of all windows if you tab out.

Unused script arguments don't seem to get checked any more.

Commented code is being checked for unassigned variables.

Edit 3:
Welp, I broke the lawn mower so today is an intensive scripting day ^^

- ctrl+X then undo, then press an arrow -- cursor is somewhere random
- find box could do with a 'start from beginning' checkbox
- in a script call, if you put a parameter as "[TRUE", it will report not enough params instead of a syntax error.
- if you remove an argument from a script, then open a script which calls it with the old interface, the extra parameter's name is equal to the first (so it's looping round) Example:

Code: Select all

$supplierTuple = [THIS]->call script 'bunker.resupply.travel.findsupplier' : fromSec=$currSec  toSec=$demanderSec  reserveEnergy=$reserveEnergy  fromSec=[TRUE]
The last parameter was removed.

- it would be nice to have a go-to-line function from ctrl+g
- it would be useful if, for scripts which have not enough parameters, it would load the parameter name (only on 'refresh from file'). It saves loading up the script and checking my docs! Perhaps it could load it with a syntax error like <?> as in X3?
- if you open a script which is already opened, the textbox should ask if you want to select the tab (so the buttons would be "reload", "go to script", "cancel")
- reordering tabs would be nice but I guess that stuff is hard on windows.forms...
- doesn't check if you have two goto labels named the same
Whimsy
Posts: 167
Joined: Mon, 9. Feb 04, 20:32
x3tc

Post by Whimsy »

draffutt wrote:Received an error today "Could not check parameters for call to: "file name": file not found. it seems some scripters when creating scripts for uninstall routes put uninstall scripts into a folder called uninstall. can you have exscriptor check for this directory when compiling and/or saving?
This is only a warning to let you know the file isn't callable. I prefer to leave it like it is, that way if you do have a call to a file that's in another directory (and thus cannot be called), it let's you know that it might not work.
draffutt wrote:Is this intended? if i highlight a item in a line for instance {video enchancement goggles} and i want to replace it with something else I.E. {docking computer} rather then replacing it. it does this: {docking computer}{video enchancement goggles}
This is something I kept meaning to fix, so thanks for reminding me! It should be okay now, i.e. it will replace the highlighted text, not just insert it all the time.
draffutt wrote:can you change the close all pop-up to something like this:
Changing the pop-up that much is more effort than it's worth (since it means desigining a completely new one). However, I have changed it so that it asks you if you want to save them all; if you press yes, it saves, press no, it just closes them all, and press cancel and it does nothing.
bunkerprivate wrote: I did have a slight problem where empty comments, when saved by X3, would be rendered as '* ?' in Exscriptor. I'm not positive this has been fixed yet.
I'm pretty sure I fixed it, but it may be that the file is still in a "corrupted" state, so to speak. Try loading it in the Exscriptor, getting rid of the ?, and then resaving it; that should hopefully get rid of it. If not, let me know and I'll poke around a bit more.
bunkerprivate wrote:so it would be good to have a 'compile all; stop on errors' (or optionally on warnings) function which sends you to the tab which had errors.
Good idea; I've implemented this (and it also features as part of a Save All feature too). It doesn't stop on warnings, but it will on any errors.
bunkerprivate wrote:CTRL+F
I have grown to hate that innocent-looking dialogue box. It's a nest of weird bugs. I think I've caught this particular one now (and a couple of others). I also stopped it being on top all the time and also added a "From start" search option, to restart the search from the top. Yet even so I fear I've not seen the last of Find/Replace... :roll:
bunkerprivate wrote:Unused script arguments don't seem to get checked any more.
I think I broke this in an earlier bugfix. It should work again now.
bunkerprivate wrote:Commented code is being checked for unassigned variables.
Never thought to check that! :D Well spotted - it should now be fixed.
bunkerprivate wrote: ctrl+X then undo, then press an arrow -- cursor is somewhere random
Undo/Redo always does strange things. One day I'll get round to overhauling it. In the mean time it should have stopped doing it now.
bunkerprivate wrote:- in a script call, if you put a parameter as "[TRUE", it will report not enough params instead of a syntax error.
There's actually not a lot of checking on call script parameters at the minute, beyond counting how many there are. It's on my list of things to redo but for the time I'm afraid it's unchanged.
bunkerprivate wrote:- if you remove an argument from a script, then open a script which calls it with the old interface, the extra parameter's name is equal to the first (so it's looping round)
I cannot believe you spotted this! It's actually down to an almost invisible bug where all the called script's parameters were being loaded repeatedly (once for each parameter being passed in) - hence when it ran out, it moved on to the next. Turns out I had a piece of code caught in the wrong for loop. Anyway, it's fixed now! :oops:
bunkerprivate wrote:- it would be nice to have a go-to-line function from ctrl+g
Good idea - I've added one in the Edit menu now.
bunkerprivate wrote:- it would be useful if, for scripts which have not enough parameters, it would load the parameter name (only on 'refresh from file'). It saves loading up the script and checking my docs! Perhaps it could load it with a syntax error like <?> as in X3?
I'm not entirely sure what you mean here, but what I've done is get the warning/error to display all the expected parameters so at least you don't need to open the other script to check them. Altering the code itself to display the correct names mid-compile is a bit more difficult...
bunkerprivate wrote:- if you open a script which is already opened, the textbox should ask if you want to select the tab (so the buttons would be "reload", "go to script", "cancel")
I just use a simple built-in MessageBox to do these pop-ups, and as I mentioned to draffutt, it's not really worth the effort of creating an entirely new form for something like this - though maybe in a later version I'll improve this kind of thing. What I did do is get it to go to the already-existing script if you press "no" (for don't reload).
bunkerprivate wrote:- reordering tabs would be nice but I guess that stuff is hard on windows.forms...
You'd think it'd be built in, but apparently not... I did manage to get a fairly clunky solution working though. :)
bunkerprivate wrote:- doesn't check if you have two goto labels named the same
Good idea - I've included a check for this too now.

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

Post by draffutt »

small quirk with undo.

1st: if for example you make 2 changes to the current open script then you hit undo 3 times; the third time you hit undo the script is blank (deleted?) but the tab remains open and needed to be saved according to exscriptor. fortunately redo recovers what disappeared.

2nd: You may want to change the comment about undo/redo in the manual. it appears to remember the last 25 changes PER open tab (only 25 per open tab). or you can always let the scripter find that out themselves. :wink:

at a future time could you add an option to change the default backround and fonts (namely the 2 bottom, the side, and the pop ups windows) to a say black backround with green fonts?

again at some point could you also can you include the ability to turn on or off the case sensitivity of auto-complete? I.E. currently if i wanted to find out what items can go into the "bay" of a ship and i type "bay" only "Cargo bay extension" is listed. But if i type "Bay" only "Cargo Bay Shielding" is listed.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes
bunkerprivate
Posts: 27
Joined: Fri, 4. Jul 08, 16:01

Post by bunkerprivate »

I'm not entirely sure what you mean here,
Your way is better anyway. ^^

All the new features are working well so thanks for the update again.

I have some new bugs though:

- The conflict checker is reporting errors in files which do not exist (I never checked this before but I'm pretty sure it's alwasy done that).
- Use ctrl+mousewheel to change the font size. Any change to the text makes the fontsize switch back to what it was.
- Var usage checker won't detect eg:
$var = f(); // this should show as unused but does not
$var = f();
g($var);
Maybe it's impossible to detect given gotos and the crappy variable scoping rules?
- "$value = get task PID" is never recognised but is in the commandlist; it should be "get pid" I think (which is recognised).
- I mentioned this before and you said it was too difficult, but it gets in the way so I'll mention it again: the textbox does not get the focus when you click on the tab. This means that you can't copy/paste straight away, though it looks like it worked, and using any movement keys moves you about in the tab list instead of the document.
- It seems if the first time you put a label in it works, but the next compile reports a duplicate label. Workaround is to reload X3 data, but it's still a bit of a blocker.

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

Post by Whimsy »

draffutt wrote:1st: if for example you make 2 changes to the current open script then you hit undo 3 times; the third time you hit undo the script is blank (deleted?)
I think I've fixed this now, but as I've said in the past, the undo/redo is very klunky. For instance, I noticed the cursor is doing strange things again when you undo; I'm not sure whether that's new or what. At some point I'll redo it all (pun not intended) if I get chance.
draffutt wrote:2nd: You may want to change the comment about undo/redo in the manual.
I've updated it now. In fact it still said 25 when I upped the limit to 50 anyway... :wink:
draffutt wrote:at a future time could you add an option to change the default backround and fonts (namely the 2 bottom, the side, and the pop ups windows) to a say black backround with green fonts?
Why not. I've included this in V1.029 so you can customise fonts/colours etc if you want.
bunkerprivate wrote:again at some point could you also can you include the ability to turn on or off the case sensitivity of auto-complete?
I've added this too; it should be not case sensitive by default, but if for some reason you wanted it to be, you can set it in the options.
bunkerprivate wrote:- The conflict checker is reporting errors in files which do not exist (I never checked this before but I'm pretty sure it's alwasy done that).
The file must exist somewhere! It's probably in one of the numeric CAT/DAT files, or maybe a mod? I use a library to load all the data files so sometimes it's hard to figure out exactly what's going on...
bunkerprivate wrote: Use ctrl+mousewheel to change the font size. Any change to the text makes the fontsize switch back to what it was.
I honestly didn't even know you could do this... must be built in functionality in the text box. I tried to track down why altering the text reset the zoom, or simply work around it by storing then resetting it, but I didn't have much luck. Frankly there seems to be some very bizarre stuff in WinForms, like built in Undo/Redo functions that don't work most of the time (!), scroll bars that are almost inaccessible, and this mysterious zoom capability. Anyway, I think I'll leave this one: since I didn't know it could zoom in the first place, I don't really regard it as a loss in functionality. :D
bunkerprivate wrote:- Var usage checker won't detect eg:
$var = f(); // this should show as unused but does not
$var = f();
g($var);
Maybe it's impossible to detect given gotos and the crappy variable scoping rules?
I'm not entirely sure what you mean in your example - if you assign a var as a result of a command, it still checks whether it's used later or not (at least I think it does!). But there's zero scope checking, if that's what you're getting at? :?
bunkerprivate wrote:- "$value = get task PID" is never recognised but is in the commandlist; it should be "get pid" I think (which is recognised).
Well spotted - it should probably be "get PID" but as the case is ignored, "get pid" is fine too. I've updated CommandList.txt accordingly.
bunkerprivate wrote:- I mentioned this before and you said it was too difficult, but it gets in the way so I'll mention it again: the textbox does not get the focus when you click on the tab.
After looking into the tab order swapping and always-on-top Find problems earlier, I figured out a way of doing this that was easier than I expected, so it should work okay now.
bunkerprivate wrote:- It seems if the first time you put a label in it works, but the next compile reports a duplicate label. Workaround is to reload X3 data, but it's still a bit of a blocker.
Forgot to clear the checked names! All sorted now though.

V1.029 is here.

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