playMaker

Author Topic: help plz... error log : SerializedProperty ... has disappeared!  (Read 2867 times)

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
help plz... error log : SerializedProperty ... has disappeared!
« on: January 03, 2022, 10:28:24 AM »
Hi. I'm using PM1.9.0.
Several days ago, i got some unfamiliar error logs.

It's about variables of an FSM. the variables are showing in inspector(toggled inspector option.).
The FSM is in a prefab.

When i hit the play button of unity editor,
if the active gameObject is one of the problem prefab, and the playmaker editor is showing it,
the variables goes 'null' icon. And spem error logs.

i attatched screenshots.

if i click some other gameobject, then click problem prefab(in scene) again, the 'null' icon will be fixed and error logs stops.

i didn't experienced this last month. this is new one to me.

here's error log. what is this?

*error log1
Code: [Select]
SerializedProperty fsm.variables.intVariables.Array.data[5].value has disappeared!
UnityEditor.EditorGUILayout:PropertyField (UnityEditor.SerializedProperty,UnityEngine.GUIContent,bool,UnityEngine.GUILayoutOption[])
HutongGames.PlayMakerEditor.FsmVariableEditor:DoValueField (UnityEngine.GUIContent,bool) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmVariables/Editor/FsmVariableEditor.cs:59)
HutongGames.PlayMakerEditor.FsmVariable:DoValuePropertyField (UnityEngine.GUIContent,bool) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmVariable.cs:405)
HutongGames.PlayMakerEditor.FsmVariable:DoValuePropertyField () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmVariable.cs:415)
HutongGames.PlayMakerEditor.FsmVariable:DoVariableListGUI (System.Collections.Generic.List`1<HutongGames.PlayMakerEditor.FsmVariable>) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmVariable.cs:382)
HutongGames.PlayMakerEditor.FsmInspector:DoExposedControlsGUI () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmInspector.cs:414)
HutongGames.PlayMakerEditor.FsmInspector:OnGUI () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmInspector.cs:223)
HutongGames.PlayMakerEditor.FsmComponentInspector:OnInspectorGUI () (at Assets/PlayMaker/Editor/FsmComponentInspector.cs:39)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


*error log2
Code: [Select]
NullReferenceException: : SerializedProperty is null
UnityEditor.EditorGUI.BeginPropertyInternal (UnityEngine.Rect totalPosition, UnityEngine.GUIContent label, UnityEditor.SerializedProperty property) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.EditorGUI.DefaultPropertyField (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditorInternal.ReorderableListWrapper.Draw (UnityEngine.GUIContent label, UnityEngine.Rect r, UnityEngine.Rect visibleArea, System.Boolean includeChildren) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
HutongGames.PlayMakerEditor.FsmVariableEditor.DoValueField (UnityEngine.GUIContent label, System.Boolean isAsset) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmVariables/Editor/FsmVariableEditor.cs:59)
HutongGames.PlayMakerEditor.FsmVariable.DoValuePropertyField (UnityEngine.GUIContent label, System.Boolean isAsset) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmVariable.cs:405)
HutongGames.PlayMakerEditor.FsmVariable.DoValuePropertyField () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmVariable.cs:415)
HutongGames.PlayMakerEditor.FsmVariable.DoVariableListGUI (System.Collections.Generic.List`1[T] fsmVariables) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmVariable.cs:382)
HutongGames.PlayMakerEditor.FsmInspector.DoExposedControlsGUI () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmInspector.cs:414)
HutongGames.PlayMakerEditor.FsmInspector.OnGUI () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmInspector.cs:223)
HutongGames.PlayMakerEditor.FsmComponentInspector.OnInspectorGUI () (at Assets/PlayMaker/Editor/FsmComponentInspector.cs:39)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)




« Last Edit: January 04, 2022, 09:43:38 AM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #1 on: January 03, 2022, 11:16:21 AM »
Hi.
What actions are you using with the variable?

Which unity version are you using?

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #2 on: January 04, 2022, 02:15:41 AM »
my unity version is 2020.3.2f1
the variable is used by 4 different actions.

-intCompare(built in PM)
-text mesh pro ugui set text (via convert option)
-my custom. 2 inventory actions.

i'll paste my custom action code below.

i think... the problem is not related my code.
if i disable 'inspector' option of the variable, no problem happens.

this morning i tested again,
toggle insptector option on a fsmint var only : cause error.
toggle inspector option on my custom object var only : no error.

i tried import playmaker. 1.9.0.p7.
This version is on the playmaker welcome-screen.

the variable problem is not fixed. - (but i can give up this. if i don't toggle inspector option of them, no problem. so it's OK. )

