Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Magicpotato on April 11, 2016, 09:31:51 PM

Title: FsmStateAction.Log error with Coroutine[SOLVED]
Post by: Magicpotato 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>
Title: Re: FsmStateAction.Log error with Coroutine
Post by: jeanfabre on April 20, 2016, 02:43:13 AM
Hi,

 I think this is currently being discussed with Alex right?

 Bye,

 jean
Title: Re: FsmStateAction.Log error with Coroutine
Post by: Magicpotato on April 20, 2016, 02:58:23 AM
Yes, Alex is cool.
We discussed to add Action.StartCoroutine() on 1.8.1