Is there a script debugger?? |
To those mod makers especially AI upgrade mods; Is there a script debugger that work with SE's script parser or compiler??
Another way to rephrase the question:
How do AI moders know that the computer executes their AI commands properly. How do they know the return value of a specific function in SE5?

Re: Is there a script debugger??
I think you can turn on logging and then add some output statements to your scripts. I've never tried it, however.

Re: Is there a script debugger??
You can script in some commands to log events (variables, and such) to check where or when something should execute (or if it didn't). A memory dump of all the variables by name is what I use, it lest me know if they were initialized or not, if they got the right number at the right turn.
But other than that, you have to know your scripting code is set up logically. The parser will compile bad code (syntax aside), say, loop forever mess up will hang your game.

Re: Is there a script debugger??
The file DebugSettings.txt in the data folder allows you to debug various things, including the execution of the various scripts.
Only the changing the DebugSettings.txt file in the default data folder will cause debug logs to be printed. To have logs made of the script execution, you'll want to set "Debug Section Script Evaluation Detailed := TRUE". This will create a big text file in the backup folder under the player name and turn number. It's a line by line print out of that AI's script being executed... these files get big fast as the number of game objects increase. The "simple" version is about half as much detail.
Below are the typical settings I use for debugging. If you look at my source AI scripts, you'll see I use the script function "Sys_Debug_Print" a lot to print out specific things about the AI in conjunction with setting "Debug Print Sections := TRUE". This produces a condensed log of only items I want to know each turn.
Generate Game Debug Log := TRUE Generate Engine Debug Log := FALSE Use Fast Debug Log := FALSE Debug Section Engine Startup := FALSE Debug Section Creation := FALSE Debug Section Sound Base := FALSE Debug Section Display Class := FALSE Debug Section Sobj Ship := FALSE Debug Section Display Object := FALSE Debug Section Formula Evaluation := FALSE Debug Section Script Evaluation Detailed := FALSE Debug Section Script Evaluation Simple := FALSE Debug Section Script Evaluation Debug Print Only := TRUE Debug Print Sections := Colonies, Construction, Intel, Planets, Politics, Research, Ships, State, System Debug Section Compute Highest Tech Level := FALSE Debug Section Master State Machine := FALSE Debug Section Order Execution := FALSE Debug Section Combat := FALSE Debug Section Combat Speed := FALSE Debug Section Main Drawing Loop := FALSE Debug Section TCPIP := FALSE Debug Section End All Players Turn := FALSE Debug Section Host Processing := FALSE Debug Section Phased Movement := FALSE
Re: Is there a script debugger??
Nice, thanks Kwok.
"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
Download my mod here: GidMod
or there:




Re: Is there a script debugger??
The compiler checks for errors automatically.
Aside from that, the only tools I know of for detecting what you are asking is through observing the AI in action.
"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
Download my mod here: GidMod
or there: