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.

Topics - allender

Pages: [1]
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 / 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.

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.

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.

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 / 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)

We have updated to playmaker 1.9.0p15.  Unity 18.3.6f.  The playmaker EditorSettings assets is now checked out (via perforce) by every person on our team (around 15) and it looks like this will always be a problem given the current code.

the issue is here:
Code: [Select]
        // Get a unique signature for this project to avoid repeatedly auto updating the same project
        // NOTE: might be a better way to do this. Currently doesn't catch project changes like imports...
        private static string GetProjectSignature()
            return Application.unityVersion + "__" + Application.dataPath + "__" + GetInformationalVersion(Assembly.GetExecutingAssembly()); ;

Application.dataPath might be different for any one of our developers.  This issue is really an annoyance, but given the size of our project, I'm trying to keep files that are checked out by people to only files that need to be checked out, because it confuses people.  For now, I am going to hack the PlayMaker code to spit out the same project signature and make sure that doesn't have any side effects.  But as per the comments on the function, if you all can find a different way to do what you are trying to do, that would be helpful for teams > 1 person.  Thanks.

[edit] - Even after hacking out the dataPath issue, the editor settings still get checked out every time because of this line in PlaymakerEditorStartup.cs

Code: [Select]
            // record the welcome screen version
            EditorStartupPrefs.WelcomeScreenVersion = PlayMakerWelcomeWindow.Version

even though the versions are the same, the editor file is saved every time this is run, which is every editor startup

Im on Unity 18.3.6 and PlayMaker 1.9.0p4 (which could be the problem)

This topic has been posted about before, but I wanted to potentially bring some new information to the table.  I had a simple scene, one FSM and about 45ms going to the OnGUI portion of the FSM editor window update.  It turns out that the slowdown only really appears to be a problem when then 'state' tab is selected.  If I have "FSM" or "Events" or "Variables" selected, then speed is not an issue.

I have a simple state machine (about 10 states maybe).  When I moved the selection area in the mini FSM display, the framerate shot up to something completely reasonable.  I even moved the selection back to where it was and the framerate stayed high.  Here is a profile capture showing first the profile with the game just started and the slow framerate followed by a profile of when I moved the selection rect in the mini view.  The third attachment shows the window I am talking about.

Before I moved the selection rect (i.e. it was a the position PlayMaker moved it when the FSM was activated).  Attachments show the before and after of moving the selecction rect in the state machine window.  I don't know specifically what is happening, but seems like just moving the rect solves the problem. 

There are ways around this, but wanted to bring to your attention because for people that don't know, this can be a real killer of game framerate in editor.

Pages: [1]