How do I write a logfile

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey guys

    I want to create a logfile (.txt or something) to have a look what's going on and for debug purposes. How can I do that in the simplest way if anyhow.

    Thanks

  • Hi elbando,

    if you dont need to download it (if its ok for you to get the log-output into a textbox (multiline) where you can copy&pasta it somewhere else):

    1 multiline TextBox is needed for that. Call your "Debug"- function and give it a parameter (Param(0) in my exmaple); for example:

    "RandomValue: " & aRandomValue[/code:1ww4xs0t]
    
    Thats the way Im logging stuff in my projects.
    
    Have a great weekend,
    Proxy
  • Proxymity Thank you for your answer! I'll do it that way now, works fine. But out of curiosity: Would it be possible to write that into a .txt file?

  • Proxymity Thank you for your answer! I'll do it that way now, works fine. But out of curiosity: Would it be possible to write that into a .txt file?

    Glad I could help <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";-)" title="Wink">

    Hmm.. lets say: there has to be a way to download a *.txt file. Personally I didnt needed that before, so I cant tell you exactly how to <img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question">

    But what I sure can say is, that you could modify the "WriteLog" function to additi-break- while writing this I took a look at the browser manual, maybe the "Invoke download of string" or "Invoke download" will fit your needs (https://www.scirra.com/manual/110/browser).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Proximity Thank you again, that link helped a lot. I don't need necessarily a .txt file. Now I'm using the log function from the Browser plugin. That's even better for debugging purposes in my case.

    Have a nice week.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)