Script Debugger

The place to discuss scripting and game modifications for X²: The Threat.

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

Carl Sumner
Posts: 5145
Joined: Mon, 23. Feb 04, 01:28
x4

Script Debugger

Post by Carl Sumner »

I haven't found any info on the debugger section of the script editor. So here is what I think I've learned so far. :wink:

Edit 21 Oct 2004: Added info. Thanks Kailric, ticaki and Burianek.


To access the Script Debugger go to any of your ships Command menu and press "s" for the script editor. The name of the ship you'r debugging will be listed as "Script Debugging:Your Argon Nova".

The Script Debugger has two modes. Log and Trace. Press enter on this command to change it. The command to Clear the Log also sets the mode back to off. The Debug Menu shows the logged lines and is different in Log mode than in Trace mode.

While in the script editor command menu, highlight "Script Debug Menu" and press Enter. You must have the command set to Log, or Trace, for this to show any logs.

Lines that are skipped are not shown. Encrypted scripts and internal routines do not show their lines, instead the log pauses until the routine is finished. If a command such as "follow" or "fly to sector" has been called then this can be a long time.

1. The Log mode stores the lines as they are executed but does not noticably slow down the script. Values of variables are not shown.

You can scroll up and down with the PgUp and PgDn keys or the up and down arrow keys. The newest lines are at the bottom.

The log starts when you set the mode to Log but stays until you use the Clear Log command to erase it. It can get quite long. The log is separate for each object.

2. The Trace mode shows the line executing (and the previous ones) but waits for an Enter keypress before it continues to the next line. If you do not press Enter, that ship will freeze when the current line finishes, but other ships do not. You can scroll up and down in the line list with the PgUp and PgDn keys. The newest line is at the bottom. It is highlited.

When each line completes, the display will show the associated variable values in the lower pane. You can scroll up and down in the data list with the up and down arrow keys. Only local data is shown.

Be sure to Clear the degug log and set the mode to off when you are done. If the logging is left on it can slow the game and increase the save game size.

There does not appear to be a Breakpoint command. I did not see any way to view Global variables or Object properties.

Using the debug mode is much better than putting print lines in the code to see what is going on. You would be amazed what you can see about your scripts. :wink:


Please post here if you have any corrections or additional info. :)
Last edited by Carl Sumner on Thu, 21. Oct 04, 20:25, edited 1 time in total.
Tinker

"If engineers built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!"
User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek »

Sweet. Thanks.
I've been doing all of my stuff the hard way to date.
Maybe I'll break down and make things easier on myself now.
Cheers.

I'm certain if ticaki already knows anything about this, he'll be willing to enlighten the ignorant americans :D so that as info is added here I can reference it from the sticky.

*nudges ticaki*
"Nature's first green is gold" . . . stay golden.
Carl Sumner
Posts: 5145
Joined: Mon, 23. Feb 04, 01:28
x4

Post by Carl Sumner »

Burianek wrote:Sweet. Thanks.
I've been doing all of my stuff the hard way to date.
Maybe I'll break down and make things easier on myself now.
Cheers.

I'm certain if ticaki already knows anything about this, he'll be willing to enlighten the ignorant americans :D so that as info is added here I can reference it from the sticky.

*nudges ticaki*
Any additional info greatly appreciated. :D
Tinker

"If engineers built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!"
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Just don't forget to turn off logging when your done testing cause all that text can bring your pc to a snails crawl if you should check the log..say 5 minutes or more after you started logging.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
Carl Sumner
Posts: 5145
Joined: Mon, 23. Feb 04, 01:28
x4

Post by Carl Sumner »

Kailric wrote:Just don't forget to turn off logging when your done testing cause all that text can bring your pc to a snails crawl if you should check the log..say 5 minutes or more after you started logging.
Good point... :wink:
Tinker

"If engineers built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!"
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13124
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

Is this log in the main player log?
Come watch me on Twitch where I occasionally play several of the X games
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Xenon_Slayer wrote:Is this log in the main player log?
No, its in the "script debug menu"... to access the menu go to any of your ships command menu and press "s" for the script editor. The name of the ship your debugging will be listed as Script Debugging:Your Argon Nova

Then you can use the other tasks that Carl mentioned....
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13124
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

No. Where do you view the logs?
Come watch me on Twitch where I occasionally play several of the X games
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Xenon_Slayer wrote:No. Where do you view the logs?
while in the script editor command menu, Highlight "script debug menu" and press enter. You must have the command set to log, or trace for this to show any logs
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
ticaki
Posts: 4861
Joined: Wed, 6. Nov 02, 20:31
x3

Post by ticaki »

Kailric wrote:Just don't forget to turn off logging when your done testing cause all that text can bring your pc to a snails crawl if you should check the log..say 5 minutes or more after you started logging.
a very wise point... one time i forgotten to stop the logging... it result in a 15,03 MB Savegame... and a check over all freighters which one do it...

Greets ticaki
Zur Zeit nicht aktiv

Return to “X²: The Threat - Scripts and Modding”