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 - allender

Pages: [1] 2
I understand the context of this error.  An action was changed and the FSMs weren't resaved.  I do have a couple of questions about this though:

  • I literally have hundreds of scenes so finding the potential FSMs is tedious (even if I had the names - see next bullet). Is there anyway to just resave all of the FSMs.  Is there a script, or should I write one to maybe do this?  Finding FSMs that have those actions isn't trivial.
  • I noticed that the first part of the message contains things like FSM xxx: yyy: zzz:  action: action has changed....  Are the things  before the action names the names of the FSMs that need to be resaved?  That could make it easier for me to find what I need.
  • (edit)After looking at this more, I'm not even sure how to fix this problem.  I found the state that has the changed action (which was a namespace name change), but when clicking on the state, the 'state' window in the playmaker window doesn't show anything and I get a ton of errors in the log presumably because it can't draw the action correctly.  Any advice on how to fix this?

Thanks for any help/advice.

PlayMaker Help / Using Odin with PM Inspector variables
« on: July 05, 2019, 11:27:43 AM »
Does anyone know of a way to use Odin for inspector exposed FSM variables.  I have some templates with exposed variables on the FSM and I'd like to be able to use Odin based drawers for those values (think enums with 100s of values - really hard to use the default Unity drawer).  I was able to do this in the state window itself in the playmaker editor, but it would be nice to be able to expose the same drawer in the inspector.  Thanks.

PlayMaker Help / Re: FSMEnum problem
« on: July 05, 2019, 11:19:08 AM »
I have tried all kinds of things with casing.  There are either errors that prevent casting from type int (or uint) to Enum, as well as other similar issues.  I wound up just making the enum a normal int  backed enum.

I may try and come up with a small sample sometime and send it your way, if nothing else as an FYI.

PlayMaker Help / FSMEnum problem [SOLVED]
« on: July 04, 2019, 01:06:38 PM »
I have an enum defined as
Code: [Select]
public enum MyEnums: uint
    ID1 = 811410733U,
    ID2 = 339470096U

In writing a custom editor for this enum (wanting to use Odin's enum picker which is way more user friendly), I'm having trouble assigning the value back to the enum when the choice is made.  I get the MyEnum value back from the picker, and then compare to what I have.  If different I try to assign:

Code: [Select]
            else if (enumVar != currentEnum)
                action.MyEnum = enumVar;
                isChanged = true;

I've tried many different things for the action.MyEnum assignment.  I've tried .Value, .SafeAssign().  No matter what I try, _sometimes_ the code creates exception.  I think it's because the enum is backed as uint instead of int.  The exception is "value was either too large or too small for an Int32".  I've tried all kinds of casting,  but I can't seem to figure out how to make this work correctly.  Any help would be appreciated.

In FSM actions, FSM type variables have a picker on the right side to pick between FSM variable and a specific value.  If I create a custom editor for my action, if I use EditField, I can get the dropdown picker for variable vs. value).  But is there a way O can do this manually so that I can change the way the field is edited.

I have an enum, and using FSMEnum works, but the enum has 100s of values and it's impossible to scroll through all the values.  I need to do somethign else there so was going to customize it, but I'm not sure how to still allow user to pick  between variable and other values.

actually as a follow up - where are the prefs actually stored?

Ok - I found this preference.  You have to get to the prefs window from the playmaker window.  I was looking for prefs under the prefs menu in the Edit menu.

Really, those prefs ought to be exposed there.  It drives me batty that i have to search around for these things - they should all be in a single place - or at least accessible from the prefs menu (even if there is a different way to get there).

