playMaker

Author Topic: Writing debug output to txt file  (Read 510 times)

brainchildbc

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Writing debug output to txt file
« on: September 16, 2016, 11:17:36 AM »
Hi,

I am using a visual scripting language (playmaker) to continuously track distance between two objects and save those values in a float variable. Now I want to debug that float variable and output the debug log to a txt file. Could someone help me in doing so?

(please keep in mind I am a n00b and have no prior coding experience :) )

Code: [Select]

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Debug)]
[Tooltip("Logs the value of a Float Variable in the PlayMaker Log Window.")]
public class DebugFloat : BaseLogAction
{
        [Tooltip("Info, Warning, or Error.")]
        public LogLevel logLevel;

        [UIHint(UIHint.Variable)]
        [Tooltip("The Float variable to debug.")]
public FsmFloat floatVariable;

public override void Reset()
{
logLevel = LogLevel.Info;
floatVariable = null;
            base.Reset();
}

public override void OnEnter()
{
string text = "None";

if (!floatVariable.IsNone)
{
text = floatVariable.Name + ": " + floatVariable.Value;
}

ActionHelpers.DebugLog(Fsm, logLevel, text, sendToUnityLog);

Finish();
}
}
}


If possible can someone tell me where I need to insert what code exactly for this to work?


Many thanks!!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4370
    • View Profile
    • jinxtergames
Re: Writing debug output to txt file
« Reply #1 on: September 18, 2016, 04:51:46 AM »
Hi,
Maybe this can help you.

You can use the "Debug Float" Action and "Check" Send to unity log.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions