Difference between revisions of "Runtime Log Monitoring (h2)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "{| class="ts" style="width:100%" |- ! style="text-align:left" | Name !! style="text-align:left;width:10%" | By |- | Runtime Log Monitoring (auto-update) || AFRLme |} This ti...")
 
Line 19: Line 19:
 
[[File:rtlog_01.png|400px]]
 
[[File:rtlog_01.png|400px]]
  
2. Next you are going to need to download Snaketail from [[https://github.com/snakefoot/snaketail-net/releases/latest here]]. Snaketail is an open source app for windows that emulates the -tail command of Linux. In other words it will automatically update any txt / log files you open automatically on file change or after every x amount of time.
+
2a. Next you are going to need to download Snaketail from [[https://github.com/snakefoot/snaketail-net/releases/latest here]]. Snaketail is an open source app for windows that emulates the -tail command of Linux. In other words it will automatically update any txt / log files you open automatically on file change or after every x amount of time.
  
[[File:rtlog_01.png|400px]]
+
2b. Once you have downloaded & extracted or installed whichever version of Snaketail you need (x64, x86, portable), open it. Next we need to locate two files; one being the log file for the Visionaire Studio editor (viseditor.log) & the other being the log file associated with the project you are currently working on (messages.log). These two files will update you on various issues generated by the editor (development) or the player (runtime). Both files are located somewhere in c:/users/username/appdata/local/... Once done you will end up with 2 tabs.
  
3. And now we need a script, that plays our sounds depending on the underground. We add a new script (type '''Called by other action''' again) with the name '''footsteps'''. In this script we call the corresponding script to the current underground...
+
{| class="ts"
 +
|-
 +
| '' To find the localAppDir where your projects save game files & log messages are stored, you should run your game through the editor. Press TAB on your keyboard to open up the developer console & then type...''
 +
<syntaxhighlight>
 +
exec print( localAppDir )
 +
</syntaxhighlight>
 +
''... now press enter & type '''PRINT LOG''', then press enter again to show the log. Navigate through the log pages using PAGE UP & DOWN keys on your keyboard & look for a line containing something like c:/users/... & that will be where the localAppDir for your game is located.''
 +
|}
  
[[File:footsteps_4-v2.png|800px]]
+
[[File:rtlog_02.png|800px]]
  
4. Now we have to trigger the '''footsteps''' script every time our character touches the ground. We go to the walk animation, select one of the '''contact''' (this being the frame which should trigger a footstep sound) frames and call the action '''footsteps''' inside of the frame...
+
3. To display both files at the same time you should use either: the '''Tile windows horizontally''' or the '''Tile windows vertically''' options found under the '''Windows''' menu. Once done you should have something like this...
  
[[File:footsteps_5.png|800px]]
+
[[File:rtlog_03.png|800px]]
  
5. Repeat step 4 for each walk direction of the character. Repeat steps 1 to 4 for any characters you want to apply dynamic footstep sounds to.
+
4. Snaketail does not automatically remember the last session when you open it. The simplest method for getting it to remember the last session is to use '''Save session''', '''load session''' & '''recent files''' in the '''File''' menu.
 +
 
 +
& that about covers it. If you want you can enable the always on top option in the file menu or adjust the refresh / changes interval values under Edit > View options > log file.
  
  

Revision as of 16:37, 21 July 2015

Name By
Runtime Log Monitoring (auto-update) AFRLme


This tip shows you how to setup real-time automatic log updates, so that you don't have to keep typing PRINT LOG into the developers console or opening & closing the messages.log file each time you want to check for new log messages, errors & warnings, which is extremely useful for developers working on scripting a new feature or debugging their games. This tutorial is for Windows. I'm sure there are some mac alternatives for Snaketail available. Essentially it's just an app that mirrors the -tail command for Linux machines.

I tried a few other apps including the silent update function of Notepad++, but none of the other programs wanted to run silently in the background. They needed the application window to be active (selected) in order to update the data retrieved from any linked log files, which wasn't much different to opening & closing the log files manually or using the print log command in the developer console.

Tutorial

1. First things first, you should make sure the log level for Visionaire Studio is set to info. To do this go to extras > options > player: set log level to info. The info setting will print out errors, warnings & messages generated by the print() command.

Rtlog 01.png

2a. Next you are going to need to download Snaketail from [here]. Snaketail is an open source app for windows that emulates the -tail command of Linux. In other words it will automatically update any txt / log files you open automatically on file change or after every x amount of time.

2b. Once you have downloaded & extracted or installed whichever version of Snaketail you need (x64, x86, portable), open it. Next we need to locate two files; one being the log file for the Visionaire Studio editor (viseditor.log) & the other being the log file associated with the project you are currently working on (messages.log). These two files will update you on various issues generated by the editor (development) or the player (runtime). Both files are located somewhere in c:/users/username/appdata/local/... Once done you will end up with 2 tabs.

To find the localAppDir where your projects save game files & log messages are stored, you should run your game through the editor. Press TAB on your keyboard to open up the developer console & then type...
exec print( localAppDir )

... now press enter & type PRINT LOG, then press enter again to show the log. Navigate through the log pages using PAGE UP & DOWN keys on your keyboard & look for a line containing something like c:/users/... & that will be where the localAppDir for your game is located.

Rtlog 02.png

3. To display both files at the same time you should use either: the Tile windows horizontally or the Tile windows vertically options found under the Windows menu. Once done you should have something like this...

Rtlog 03.png

4. Snaketail does not automatically remember the last session when you open it. The simplest method for getting it to remember the last session is to use Save session, load session & recent files in the File menu.

& that about covers it. If you want you can enable the always on top option in the file menu or adjust the refresh / changes interval values under Edit > View options > log file.


Resources

Name Description
n/a ...