Event text

xooll

Chieftain
Joined
Jun 3, 2011
Messages
77
Is there a way to make text appear at the top of the screen (like combat results, new technologies, "Swedish scientists discover a new kind of pig", etc. do) from a Python function? My guess was print(), but that doesn't seem to do it.
 
CyInterface.addMessage() or CyInterface.addImmediateMessage(). Both are found in the API.
 
Here I was, ctrl+f-ing in there for "text" when I should have been looking for "message". Thanks!
 
By the way, the print command is useful for adding debug messages to \Documents\Games\BtS\Logs\PythonDbg.log

You might need to enable logging in the main INI file firstly though. Of course you've already enabled Python exceptions and pop-ups, right?
 
You really shouldn't attempt Python scripting without enabling exceptions. Take it from someone who tried that... :rolleyes:
 
Well, it's not the only bad programming practice I'm using out of laziness... like writing several functions before testing anything...
 
Oh, I can totally write a 1000 line module before ever testing any of it... :rolleyes: But once I do I make sure to have exceptions enabled, because then I can get the code actually working in shorter time than it took me to write.
 
Yeah, I got 'em enabled now. And whaddaya know? It found a bunch of bugs.
 
Figures. :p
 
Back
Top Bottom