Sorry to dig up an old thread here guys, but I'm having a problem getting print statements from python scripts visible. I have run the patcher on temple.dll, and also put the reg entries in so I get a debug window with messages that also get written to a log file. I don't get anything coming up on the console, and the print statements I've put in py scripts don't appear in the debug written to a file. Does anyone have any idea what I could be doing wrong, or maybe there's a more recent thread (I couldn't find one) detailing a new way of getting this to work or something. I'm assuming that all active modders use the print statements in py scripts regularly.. it must really help. Thanks, H.
I've never had any luck with the register entries. I just use the patcher to enable console prints. Sometimes it doesn't work on the first try for me though, and I have to run it again. There is a way to redirect the console output from the console though. Code: import sys sys.stdout = open('c:\\output.txt', 'w') This will cause all the console output to be written to C:\output.txt rather than being displayed in the console. The credit for this goes to Agetian. He told me how to do it.
So you type that at the console and all further output is written to that file? It's not going to help me much if there's nothing being written to the console, but I'll try the patcher again and see if I can get the print statements appearing. RnR mentioned last night that you use a debugger for the python scripts - is that right? Have you posted instructions anywhere on how to set that up? Thanks for the help, H.
Wow, how could I have missed the second part of this thread... Blue, the reg keys do work, I've imported them and started in windowed mode et voila, one debug console coming up. Spamming me with stuff I don't know wether it will be useful, but anyway. Yay. :dance: edit: How the heck did they ever find that one out?
Maybe I'm doing it wrong, but it does nothing for me. Anybody care to give me a step by step of how they did it? [EDIT] Nevermind, I figured it out.
Thanks to Hazelnut for bringng this thread back up. I've gleemed over old threads in this section, but never got to this one. I know, don't say it, I've heard. Anyway, thanx again nut, your insightful diligence made me decide to check it out after-all, Hope it works for me.
I now have this working, and boy is it helpful to see debug output. Anyone doing any serious scripting without this on must be in constant danger of going loopy.. :crazy: The mistake I made, and I assume others who have not been able to get this working have also made, is to patch the wrong temple.dll file. If you use the front end, which I'm sure most people do, then you need to patch the one in modules/Co8-5.0.0 and not the one in the root ToEE directory. D'oh. Voila, debug output from the python scripts! :thumbsup: I've spent several hours this evening finding out which san's fire and in what order when equiping/unequiping items - there's no way I'd have been able to progress to where I am without the debug output. Personally I think this thread should be stickied in the ToEE Toolset Project Documentation forum, anyone agree?
As an aside, and I haven't tested this, but when I was working with Tim Cain & co. at Interplay, all of our computers had two monitors. The first was the regular display monitor and the second was the debug monitor, generally a small black & white deal on the side. The debug prints defaulted to going to the second monitor, so it may be that the output stream is sent there from ToEE by default.