How to debug scripts

Post » Wed Jun 20, 2012 12:11 am

Just getting into Papyrus. I'm working on a script that isn't working so I'd like to know what's the value of its properties and variables at certain stages to narrow down the problem. I've seen this feature used somewhere on the net but I can't find it now, I've been searching the wiki to no avail.

Can anyone point me to the right direction? I need to know how to print values from the code and how to view them in-game. Thanks!
User avatar
Lifee Mccaslin
 
Posts: 3369
Joined: Fri Jun 01, 2007 1:03 am

Post » Wed Jun 20, 2012 1:16 am

Here is a list of debug functions: http://www.creationkit.com/Debug_Script

Messagebox is a particularly useful one. You can print the value of the variables by debug.messagebox("MyVariable is: " + MyVariable )

I'm not 100% positive if that syntax is correct but it's a starting point.
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Tue Jun 19, 2012 9:26 pm

Thanks! That works. On the same subject though, I found this on the wiki:

"NOTE - Those messageBox() debugs might get a little intrusive, and you certainly don't want them appearing for other developers when they look at your content. Importing debug.psc also gives access to the trace() function. Just replace messageBox() with trace() and your debug messages will only appear on the Papyrus TDT page and the Papyrus log file, located in the Logs/Papyrus folder in your game folder. (Log 0 is the newest log, the game will save your 4 newest log files for you)"

And below, there's a picture of the log being displayed in the game. This looks like something really useful but I can't find a way to show it in the game. What's the Papyrus TDT the wiki is talking about?

Searching for these keywords hasn't been helpful at all.
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm

Post » Tue Jun 19, 2012 6:36 pm

Check the first post http://www.gamesas.com/topic/1345130-having-papyrus-trouble-here-are-some-things-to-try/, and the link to Papyrus console commands at the bottom of that post.
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Tue Jun 19, 2012 9:01 pm

TDT is toggle debug text, apparently its not available in the release version of skyrim (only for bethesda or something)
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm


Return to V - Skyrim