And here's my custom actions code.

-inventory is affordable
Code: [Select]
namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory("CustomByJoe")]
    [Tooltip("inventory is affordable an item. get bool is affordable")]
public class ndt_invenIsAffordableItem : FsmStateAction
{
        [ObjectType(typeof(ndt_item))]
        public FsmObject theItem;
        public FsmInt itemAmount;

        [CheckForComponent(typeof(ndt_inventoryObj))]
        public FsmGameObject InvenGo;
       
        public FsmBool resultBool;

        public override void Reset()
{
            InvenGo = null;
            resultBool = null;
}

public override void OnEnter()
{
            if (theItem.Value != null)
            {
                resultBool.Value = InvenGo.Value.GetComponent<ndt_inventoryObj>().invenSo.isAffordable((ndt_item)theItem.Value, itemAmount.Value);
            }
            else
            {
                resultBool.Value = true;
            }
            Finish();
        }
}
}




-inventory purchase
Code: [Select]
namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory("CustomByJoe")]
    [Tooltip("purchase item from an inventory")]
public class ndt_invenDoPurchaseItem : FsmStateAction
{
        [ObjectType(typeof(ndt_item))]
        public FsmObject theItem;
        public FsmInt itemAmount;

        [CheckForComponent(typeof(ndt_inventoryObj))]
        public FsmGameObject InvenGo;
       
        public FsmBool resultBool;

        ndt_inventoryObj invenComp;

        public override void Reset()
{
            InvenGo = null;
            resultBool = null;
}

public override void OnEnter()
{
            if (theItem.Value != null)
            {
                invenComp = InvenGo.Value.GetComponent<ndt_inventoryObj>();
                if (invenComp.invenSo.isAffordable((ndt_item)theItem.Value, itemAmount.Value))
                {
                    resultBool.Value = true;
                    invenComp.invenSo.addItem((ndt_item)theItem.Value, itemAmount.Value * -1);
                }
                else
                {
                    resultBool.Value = false;
                }
            }
            else
            {
                resultBool.Value = true;
            }
            Finish();
        }
}
}
« Last Edit: January 04, 2022, 02:44:38 AM by braincase »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #3 on: January 04, 2022, 10:13:11 AM »
Hi,
Just for testing, try to separate the itemAmount.Value like this (on both custom actions) :

Code: [Select]
resultBool.Value = InvenGo.Value.GetComponent<ndt_inventoryObj>().invenSo.isAffordable((ndt_item)theItem.Value, itemAmount.Value);
to
Code: [Select]
int amount = itemAmount.Value;
 resultBool.Value = InvenGo.Value.GetComponent<ndt_inventoryObj>().invenSo.isAffordable((ndt_item)theItem.Value, amount);

also you might want to use a 'ComponentAction' instead of a 'FsmStateAction'

Have a look at 'Set Sprite' action as a example.

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #4 on: January 05, 2022, 04:06:01 AM »
hi~
thank you for your replying.

I separated the variable just like your suggestion.
But the error message is same.

And I edited my action from FsmStateAction to ComponentAction<ndt_inventoryBlahblah>

also same.

Anyway the actions are working just like before(FsmStateAction).
What's different between componentAction and FsmStateAction?
When and why should i select componentAction?

I've wrote many actions for myself but i never used ComponentAction(honestly i didn't know about it).

And is there more types of action? Is there instruction about it?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #5 on: January 05, 2022, 12:04:33 PM »
Hi.
From what i understand, the component action preloads (Caches) the component.
so if the target object is not changed and the action is reused it does not need to get the component anymore.

Quote
// Base class for actions that access a Component on a GameObject.
    // Caches the component for performance

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #6 on: January 05, 2022, 12:11:07 PM »
Hi.
Can you update to the latest PM version (1.9.4.f2)
There are some major changes tho.

Before you do.
Make a backup of your project, if you don't have already.

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
Re: help plz... error log : SerializedProperty ... has disappeared!
« Reply #7 on: January 06, 2022, 12:01:10 PM »
Hi. Thank you for your reply again.
I already tried to update playmaker some months ago.(like other people, i prefer 'latest version' of course.)

But I faced many problems. I know some update can cause errors.
but this time...it was different.
Some object didn't work the way it used to. without error.
That means i have to redesign it for new version PM.

I'm already using so many actions on so many objects on my current project.
It is very complicated.
I'm not sure that I can fix every problem with new version within couple of days.
So for now i decided to use 1.9.0.
I'm stuck in 1.9.0

umm...I'll try to update again later.
« Last Edit: January 06, 2022, 12:03:05 PM by braincase »