Where do debug strings appear?

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
User avatar
Swallen
Posts: 279
Joined: Tue, 11. Oct 11, 19:13

Where do debug strings appear?

Post by Swallen » Thu, 21. Nov 13, 23:57

Throughout the game scripts I can see debug_text tags.

I'm particularly interested in seeing the text output by the trade.performplayertraderun.xml script. debug_text tags in this script have a 'chance' value set to 0.

Are these strings supposed to be visible anywhere in-game, perhaps by toggling some value somewhere, or are they just logged to a file or something like that?

Thank you

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Re: Where do debug strings appear?

Post by Mad_Joker » Fri, 22. Nov 13, 00:03

Swallen wrote:Throughout the game scripts I can see debug_text tags.

I'm particularly interested in seeing the text output by the trade.performplayertraderun.xml script. debug_text tags in this script have a 'chance' value set to 0.

Are these strings supposed to be visible anywhere in-game, perhaps by toggling some value somewhere, or are they just logged to a file or something like that?

Thank you
Sadly, <debug_text> doesn't seem to work. The commonly used workaround is to use <show_help force="true" custom="'your text'" />.

To get the output from the trade script you mentioned, you would need to create a patch file and replace the debug_text entries with show_help entries.

felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha » Fri, 22. Nov 13, 00:22

the following will show up in your logging:

Code: Select all

<debug_text text="'text here'" filter="error" />
the filter="error" part is because only error level messages show up. Remove the chance parameter, btw.

logging will end up in /documents/egosoft/x rebirth/<randomnumber>/rebirth.log

you can also see it ingame by binding a key to the debug screen

I'm using a free tailing too to see logging as it happens, like mTail
http://ophilipp.free.fr/op_tail.htm
-- This code keeps amazing me...

User avatar
Swallen
Posts: 279
Joined: Tue, 11. Oct 11, 19:13

Post by Swallen » Fri, 22. Nov 13, 00:24

Oh I see. Thanks.

Using the replace tag, is there a way to reference the values of the tag being replaced (so I can include them in the new tag)? Similarly to how captures work in regexp.

Better still, is there a way to select tags by tag name regardless of their path?
That way I could replace all debug_text tags with show_help ones, add the 'force' property and the 'custom' one, plugging in there the value from the selected tag.

Forgive my ignorance, but I've been reading the RFC 5261 and figured it would be faster if someone here knew.

EDIT: Just to clarify, I'm trying to figure out if there's an OK way to implement semi-detailed trade ships reports with the tools we have at the moment (no proper UI).

I know I'm being lazy here, but before starting coding conversations and whatnot I'd like to see what kind of info is available from the abundant debug output in the code.

felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha » Fri, 22. Nov 13, 00:31

no, you'll need to specify the complete path to the tag.

but... you can also just use a replace on the root element, en copy almost the entire file into it. That way you're overwriting the original script with your own (which is identical) and you can just alter the debug_texts
-- This code keeps amazing me...

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Fri, 22. Nov 13, 07:56

felrasha wrote:no, you'll need to specify the complete path to the tag.

but... you can also just use a replace on the root element, en copy almost the entire file into it. That way you're overwriting the original script with your own (which is identical) and you can just alter the debug_texts

Only do this for debug reasons, it should be adopted as bad practice to do this in a released mod.

felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha » Fri, 22. Nov 13, 10:11

Yes, for that particular example it would be considered very bad practise to do that in a release build.
Unless you plan on completely rewriting broken code that won't work otherwise anyway (and which nobody else has already completely rewritten), you should avoid the above to prevent compatibility issues
-- This code keeps amazing me...

TarJensen
Posts: 8
Joined: Fri, 27. Feb 09, 08:32

Post by TarJensen » Fri, 22. Nov 13, 15:04

How can you bind a key for the debug window to show up ?

Thanks

felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha » Fri, 22. Nov 13, 15:11

that's in the normal ingame options menu : Settings -> Controls -> Space -> Open Debug Log
-- This code keeps amazing me...

TarJensen
Posts: 8
Joined: Fri, 27. Feb 09, 08:32

Post by TarJensen » Fri, 22. Nov 13, 15:51

thank you; I was looking to the wrong place :s

User avatar
Swallen
Posts: 279
Joined: Tue, 11. Oct 11, 19:13

Post by Swallen » Fri, 22. Nov 13, 20:02

Thanks for your helpful posts everyone. I've seen that Enhanced Fleets does what I was looking for and more, so I've moved on to a much grander project.

More news soon. 8)

Post Reply

Return to “X Rebirth - Scripts and Modding”