View Full Version : How to get Python Console in BTS
Refar Aug 04, 2007, 04:43 PM I am sure that was covered somewhere... the trouble is, i can not find where.
I am trying to cook up a new Random Map Script and have some trouble debugging.
Waht i have found is: putting CheatCode = chipotle in the ini file and different suggestions, what key to use to open a console... None Worked
What i need is: a console where i can see the output of the Python interpreter 'live'. Even better a console where i can directly write code sniplets, to see what happens.
Thanks.
JeBuS27 Aug 04, 2007, 04:48 PM press "Shift" + "~"
Refar Aug 05, 2007, 03:04 AM Ok, i got the console thanks....
But is there a way to see the Python output in it ? (or at all)
I have seen "print(...)" calls, wich obviously are meaned for debugging in the civ4's map Scripts, so i assume there is a way to read them... but for now i dont know how - they do not appear in the console, and they are not going into any of the log files...
JeBuS27 Aug 05, 2007, 10:06 AM I don't know of any way to get them to print to console, but there are some debugging flags in the Civilization4.ini file that makes the stuff print to log files.
Refar Aug 05, 2007, 04:00 PM yeah i know... but i was hoping to make faster progres, if using the using the console. thanks anyway :D
Ellestar Aug 09, 2007, 11:55 PM Ok, i got the console thanks....
But is there a way to see the Python output in it ? (or at all)
I have seen "print(...)" calls, wich obviously are meaned for debugging in the civ4's map Scripts, so i assume there is a way to read them... but for now i dont know how - they do not appear in the console, and they are not going into any of the log files...
Doesn't it work if you just type 'print <something>' in console? I'm sure i was able to print a variable to the screen from a console somehow, but i forgot the exact way.
As i understand, there is no difference if you call any function from a game script or from a console.
EmperorFool Aug 10, 2007, 11:53 PM I think Refar is asking how to have print calls inside Python modules go to the console. I'm talking about when the game is running your code normally, not when you call a function from the console.
Unfortunately, I haven't figured out how to get debug output like that, so I use CyInterface() to print messages to the screen.
Also, when I call a function from the console that prints something, I find that often times strings are printed twice. I cannot find a reliable pattern here, but the same calls produce the same repeats (the repeat is repeatable, as they say). Does anyone know what that's about?
Finally, sometimes the console gets borked so that no matter what command I type I get the error: "Invalid syntax: command not found" -- even import statements. This just happened when I used the console just fine, then closed it, then reopened it and now it won't take any commands. :cry:
Refar Aug 19, 2007, 12:59 AM I think Refar is asking how to have print calls inside Python modules go to the console. I'm talking about when the game is running your code normally, not when you call a function from the console.
Unfortunately, I haven't figured out how to get debug output like that, so I use CyInterface() to print messages to the screen.
Yes i was talking about this :D And i did not figured it out too. In addition i am working on map script, and for the most time when generating maps, the screen is frozen anyway... So i am sticking with Windowed mode and a texteditor having the option to reread a file when changed on disk...
kazapp Jun 02, 2008, 10:50 AM Finally, sometimes the console gets borked so that no matter what command I type I get the error: "Invalid syntax: command not found" -- even import statements. This just happened when I used the console just fine, then closed it, then reopened it and now it won't take any commands.
This just happened to me.
("won't take any commands" = all commands give the Invalid Syntax error)
What can I do about it? (Rebooting my computer didn't help)
Can I somehow restart the console, so I get the initial greeting message again?
EmperorFool Jun 02, 2008, 09:25 PM Rebooting my computer didn't help.
Really? It was a long while ago for me when I tried using the console, but I thought restarting Civ fixed the problem. I'm on an entirely new computer. Sorry I can't be any help.
|
|