playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stack_overflower

Pages: [1]
1
Hello PlayMaker devs!

I randomly get the following unity exception while working on some fsms:

Code: [Select]
get_isPlaying is not allowed to be called during serialization, call it from Awake or Start instead.
The code that throws that error is in "UpdateHelper.cs".

Code: [Select]
// Small helper class to allow Fsm to call SetDirty
// Fsm is inside dll so cannot use #if UNITY_EDITOR

#if (UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7)
#define UNITY_PRE_5_0
#endif

#if (UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2)
#define UNITY_PRE_5_3
#endif

#if UNITY_EDITOR
using UnityEditor;
#endif

using UnityEngine;

namespace HutongGames.PlayMaker
{
    /// <summary>
    /// Playmaker runtime code can't call unity editor code
    /// This class is a workaround, allowing runtime code to call EditorUtility.SetDirty
    /// </summary>
    public class UpdateHelper
    {
        private static bool editorPrefLoaded;

#if UNITY_EDITOR

        // loading editorprefs can be slow (?) so cache setting
        private static bool _doLog;
        private static bool doLog
        {
            get
            {

                if (!editorPrefLoaded)
                {
                    // set by FsmEditorSettings
                    _doLog = EditorPrefs.GetBool("PlayMaker.LogFsmUpdatedMessages", false);
                    editorPrefLoaded = true;
                }
                return _doLog;
            }
        }
#endif

        /// <summary>
        /// Helper that can be called by reflection from runtime class without referencing UnityEditor
        /// E.g. When Fsm is loaded it can need fixing and then needs to be marked dirty
        /// </summary>
        public static void SetDirty(Fsm fsm)
        {
#if UNITY_EDITOR

            // Unity 5.3.2 disallows scene dirty calls when playing
            if (Application.isPlaying) return;

            if (fsm == null || fsm.OwnerObject == null) return;

            if (doLog)
            {
                Debug.Log("FSM Updated: " + FsmUtility.GetFullFsmLabel(fsm) + "\nPlease re-save the scene/project.", fsm.OwnerObject);
            }

            fsm.Preprocessed = false; // force pre-process to run again

            if (fsm.UsedInTemplate != null)
            {
                EditorUtility.SetDirty(fsm.UsedInTemplate);
            }
            else if (fsm.Owner != null)
            {
                EditorUtility.SetDirty(fsm.Owner);
#if !UNITY_PRE_5_3
                if (fsm.Owner.gameObject != null)
                {
                    UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(fsm.Owner.gameObject.scene);
                }
#elif !UNITY_PRE_5_0
                // Not sure if we need to do this...?
                UnityEditor.EditorApplication.MarkSceneDirty();
#endif
            }
#endif
        }
    }
}

More specifically at the following line
Code: [Select]
if (Application.isPlaying) return;

The big issue is that from that moment on the scene I was working on somehow breaks and unity takes more than 2 minutes to enter or exit playmode, like it got dirty because of something related to serialization.

Luckily it happened only on test scenes until now, but I don't want to risk with the real game scenes, since ours is an upcoming game and I cannot waste any time because of this.

Could you please provide a hotfix for this?

We are using PlayMaker version 1.9.0

Thank you for your support, have a nice day.

2
Hi.
For updating from 1.8.9 to 1.9, there should not be issues.

BUT always make a backup of your project before updating!

if you click on the missing action warnings, they should redirect you to the state with the missing action.

It should now have a 'missing action' action and it should have a name of the missing action.

What are the names stated there ?

Hello! We always use versioning so there is no problem for backups!

For what concernes the actions: it only happens in the build, not in the editor - as I said.
So if I play the game from the editor everything is fine, but from the build I get those errors (from the screenshot). I double checked and all those actions exist in the project and work well. That is the strangest thing ever. I could try to delete them, re-create them and re-use them in the states they were before.

3
Did you recently add any new scripts to the project?

I would also try updating to the latest version of PlayMaker (1.9.0.p15).

Yes I constantly add playmaker actions to the project. It's a beat 'em up game and we rely on PlayMaker to create combos for the characters.

I could try to upgrade, do you have any advice for the process? (is there anything that I can manually do before the update to avoid errors after it?)

4
What versions of Unity, Playmaker and which build target?
I am using PlayMaker 1.8.9.f1, Unity 2017.2.5f1 and build target is Windows.

5
Hello there! Hope you all are doing well.
Here is my problem: recently, just after a build was completed, I started getting some errors telling me that some actions were "missing" from some states. Of course the actions were there, because in the editor everything was completely fine. Unfortunately I cannot share my project because of the contract we have. Can you guys help me?

Thanks a lot.

Pages: [1]