the playmaker GUI component gets added automatically in many situations (adding an FSM, editing an FSM, etc when the GUI component doesn't exist).  Is there a way to disable this behavior.

I have a setup that loads a bunch of "managers" on game load and I'd like one of those managers to have the playmaker gui component since it is required.  The problem is that we work in multiple scenes and many times peopel are working on scenes with an FSM but there is no GUI component because the GUI component lives elsewhere in a scene that is always loaded during gameplay.  I assume the gui component isn't needed at editor time and I'd like to be able to control where it lives.

Related, is there a way to change defaults on the GUI component (espeicailly the mouse control).  If I  have to live with these thing being automatically added, it would be nice not to have the mouse option always default to 'on".


PlayMaker Help / FSMVariable needs to be 'new'ed[SOLVED]
« on: July 02, 2019, 10:15:41 AM »
Playmaker 1.9.1p15 unity 18.3.6f

I have created a new action and have had to write a custom editor for the action due to wanting to put in a custom dropdown that is searchable.  I have used EditField() for a couple of the fields in the action, but have written custom code for one of the fields, which is an FSMInt.  I have declared

Code: [Select]
FSMInt  id;
then the custom editor code actually does a bunch of stuff to convert item in a list to the proper id, etc.  But the one thing that I've found is that id is null when the object is first created.  I had to do

Code: [Select]
public override void Reset()
   id = new FsmInt(0);

in order to not have uinhandled exceptions in the action Reset code so that id is not null in the custom editor.  Why is this?  It just seems strange that I don't have to do this for other variables that are edited with EditField so I suspect something is happening behind the scenes.

I'm fine with this solution, but just want to make sure that I'm not missing something subtle or buggy.

One thing that I've noticed about performance in editor is that the playmaker window itself can cause slowdowns.  I've seen super slow performance while play in editor with the playmaker window open.  As soon as I scrub the visible portion of the state machine using the rect view in the upper right corner of the PM window, performance seems to return to normal.

Is there a way to make all newly created FSM components have "reset on disable" default to "false" rather than true.  Due to the nature of our game, we are loading stuff in/out of memory all the time and our default action is to almost always have reset be false because we need to save the current state of those FSMs.

I looked around and searched a bit and didn't find anything obvious, but wanted to ask.  Would templates solve that problem?  Thanks.

thank you for the reply.  We are actually fully up to date, I just put the wrong version of PM down.  this problem turned out to be an issue in my component.  The playmaker component being involved was a red herring.  Thanks.

Hello - I have a situation that is a tad difficult to explain.  We are using Unity 18.3.6f, playmaker v1.9.0

We have a situation where we have a fairly deeply nest set of prefab variants:


each of these are prefabs with 'mydoor' being the placable prefab for a scene and master being the lowest level.  In our case, door_master (a variant of master), has an game object on it with a component that we wrote which is a component that requires a box collider and uses the unity trigger events.  There is an FSM on the variant.  The FSM has a state that uses the Trigger Event state action.  This action in turns adds the Playmaker Trigger Enter script to the game object to which the trigger event refers.  An ascii picture:

door_master   (this is the variant with the FSM that uses the trigger event)
   X                 (game object referenced on trigger event and has PM Trigger Enter script)

see attached screen shots

If the mydoor prefab is placed into a scene, and then the scene is changed, all of the prefab variants in this hierarchy are reimported.  Every time.  Our situation is such that we have about 15 prefabs that get reimported when you save.  I have seen situations like this before when components get added during serialization (or other bad things).

I'm mainly writing to find out what is going on in the Play Maker Trigger Enter script.  It's native so I don't know the contents or what it is doing.  I'm trying to figure out if, during serialization, it might be (inadvertantly) adding/removing components that it doesn't need do,  or deleting and readding itself or ... something

I hope that this make some sense.  Let me know if I can provide more information.


PlayMaker Bug Reporting / Re: Playmaker serialization issue
« on: May 29, 2019, 09:26:51 PM »
Great.  Thanks for the workaround as well.

PlayMaker Bug Reporting / Playmaker serialization issue
« on: May 28, 2019, 05:25:56 PM »
We have something like this:

Code: [Select]
        public enum HintStatus : byte

and in a custom playmaker action, we do something like this:

Code: [Select]
    public class HintAction : FsmStateAction
        public HintStatus hintStatus;


The fact that the enum is serialized into a byte causes all kind of issues with playmaker.  I'll include a snippet below.  Essentially you can add one of these actions to a state, save the thing (prefab or scene), go to a different playmaker SM, then back to the one you just saved with this byte enum.  Selecting the state onto which the action was added causes these issues.  I tried to boil this issue down to something simple given IP restrictions.  I can provide more info if needed.

Once this happens, the playermaker editor window doesn't seem to work for any state machines.  A restart of Unity is required.

Sample of errors:
Code: [Select]
InvalidCastException: Specified cast is not valid.
HutongGames.PlayMaker.ActionData.SaveActionField (HutongGames.PlayMaker.Fsm fsm, System.Type fieldType, System.Object obj) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:3081)
HutongGames.PlayMaker.ActionData.SaveAction (HutongGames.PlayMaker.Fsm fsm, HutongGames.PlayMaker.FsmStateAction action) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:2677)
HutongGames.PlayMaker.ActionData.SaveActions (HutongGames.PlayMaker.FsmState state, HutongGames.PlayMaker.FsmStateAction[] actions) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:2648)
HutongGames.PlayMaker.FsmState.SaveActions () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:130)
HutongGames.PlayMakerEditor.FsmEditor.SaveActions (HutongGames.PlayMaker.FsmState state, System.Boolean errorCheck) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmEditor.cs:1988)
HutongGames.PlayMakerEditor.FsmBuilder.AddAction (HutongGames.PlayMaker.FsmState state, System.Type actionType) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmBuilder.cs:1258)
HutongGames.PlayMakerEditor.EditorCommands.AddAction (HutongGames.PlayMaker.FsmState state, System.Type actionType) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/EditorCommands.cs:99)
HutongGames.PlayMakerEditor.StateInspector.AddActionBeforeSelectedAction (System.Type actionType) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/StateInspector.cs:2136)
HutongGames.PlayMakerEditor.StateInspector.AddAction (System.Type actionType) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/StateInspector.cs:2098)
HutongGames.PlayMakerEditor.ActionSelector.AddSelectedActionToState () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:998)
HutongGames.PlayMakerEditor.ActionSelector.DoActionButton (System.String category, System.Type actionType) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:545)
HutongGames.PlayMakerEditor.ActionSelector.DoFilteredActionList () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:358)
HutongGames.PlayMakerEditor.ActionSelector.DoActionList () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:322)
HutongGames.PlayMakerEditor.ActionSelector.DoGUI () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:180)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/BaseEditorWindow.cs:117)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/projects/unity_release/Editor/Mono/HostView.cs:342)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/projects/unity_release/Editor/Mono/HostView.cs:336)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/projects/unity_release/Editor/Mono/HostView.cs:310)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/projects/unity_release/Editor/Mono/GUI/DockArea.cs:361)
UnityEditor.DockArea.OldOnGUI () (at C:/projects/unity_release/Editor/Mono/GUI/DockArea.cs:320)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/projects/unity_release/Modules/UIElements/IMGUIContainer.cs:266)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/projects/unity_release/Modules/UIElements/IMGUIContainer.cs:438)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/projects/unity_release/Modules/UIElements/IMGUIContainer.cs:421)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/projects/unity_release/Modules/UIElements/IMGUIContainer.cs:401)
UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/projects/unity_release/Modules/UIElements/EventDispatcher.cs:754)
UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/projects/unity_release/Modules/UIElements/EventDispatcher.cs:599)
UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/projects/unity_release/Modules/UIElements/EventDispatcher.cs:307)
UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/projects/unity_release/Modules/UIElements/Panel.cs:176)
UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/projects/unity_release/Modules/UIElements/UIElementsUtility.cs:245)
UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/projects/unity_release/Modules/UIElements/UIElementsUtility.cs:68)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/projects/unity_release/Modules/IMGUI/GUIUtility.cs:179)

Pages: [1] 2