Printing debuging info

Users who are viewing this thread

svaucher

Veteran
Anybody got a good technique? The only technique I know is to invoke

- display_message (can we add register info/vars/other??)
- adding a dialog trace, but asking npcs my information

To get info via dialog, I set registers in my condition block, and access the info using "{regX}", does anyone know if we can access var information directly in a spoken dialog?

Finally, I see that there is a syntax of {s<digit>} used for caravans missions in vanilla M&B, anyone know how that works?

cheers,
sv
 
The {sdigit} seems to refer to values refering to store commands (with the prefix str_) Only been using the unofficial ed though, I'm scared of Pythons.

That's actually quite unhelpful. Sorry :sad:
 
display_message, unlike dialogs, cannot show numeric values stored in variables. I was wanting to use it as such myself, maybe it will be enabled in the future. For debugging to get the a number printed out, I've been using the "add_xp_as_reward" command, though a few others would work as well. When you're rewarded XP or gold, it will of course show the message briefly giving the number.
The s(0) set is as you're thinking, an array of strings. Other strings can be set to them and the strings displayed in dialogs using "{s0}", but again, it doesn't seem to work in other commands such as display_message and instead just outputs the literal "{s0}" string.
The s(0) array can be set to the name of parties and troops and such using various operations. Header_operations.py of course lists all of them, though at least a few don't quite work right currently.
 
I've been mostly using dialogs to debug. I code most complex behaviour in scripts (Triggers only call scripts) so that I can invoke them talking to a "debug NPC" instead of waiting for a trigger to be invoked. I like your idea of using add_xp_as_reward, but if it acts like display_message, it might have problems displaying 20+ messages in a row.

sv
 
Back
Top Bottom