antony.wells Posted April 23, 2020 Share Posted April 23, 2020 Hi, I'm trying to figure out how to write messages to both or either of the in game and IDE consoles, in C# components. I've done this, Unigine.Console.Run("show_messages 1"); Unigine.Log.Message("Begun title sequence./n"); And show_messages shows up in both consoles, however the following Log.Message, does not? Link to comment
mark.pizzolatto Posted April 24, 2020 Share Posted April 24, 2020 Not sure for the C# side, but the C++ side a command prompt opens when the game runs; Unigine.Log displays in that command prompt for me. Link to comment
morbid Posted April 24, 2020 Share Posted April 24, 2020 This code should print messages: In game console In the IDE console (I used VS Code) On the screen It will print nothing in the Editor console since Editor can't run C# logic. Here's the component: using System; using System.Collections; using System.Collections.Generic; using Unigine; [Component(PropertyGuid = "69615053347c1996d89403fd993ef5380ccdb737")] public class log : Component { private void Init() { // write here code to be called on component initialization Unigine.Console.Run("show_messages 1"); } private void Update() { // write here code to be called before updating each render frame Unigine.Log.Message("Begun title sequence.\n"); } } Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
antony.wells Posted April 24, 2020 Author Share Posted April 24, 2020 Ah thank you I get what I did wrong I think. I was trying to send the message within the Init() function. I guess before the console was ready. Cheers. 1 Link to comment
Recommended Posts