playMaker

Author Topic: FsmStateAction.Log error with Coroutine[SOLVED]  (Read 2346 times)

Magicpotato

  • Playmaker Newbie
  • *
  • Posts: 2
FsmStateAction.Log error with Coroutine[SOLVED]
« on: April 11, 2016, 09:31:51 PM »
Hello, I'm trying to use CustomAction with Coroutine while the life of the action.
There's an error on call Action.Log from Coroutine.

I made simple code.
Check and Fix please.

Code: [Select]
public class PlayMakerCoroutineTest : MonoBehaviour {
    IEnumerator Start ()
    {
        PlayMakerFSM playMakerFSM = GetComponent<PlayMakerFSM>();
        if (playMakerFSM == null)
            yield break;

        while(true)
        {
            yield return new WaitForEndOfFrame();

            if (playMakerFSM.Active == false)
                continue;
            if (playMakerFSM.Fsm == null)
                continue;
            if (playMakerFSM.Fsm.Active == false)
                continue;
            if (playMakerFSM.Fsm.ActiveState == null)
                continue;
            if (playMakerFSM.Fsm.ActiveState.Active == false)
                continue;
            if (playMakerFSM.Fsm.ActiveState.ActiveAction == null)
                continue;
            if (playMakerFSM.Fsm.ActiveState.ActiveAction.Active == false)
                continue;

            playMakerFSM.Fsm.ActiveState.ActiveAction.Log("DummyLog");

            /*
                LogAction: FsmExecutionStack.xecutingAction == null
                UnityEngine.Debug:LogError(Object)

                HutongGames.PlayMaker.FsmLog:LogAction(FsmLogType, String, Boolean)(at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmLog.cs:294)
                HutongGames.PlayMaker.FsmStateAction:Log(String)(at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmStateAction.cs:156)
                <Start>c__Iterator0:MoveNext() (at Assets/PlayMakerCoroutineTest.cs:38)
            */
        }
    }
}

Unity Info:
Unity Version: 5.3.4f1
Playmaker Version: 1.8.0.f43
BuildTarget: Android

<I deleted original link for privacy>
« Last Edit: May 23, 2016, 03:30:27 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FsmStateAction.Log error with Coroutine
« Reply #1 on: April 20, 2016, 02:43:13 AM »
Hi,

 I think this is currently being discussed with Alex right?

 Bye,

 jean

Magicpotato

  • Playmaker Newbie
  • *
  • Posts: 2
Re: FsmStateAction.Log error with Coroutine
« Reply #2 on: April 20, 2016, 02:58:23 AM »
Yes, Alex is cool.
We discussed to add Action.StartCoroutine() on 1.8.1