PlayMaker - Visual Scripting for Unity

Discussion in 'Assets and Asset Store' started by Alex Chouls, Dec 31, 2010.

  1. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    Some new suggestion:
    - playmaker startup slow. need more quick.
    - when graph has many node, editor slow?
    - each action can has an [Enable] FsmBool variable for dynamic control action enable/disable.
    - (debug) support manual transition and raise event on runtime. (Shift+mouse left click next state node for transition to new state. Event editor can add [Raise Event] button to each event. )
    - how to edit deatived action properties on runtime like inspeator?
    - state action editor can support foldout like Component.
  2. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    Hmmm... look like use name also have some advantages.

    i'm currently use AnimationClip as data, when Animation Component hasn't this AnimationClip will auto add this clip to Animation.
    i'm working for an ACT game, character require many animation for combo tree. use AnimationClip as data i don't need add many predefine AnimationClip to Animation Component, i can dynamic add AnimationClip by currently combo for weapon's combo table. It is easy to test and adjust parameters.(just Drag AnimationClip->Play Button).
  3. Andrea Monzini

    Andrea Monzini

    Member

    Joined:
    Oct 9, 2008
    Messages:
    447
    Fantastic, i'm testing the beta and it's really promising!

    When do you plan the final release?
  4. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @mah, RoyS - I agree. At the same time, I'm sympathetic to struggling startups and there is a lot of work involved in testing and supporting software, so there's some room for negotiation there... as long as both parties benefit...

    @TheLlama - "...makes setting up puzzles and trigger based events fast and easy!" Great! Can I quote you on that? :)

    @jiong

    Slow startup - I assume you mean when running the game? This is my main concern now, and I'm looking into optimizations...

    Editor slowdown - do you have the Play Maker FSM inspector open? If so, try collapsing the inspector foldout. Even though the inspector is showing minimal data I think it might get confused by the recursive nature of the fsm (fsm has list of states, each state has reference to fsm...). I have an email out to Unity... If this isn't the problem, how many states before you see a slowdown? Is runtime performance effected?

    Action enable variable - Ooh, I like that! Very clever! I'll add that option...

    Raise event - You can Alt-click on transitions and states to raise events at runtime. I plan a control panel interface down the line - it would have fsm event buttons and variable sliders in one tidy window. Then you could share Playmaker enabled objects without worrying about all the internal details...

    Deactivated (finished) actions should still be editable - they are just greyed out visually. I'll double check that now...

    Foldout would be nice. I'll look into that.

    Automatically adding animations would be nice. I think I'll make these 2 actions:
    - PlayAnimationClip
    - AddAnimationClip (and specify name)

    @Andrea Monzini - Soon! Well it really depends on how many bugs the beta finds...
  5. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    1 Slow startup is running game. (When press play game button)
    2 state graph edit time have a little lag when have many state node. (like drag StateNode in graph view.) Play Maker FSM inspector closed, and maximum state graph.

    these are some new problem:

    - can disable playmaker logo display at current version?

    - how to use currently version playMaker impl press 1+2+3 button at the time send event [A] and press 1 button send event? i’ve use BoolTest action and enable [Every Frame] in a [Input Checking State] (next state for SendFsmEvent to other GameObject with playMakerFSM and return Input Checking State), look like prompt “may be infinite loop” warning.
    I had resolved this problem by the nest state condition in the past.

    - you need add more demo when final release. ( like a full playMaker driven demo game? )

    - look like OnExit function called by order has some problem? i don’t know is this a bug;
    when i have order call 3 Action with Fsm.Event(). FsmAction first call OnExit for all state actions, next call other action’s OnUpdate(After fire Fsm.Event() Action ); last transition to next State.
  6. pauloaguiar

    pauloaguiar

    Member

    Joined:
    May 13, 2009
    Messages:
    504
  7. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    There's no way to turn off the logo in the beta... sorry!

    There are a few ways to handle the 1+2+3 keys test you mentioned.

    But first there's a missing action! You need GetKey (will be in next beta):

    Code (csharp):
    1. using UnityEngine;
    2.  
    3. namespace HutongGames.PlayMaker.Actions
    4. {
    5.     [ActionCategory(ActionCategory.Input)]
    6.     [Tooltip("Gets the pressed state of a key.")]
    7.     public class GetKey : FsmStateAction
    8.     {
    9.         [RequiredField]
    10.         public KeyCode key;
    11.         [UIHint(UIHint.Variable)]
    12.         public FsmBool store;
    13.         public bool everyFrame;
    14.  
    15.         public override void Reset()
    16.         {
    17.             key = KeyCode.None;
    18.             store = null;
    19.             everyFrame = false;
    20.         }
    21.  
    22.         public override void OnEnter()
    23.         {
    24.             DoGetKey();
    25.  
    26.             if (!everyFrame)
    27.                 Finish();
    28.         }
    29.  
    30.         public override void OnUpdate()
    31.         {
    32.             DoGetKey();
    33.         }
    34.  
    35.         void DoGetKey()
    36.         {
    37.             if (store != null)
    38.                 store.Value = Input.GetKey(key);
    39.         }
    40.     }
    If you want to do the tests in a single state (I used A+S+D):

    $singleState.png

    Or you could split the actions up into multiple states (more or less the same actions, just split over multiple states):

    $multipleStates.png

    In the multiple states example, a series of states are evaluated every frame. To avoid the infinite loop warning you need the NextFrameEvent action (will be in next beta):

    Code (csharp):
    1. namespace HutongGames.PlayMaker.Actions
    2. {
    3.     [ActionCategory(ActionCategory.StateMachine)]
    4.     [Tooltip("Sends an event in the next frame. Useful if you want to loop states every frame.")]
    5.     public class NextFrameEvent : FsmStateAction
    6.     {
    7.         [RequiredField]
    8.         public FsmEvent sendEvent;
    9.  
    10.         public override void Reset()
    11.         {
    12.             sendEvent = null;
    13.         }
    14.  
    15.         public override void OnUpdate()
    16.         {
    17.             Fsm.Event(sendEvent);
    18.             Finish();
    19.         }
    20.     }
    21. }
    Use this in the Wait Frame state.

    Both of these solutions use quite a few low level actions. A couple of higher level actions would simplify things.

    Examples:
    KeysDown Action - takes multiple keys and sends an event when they're all pressed.
    AllTrueTest Action - takes multiple FsmBool variables and sends an event when they're all true.

    My goal is to add broadly useful higher level actions like these to speed up development.

    For example: GetRelativeSpeed Action - takes 2 game objects and calculates the relative speed. You can now branch state based on that speed.

    Or even higher level: IsApproaching Action - takes 2 game objects and sends an event if game object 2 is approaching game object 1.

    Higher level actions should help keep things simple, while low level actions let you come up with your own solutions. However, compound math operations are generally a problem in visual scripting languages - it used to bug me no end in virtools to use 10 building blocks to perform a one line math operation (this was many years ago, maybe they came up with a solution). I don't have a great solution yet - I'm playing with a custom Maths Action that lets you build more complex operations without having to use so many low level actions...

    The OnExit flow you describe sounds like a bug - I'll look into it...

    BTW, thanks for all the great feedback! If you really need a beta without the logo, I can send you a build...
  8. vegeta

    vegeta

    New Member

    Joined:
    Jan 12, 2011
    Messages:
    6
    nice tool.
    can you send me a copy without logo too?
    its little big difficult with the big logo if you have the layout 2 by 3.
    btw is there a site with some tutorials wit how to create a.i behavior or gui elements?
  9. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    Oh!Thank you for such a detailed explanation.
    these code open my think.
    hmm, i will create more custom action for my scene. currently i have create some higher level action for my ACT solution. but state template with predefine actions also a good idea. I can create
    a template of specify genre(like ACT AttackMove state template) provide to designer.

    - logo gui rendering is slowdown runtime performance. see unity profiler. (UnityGUI is very slow.) you can add playMaker logo to Component Inspeator or state graph. it’s part of Editor feature. XD
    If it is convenient, my email is <jiong@studio-symphonie.org>. can you send build to this?

    - it’s idea : D, PlayAnimation, Animation Setting etc can use FsmAnimationClip like FsmGameObject as parameter, it can change between AnimationClip and animation name as data.

    - OnExit problem look like it's my logic error, no problem.

    - startup and shutdown game beyond 10s when more than 10 state in a fsm. i had try create a null gameobject and add playMakerFSM component , next add 20 state without any action, startup is slow, and state graph editor also slowdown. i think it’s a big bug. = =+ Is it editor logic cause this problem?
    FSM data is so big, i’ve drag character gameobject with fsm to prefab, its size is 8.8m!
    a gameobject just attach on fsm with 15 null state, its size is 8.3m!
    when i delete all state in fsm, re drag fsm to prefab. its size still is 8.3m.
    i create a new null prefab and drag to it, its size down to 4k.
    create a new null object and drag 8.3m prefab, then its size still 8.3m (i think it’s unity bug).

    this is infomation show startup. look like have some memory leak?
    "Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    Texture2D has been leaked 48 times.”
    Last edited: Jan 14, 2011
  10. tatoforever

    tatoforever

    Member

    Joined:
    Apr 16, 2009
    Messages:
    2,320
    I never was a fan of visual programming stuff but a visual state editor is a must for designers.
  11. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    look like beta2 fixed Startup times bug.
    -------- new note---
    - how to support send event with custom datatype? eg: i want send a hitinfo data to damageable target. damageable target has a GetHit state handle this hitinfo. (store data in Damager component and call SendMessage function of Damager?)
  12. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Beta2 is available: download

    See the release notes: here

    Highlights:
    - Much improved editor performance and startup times with large graphs.
    - Now runs in web player properly.
    - More GUI actions.
    - More Physics actions.
    - Copy/Paste and Template bugs fixed.
    - Other bug fixes...

    Note, there is one situation where startup times are still bad. See release notes. Will be fixed in next beta (soon).

    One word of caution to beta testers. A new beta might break saved projects. For example, actions that have changed since they were added to a state will be reset to default parameter values when the fsm is next loaded. I'll try to keep the data when possible, and warn when not - but be aware that you might need to fix up your test projects with a new beta.

    Again, thanks everyone for the great feedback!
  13. Toad

    Toad

    Member

    Joined:
    Aug 14, 2010
    Messages:
    261
    This looks amazing!
  14. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @pauloguiar - thanks!

    @vegeta - I'm working on tutorials and more sample scenes. Want to get the feature set finalized and bug free before making larger samples - I've thrown away many, many test scenes during development!

    I'll change the logo to be proportional to screen size so it takes up less room on smaller screens. The logo is really the only restriction in the beta - without it I'd basically be giving Playmaker away for free!

    @Jiong -

    Let me know how Templates work for you. I plan to have some general purpose templates in the final release, but I think the feature will probably prove most valuable for project specific setups...

    I like the idea of an FsmAnimationClip that lets you pick the name or clip. I'll think about that.

    As far as I can tell the Texture2D leaks aren't real. I have an open UnityAnswers question here

    I'm playing with an idea for storing and sending Collision info in FSMs, since it's such a fundamental building block. E.g., Adding standard collision events (as system events) and storing collision info that can be queried by actions... and sent between FSMs. For now though, have you looked at the CollisionEvent and TriggerEvent actions? You could use those to trigger a SendMessage action...

    @tatoforever - I've definitely found visual state editors to be the sweet spot for artists and designers. I've seen animators work wonders in Havok Behavior, and artists that could mockup really cool interactive content using our in-house visual state machine editor, and there's Kismet obviously. If the visual scripting is too low level you kind of have to know how to program anyway... although I have met a lot of people who learned how to program with virtools. As usual there are shades of grey...

    @MattSimpson - Thanks! Let me know how you get along...
  15. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    Look like i can't show saved template asset in templates window. did i do a wrong operation? (i had save select state to asset folder, but templates window still gray.) currently i've just copy/paste states.

    I had use TriggerEvent already, but SendMessage Action can't attach custom data. i had to store custom data in Damager Component, i want send a message or event with many custom data to target fsm. Target get this TakeDamage event change to GetHit State; In current case, i send a HitInfo with many data to target, HitInfo has many data tell target how response by this DamageHit. eg: Knockd Back, Launch, Down etc.

    how to support send custom data in playMaker?
    Last edited: Jan 16, 2011
  16. tatoforever

    tatoforever

    Member

    Joined:
    Apr 16, 2009
    Messages:
    2,320
    I'm just waiting for PlayMaker support of custom action categories.
    Already supported, planned for the final release?
    Cheers,
  17. pinkhair

    pinkhair

    Member

    Joined:
    Dec 17, 2010
    Messages:
    119
    This looks excellent- I'll be giving it a try.
  18. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @Jiong - Save the template in Playmaker/Templates. That should be the default location of the save file dialog... Then select a template in the Template Browser to paste into the FSM. I'll probably rework this so you can access saved templates directly from the right click menu.

    @tatoforever - You can do it now. Use a string instead of the ActionCategory enum. I've started the API reference docs. Here's the page on Action Attributes.

    @Pinkhair - Great! Look forward to your feedback...
  19. IonDave

    IonDave

    New Member

    Joined:
    Sep 27, 2010
    Messages:
    58
    I'm an artist with some programming and scripting (MaxScript/Unity) experience. I cannot even begin to understand how this works though! I look forward to seeing some video training on this product because I want to learn PlayMaker!
  20. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Video tutorials coming soon...
  21. KITT

    KITT

    New Member

    Joined:
    Jul 17, 2009
    Messages:
    221
    Looking forward to it.
    Beta 2 notes: I cant seem to find the "Level Menu" example scene in the "TestLab" folder (Beta 2). Is it included in the release or is it just included in the documentation for now?
  22. vegeta

    vegeta

    New Member

    Joined:
    Jan 12, 2011
    Messages:
    6
    kinda strange.
    i open up unity and playmaker doesnt work any further?
    if i open up the action browser,unity shows me this message:

    ReflectionTypeLoadException: The classes in the module cannot be loaded.
    System.Reflection.Assembly.GetExportedTypes ()
    HutongGames.PlayMakerEditor.FsmEditorUtility.BuildActionsList ()
    HutongGames.PlayMakerEditor.FsmEditorUtility.get_Actionslist ()
    HutongGames.PlayMakerEditor.ActionSelector.CategorizeActions ()
    HutongGames.PlayMakerEditor.ActionSelector.OnProjectChange ()
    HutongGames.PlayMakerEditor.ActionSelector.OnEnable ()
    UnityEditor.EditorWindow:GetWindow()
    FsmEditorWindow:OnGUI() (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:100)
    UnityEditor.EditorWindow:SendEvent(Event)
    HutongGames.PlayMakerEditor.FsmEditor:OpenActionWindow()
    UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)


    i reimported it 3 times but nothing changed.
  23. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
  24. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @KITT - Yeah the "Level Menu" sample isn't in the zip yet...
  25. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    some note

    - ToolTipAttribute look like can’t accurately work for action properties?
    i had create action with many comment for FsmVariable, but when move mouse to action properties in state window, comment can’t accurately display. (look like just display last tooltip)
    the code like this:
    Code (csharp):
    1.  
    2.     // Get Damage Info from DamgeRecevier Component.
    3.     [ActionCategory("Genre/ACT")]
    4.     [Tooltip("Activated when  a certain amount of damage is taken. Allow the designer to define how much and whilch type of damage shound be required.(or ignored).")]
    5.     public class TakeDamageEvent : FsmStateAction
    6.     {
    7.         [Tooltip("The actor that was damaged")]
    8.         [RequiredField]
    9.         [CheckForComponent(typeof(Damageable))]
    10.         public FsmOwnerDefault Originator;
    11.         [Tooltip("The actor that did the damaging")]
    12.         public FsmGameObject storeInstigator;
    13.  
    14.         public FsmBool m_Enabled;
    15.         [Tooltip("Damage must exceed this value to be counted")]
    16.         public FsmFloat MinDamage;
    17.         [Tooltip("Total amount of damage to take before activating the event")]
    18.         public FsmFloat DamageThreshold;
    19.  
    20.         [Tooltip("Should the damage counter reset if this event is toggled")]
    21.         public FsmBool m_ResetDamageOnToggle;
    22.  
    23.         [Tooltip("Store all damage taken gone beyond Damge Threshold")]
    24.         [UIHint(UIHint.Variable)]
    25.         public FsmFloat m_DamageTaken;
    26. }
    27.  
    - when create long name FsmVariable, i can’t see full property name in action panel.

    - state tab bug:
    runtime change select fsm gameobject->exit play to editor time, then can’t find other fsm in fsm list or state graph viewer.

    - Trigger event action don’t handle TriggerExit event filter.
    Code (csharp):
    1.  
    2.  
    3.           public override void DoTriggerExit(Collider other)
    4.           {
    5.                if (other.gameObject.tag == collideTag)
    6.                {
    7.                     StoreCollisionInfo(other);
    8.                     Fsm.Event(sendEvent);
    9.                }
    10.           }
    11.  
    need modify to:
    Code (csharp):
    1.  
    2.           public override void DoTriggerExit (Collider other)
    3.           {
    4.                if (trigger == TriggerType.OnTriggerExit)
    5.                {
    6.                     if (other.gameObject.tag == collideTag) {
    7.                          StoreCollisionInfo (other);
    8.                          Fsm.Event (sendEvent);
    9.                     }
    10.                }
    11.           }
    12.  
    13.  
    Last edited: Jan 17, 2011
  26. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @Jiong

    TooltipAttribute - Came across this problem myself, but haven't had a chance to look into it. I remember it happening when you use tooltips on every parameter. I use tooltips on single parameters here and there and it works okay. This *might* be a unity bug, since I'm just using the tooltip in GUIContent... but I'll take another look.

    Long variable names - I plan to implement a splitter control for the Inspector panel at some point so you could make the panel wider. Another solution would be an automatic tooltip with the full name when it is too long - but that runs into the problem with Tooltips above.

    State tab bug - Not sure I follow this one...

    TriggerEvent - Good catch! Fixed in the next beta.
  27. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Beta3 is available: download

    There are some changes that could break existing projects, so read the release notes: here

    Highlights:
    - Fixed remaining performance problems in editor with larger graphs.
    - New FsmString variable.
    - Made a few basic String Actions just to get started...

    Coming in Beta 4:
    - Arrays as action parameters. This will power a lot of cool actions!
    - FsmObject variable for all types derived from UnityEngine.Object.
  28. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    bug note:
    - when name of gameobject is no english language(like chinese), click [select fsm], then unity crash.
    - SendMessage Action Parameter look like can’t ref to FsmVariable. (when play game, Parameter auto reset to None.)
    - can Select FSM just show FSMs in Scene? currently it’s also show FSM in prefabs.
    Last edited: Jan 20, 2011
  29. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Beta 4 is available: download

    Release notes: here

    Highlights:
    - Support for arrays in actions.

    Coming in Beta 5:
    - Tutorial videos and more sample scenes.
  30. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @Jiong -

    - I'll look into non english language support. I use Windows 7 and it doesn't crash, but it also doesn't display properly...
    - With SendMessage, were you using FsmString? That should be fixed in Beta 4.
    - Prefab/scene object filters would be good. I'm also considering these changes to FSM selection: here.

    EDIT - SendMessage is not fixed in Beta 4. Will fix it for Beta 5...
    Last edited: Jan 24, 2011
  31. artboy

    artboy

    New Member

    Joined:
    May 31, 2009
    Messages:
    22
    As a designer, is this the DREAM!!!! Thank you!! Can't wait for the screencasts!

    www.erosner.com
  32. Jiong

    Jiong

    New Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    bug report:

    - some time state action lost. and report memory leak.
    when i add new param to my state action script, and Compiled.
    playmaker report this:
    Action script has changed since Fsm was saved: Parameters reset to default values....
    NullReferenceException: Object reference not set to an instance of an object

    then state graph broken, i can't visit state graph view.
  33. itech

    itech

    New Member

    Joined:
    Jul 28, 2010
    Messages:
    139
    Hi
    Is Playmaker work on iOS ?
  34. hike1

    hike1

    Member

    Joined:
    Sep 6, 2009
    Messages:
    254
    I tried the 'no exit' how do I get through the door that closes when I approach it?

    Also unity 3.1 free exited suddenly w/o shutting down.

    Underworld 2 is still my all time fave game even after 19 years.
  35. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @artboy - Screencasts coming soon - I promise! I also just fixed a web player crash, so I'll have online demos to go with the docs...

    @Jiong - Handling actions that have changed since they were saved should work better in the next beta...

    @itech - Yes. Although I don't have an iPad yet, so I'd be interested in hearing people's experiences with that. Android too!

    @hike1 - There's a button above the door you can jump to press. It's kind of painful actually - I apologize!

    What were you doing when Unity shut down?

    Underworld 2 was before my time at Looking Glass, but I agree, a very cool game!
  36. hike1

    hike1

    Member

    Joined:
    Sep 6, 2009
    Messages:
    254
    There's a button above the door you can jump to press. It's kind of painful actually - I apologize!
    I could make it flash green but it wouldn't activate.

    What were you doing when Unity shut down?
    Trying to get out of game mode. It didn't crash this time though

    but I agree, a very cool game!
    Thief is my second favorite.
  37. Krazoa

    Krazoa

    New Member

    Joined:
    Dec 12, 2009
    Messages:
    17
    I think I'm going to try it out ^.^
  38. xabi

    xabi

    New Member

    Joined:
    Apr 30, 2010
    Messages:
    7
    I made a funky simple demo with Playmaker on my website if someone want a quick try.
    POC PlayMaker
    [​IMG]

    I really love this tool, and the beta 5 now works fine on the webplayer.

    PS : You can move the tank with the TFGH Keys...

    By the way, Protopack is perfect for Proof Of Concept ;)
  39. hike1

    hike1

    Member

    Joined:
    Sep 6, 2009
    Messages:
    254
    I made a funky simple demo with Playmaker on my website if someone want a quick try.
    POC PlayMaker

    Works for me, any way to see the coding? (off line version minus models)
  40. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Beta 5 is now available: download

    Release notes: here

    NOTE: Undo/Redo is flaky when working with actions. Will fix in next beta... should probably avoid using undo/redo on actions until then.

    Highlights:
    • Crash bug fixes in iOS and web player.
    • Vector3 and Color variables.
    • New FSM selection method.
    • Event and Variable Manager improvements:
    • Variable use count
    • Delete unused events/variables
    • Right click event/variable to select states that use it

    A new sample scene: MaterialEffects shows off new material actions, but also serves as a good introduction to Playmaker.

    Coming in Beta 6:
    - Bullet-proof undo/redo system.
  41. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @xabi - cool demo! Thanks for posting it.

    @hike1 - Take a look at the TestLab sample scenes for some basic examples. E.g. MaterialEffects uses material actions and mouse events, AutomaticDoor uses trigger and animation actions...
  42. xabi

    xabi

    New Member

    Joined:
    Apr 30, 2010
    Messages:
    7
    It's Visual SM coding but this maybe can help :

    [​IMG]
    [​IMG]
    Last edited: Jan 31, 2011
  43. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Beta 6 is now available: download

    Release notes: here

    Highlights: Lots of undo/redo and selection bugs fixed.

    The next beta will likely be a release candidate. I'd like to submit to the asset store this week... any other new features will come as updates after release.

    EDIT: Updated the zip with a small bug fix, please re-download if you grabbed it already... thanks!
    Last edited: Jan 31, 2011
  44. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    A quick example of how to access a PlayMakerFSM in your own scripts:

    Code (csharp):
    1. using UnityEngine;
    2. using HutongGames.PlayMaker;
    3.  
    4. public class UseFSM : MonoBehaviour
    5. {
    6.     public PlayMakerFSM behavior;
    7.    
    8.     void Update ()
    9.     {
    10.         // getting named fsm variables
    11.         FsmFloat test = behavior.FsmVariables.GetFsmFloat("test");
    12.        
    13.         // setting named fsm variables
    14.         test.Value = 0.5f;
    15.        
    16.         // sending events
    17.         behavior.Fsm.Event("test");
    18.     }
    19. }
    In the Unity inspector, just drag an object that has a PlayMakerFSM component onto the behavior slot...

    Obviously this example doesn't actually do anything, it just shows how to access the FSM variables and send events to the FSM.

    I'll clean up the interface a little before final release...
  45. fmarkus

    fmarkus

    Member

    Joined:
    May 22, 2010
    Messages:
    148
    Hello!
    This tool looks very promising! I have two questions:
    1. How do you test variables? Like: if (Collision.gameobjectname=='enemy') then...
    2. It seems that there's no access to touch inputs. Is there?

    Thanks! Keep going, it's very promising!
  46. artboy

    artboy

    New Member

    Joined:
    May 31, 2009
    Messages:
    22
    It's so interesting that a bunch of visual programming solutions are all coming out......Any screencasts coming?

    Thanks.
  47. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    @fmarkus - Thanks!

    There are actions to test variables and send events based on the results:

    BoolTest
    IntCompare
    FloatCompare

    But some others are still needed (E.g., StringCompare, GameObjectCompare...)

    I'd also like to make higher level building blocks for common use cases. E.g., DistanceCheck instead of GetDistance and FloatCompare.

    I'm thinking about putting these tests in their own category to make them easier to find.

    I still need to make touch actions. Thinking about the right set of actions to make. Do you have any ideas on how you'd like touch data exposed?

    @artboy - soon! :D
  48. Murcho

    Murcho

    Member

    Joined:
    Mar 2, 2009
    Messages:
    296
    I'd just like to thank Alex for PlayMaker, we utilized it in our Game Jam entry in the Sydney Australia competition this year and managed to win!

    You can check out our game here : Press 3 to Breed

    Wouldn't have been possible in the time frame without PlayMaker!
  49. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803
    Thanks Murcho and congratulations!!
  50. Alex Chouls

    Alex Chouls

    Member

    Joined:
    Mar 24, 2009
    Messages:
    803