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.


Topics - jeanfabre

Pages: 1 ... 20 21 [22] 23 24
316
Feature Requests / selecting content with the mouse
« on: May 17, 2011, 03:24:30 AM »
Hi,

 currently when selecting States with the mouse, it selects only what's fully inside the selection rect.

 Would it be possible to improve on this, by allowing for example a keyboard combos to select everything that the selection rectangle touches ( like pressing command or shift), or maybe like in max, detect the direction of the mouse and behave differently depending on how the selection rectangle was drawn.


 Bye,

 Jean

317
Hi,

 As the project grows, I start seeing latency when using broadcast action. It becomes a problem now. As Fsm relies on Events to communicate. Is there any plans to improve on the events system to let interested parties registering to events, that would prevent shaving to broadcast. Or maybe the api involved in gathering all fsm, etc etc could be improved to minimize the impact on the perfs.

I am currently trying to improve the code itself ( like calling only fsm with the given event ), but meanwhile, you might have suggestions.


 Bye,

 Jean

318
Feature Requests / custom Action help icon url definition
« on: May 16, 2011, 04:24:46 AM »
Hi,

 Each actions top bar have a help icon that opens the browser to the related page.

 but for custom actions, how can we define such url? It might be possible, but haven't find the way to define this url.

 If not available. Can you expose this variable Alex? That would be a very good way for custom action to get an easy access and  maintainable online help. this would also be a goo way to "officialise" custom actions and put helps in the wiki.

 Bye,

 Jean

319
Feature Requests / new created fsm more adequate default names
« on: May 16, 2011, 02:47:18 AM »
Hi,

 following http://hutonggames.com/playmakerforum/index.php?topic=254.msg1019#msg1019

 I think there is a minor but important issue for new comers in the sense that the default name for an fsm is always the same. This becomes  confusing when several fsm are on the same gameobject and also not very useful in the drop down list in the editor.

 This could be adressed in several ways, here are some suggestions:

-- like pasting actions, have "FSM 1","FSM 2","FSM x" when a fsm is created on the same gameobject.

-- when creating a fsm, a wizard popup would offer the ability to name it straight and explain the very important nature of the name ( since currently, refactoring is very difficult when a fsm is referenced already).


 Bye,

 Jean

320
Hi,

If I use the Debug log action: Double clicking on the console line takes me to the action script, not the fsm and the state it was issued. It's very handy to be able to output to the console, but it's a pity we can't go directly to that action responsible for this log. I have no clue if you have the ability to intercept users action in the console and act upon it properly. Hopefully it's possible.
 
 Bye,

 Jean

321
PlayMaker Bug Reporting / / char in fsm component names
« on: May 13, 2011, 12:45:13 AM »
Hi,

 Funny quirk or useful feature?

If you name a fsm component  hello/me/again it will create  sub menus in the dropdown list of fsm  in the editor.

It's actually quite cool when you think about it, but just wanted to make sure you were aware of this and either make it as a feature, document it or fix it. Not at all critical obviously.

 Bye,

 Jean

322
Hi,

 Thanks to hairyMug for his finding ( http://hutonggames.com/playmakerforum/index.php?topic=244.0 ), I think we have an issue with exporting a gameobject with a fsm component in a package. when importing back, the component is missing the reference to the script. I think simply because there isn't ( if you switch to debug, you'll get a white content in place of the script reference).

 So this is something you are aware of Alex right? maybe I missed it in the doc.

 Bye,

 Jean

323
Share New Actions / ToggleIsTrigger
« on: May 09, 2011, 11:52:34 PM »
Hi,
 
 More on isTrigger with this toggle action ( following Marcos's request).

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Physics)]
[Tooltip("Toggle a collider isTrigger Flag")]
public class ToggleIsTrigger : FsmStateAction
{
[RequiredField]
[CheckForComponent(typeof(Collider))]
public FsmOwnerDefault gameObject;

public override void Reset()
{
gameObject = null;
}

public override void OnEnter()
{
DoToggleIsTrigger();
Finish();
}

void DoToggleIsTrigger()
{
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go == null) return;
if (go.collider == null) return;

go.collider.isTrigger = !go.collider.isTrigger;
}
}
}

Bye,

 Jean
 

324
Share New Actions / SetIsTrigger
« on: May 09, 2011, 11:45:25 PM »
Hi,

 Here is a adaptation of SetIsKinematic action to control isTrigger for a collider ( after Marcos's request).

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Physics)]
[Tooltip("Controls a collider isTrigger Flag")]
public class SetIsTrigger : FsmStateAction
{
[RequiredField]
[CheckForComponent(typeof(Collider))]
public FsmOwnerDefault gameObject;
[RequiredField]
public FsmBool isTrigger;

public override void Reset()
{
gameObject = null;
isTrigger = false;
}

public override void OnEnter()
{
DoSetIsTrigger();
Finish();
}

void DoSetIsTrigger()
{
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go == null) return;
if (go.collider == null) return;

go.collider.isTrigger = isTrigger.Value;
}
}
}


 Bye,

 Jean



325
Share New Actions / FsmGameObjectCompare.cs
« on: April 20, 2011, 01:07:44 AM »
Hi,

 Ok, following FsmBoolTest ( http://hutonggames.com/playmakerforum/index.php?topic=74.0 ),

 Here is FsmGameObjectCompare test.

 Based on GameObjectCompare https://hutonggames.fogbugz.com/default.asp?W488

Same thing but now you can select remote gameobject from other fsms.

It features a flag to prevent triggering a true comparison if both variable are null. While it is mathematically correct, this is unlikely what you want in practice. This easily solved like so and prevent more states and actions to check that both variable are null in case Equal is triggered.


Quote
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
   [ActionCategory(ActionCategory.Logic)]
   [Tooltip("Compares 2 Game Objects from different fsms and sends Events based on the result.")]
   public class FsmGameObjectCompare : FsmStateAction
   {
      
      [RequiredField]
      public FsmOwnerDefault gameObject;
      [UIHint(UIHint.FsmName)]
      [Tooltip("Optional name of FSM on Game Object")]
      public FsmString fsmName;
      [RequiredField]
      [UIHint(UIHint.FsmGameObject)]
      public FsmString variableName;
      
      [RequiredField]
      public FsmOwnerDefault compareToGameObject;
      [UIHint(UIHint.FsmName)]
      [Tooltip("Optional name of FSM on Game Object")]
      public FsmString compareToFsmName;
      [RequiredField]
      [UIHint(UIHint.FsmGameObject)]
      public FsmString compareToVariableName;
      
      [Tooltip("If both variable are null, do trigger NOT EQUAL.")]
      public bool nullTriggerNotEqual;
      public FsmEvent equalEvent;
      public FsmEvent notEqualEvent;
      [UIHint(UIHint.Variable)]
      public FsmBool storeResult;
      public bool everyFrame;

      public override void Reset()
      {
         equalEvent = null;
         notEqualEvent = null;
         storeResult = null;
         nullTriggerNotEqual = true;
         everyFrame = false;
      }

      public override void OnEnter()
      {
         DoGameObjectCompare();
         
         if (!everyFrame)
            Finish();
      }

      public override void OnUpdate()
      {
         DoGameObjectCompare();
      }

      void DoGameObjectCompare()
      {
         
         if (gameObject == null || compareToGameObject == null)  return;
         
         if ( fsmName == null || compareToFsmName == null)  return;
         
         if ( variableName == null || compareToVariableName == null)  return;
         
         GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
         if (go == null) return;
         
         GameObject compareToGo = Fsm.GetOwnerDefaultTarget(compareToGameObject);
         if (compareToGo == null) return;         
         
         // get the first value
         PlayMakerFSM fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
         
         if (fsm == null) return;
         
         FsmGameObject fsmGameObject = fsm.FsmVariables.GetFsmGameObject(variableName.Value);
         
         if (fsmGameObject == null) return;
         
         // get the compareTo value
         PlayMakerFSM compareToFsm = ActionHelpers.GetGameObjectFsm(compareToGo, compareToFsmName.Value);
         
         if (fsm == null) return;
         
         FsmGameObject compareToFsmGameObject = compareToFsm.FsmVariables.GetFsmGameObject(compareToVariableName.Value);
         
         if (compareToFsmGameObject == null) return;         
      
         
         bool equal = fsmGameObject.Value == compareToFsmGameObject.Value;
         if (nullTriggerNotEqual && equal){
            if (fsmGameObject.Value== null || compareToFsmGameObject.Value==null){
               equal = false;
            }
         }
         
         if (storeResult != null)
            storeResult.Value = equal;
         
         if (equal && equalEvent != null)
            Fsm.Event(equalEvent);
         else if (notEqualEvent != null)
            Fsm.Event(notEqualEvent);
         
      }
      
   }
}

326
Share New Actions / SetFsmGameObject that accepts null
« on: April 20, 2011, 12:11:36 AM »
Hello Everyone,

 Just a very minor but quite important mod actually ( at least for my needs :) )

 Basically the original action requires you to select a gameObject to set, but in many cases, it is important to be able to remove the reference. so I modified the action to allow for this. I might miss an obvious drawback maybe.


Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
//
// This version allow setting the variable to null,
// the original version requires a gameobject to be selected,
// but in many situation, it is important to be able to remove any reference.
//

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.StateMachine)]
[Tooltip("Set the value of a Game Object Variable in another FSM. Accept null reference")]
public class SetFsmGameObject : FsmStateAction
{
[RequiredField]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.FsmName)]
[Tooltip("Optional name of FSM on Game Object")]
public FsmString fsmName;
[RequiredField]
[UIHint(UIHint.FsmGameObject)]
public FsmString variableName;
public FsmGameObject setValue;
public bool everyFrame;

GameObject goLastFrame;
PlayMakerFSM fsm;

public override void Reset()
{
gameObject = null;
fsmName = "";
setValue = null;
}

public override void OnEnter()
{
DoSetFsmGameObject();

if (!everyFrame)
Finish();
}

void DoSetFsmGameObject()
{
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go == null) return;

if (go != goLastFrame)
{
goLastFrame = go;

// only get the fsm component if go has changed

fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
}

if (fsm == null) return;

FsmGameObject fsmGameObject = fsm.FsmVariables.GetFsmGameObject(variableName.Value);

if (fsmGameObject == null) return;

if (setValue == null) {
fsmGameObject.Value = null;
}else{
fsmGameObject.Value = setValue.Value;
}
}

public override void OnUpdate()
{
DoSetFsmGameObject();
}

}
}


Bye,

 Jean

327
Hi,

 Refactoring at the moment my huge fsm into several, and it's a bit of a pain,

I create a new fsm, copy the States I want to move from anoter state and paste them on that newly created fsm.
-- All my Pasted States have now "- Copy 1"

 No real big deal, but since it would be better if State names are renamed if necessary. when pasting, scanning existing States for already used named.

And even why not expose the list duplicated State and allow the user to rename them properly and then apply the paste.

 It might be difficult to implement I appreciate that.... just throwing ideas :)

 Bye,

 Jean

328
Hi,

 Lost litteraly several hours on that  :-\

 I forgot I had disabled that fsm, and for some reason some of my States would work but other would just turn blue and the fsm would end up in a 'no state' situation.

 Basically, if disabled, a fsm, still receives events, still process ANY actions doing stuff on "OnEnter" but nothing is processed for the OnUpdate, which put me on the wrong path, cause I though it was the action that had a problem...
 
 oh well, learned the hard way on that one.

 If this is feature, it should in bold red on the help. Else, it should in bod red a soon to be ( wiki Alex ?) troubleshooting page.

 Bye,

 Jean

329
Hi,

 Following the great action from sP0CkEr ( http://hutonggames.com/playmakerforum/index.php?topic=98.0 ), here's a variant that let you catch the tap event directly, so no post processing required in fsm and you can also if you want catch all events via another event.

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

/// <summary>
/// PlayMaker Action for Delegating when a UIButton
/// has been invoked.
/// </summary>
/// <para>
/// This Action should be placed in the Start action of your
/// FSM. It will add itself as a delegate to the EZGui Button
/// to capture events that have been triggered by the
/// button.
/// </para>
/// <remarks>The Owner must contain a UIButton class</remarks>
/// <remarks>See the EZGui Documentation for More information on this Delegate</remarks>
///
/// <remarks>
/// Modified the original EzButtonInvoke, to catch only the tap event and/or all events. It's likely anyway that
///  only the tap event is needed on the fsm side, since ezgui will largely deal with the look and feel of the button itself.
/// </remarks>
///
[ActionCategory("EzGui")]
[Tooltip("EzGui Button Click")]

public class EzButtonInputDelegate : FsmStateAction {

[CheckForComponent(typeof(UIButton))]
public FsmOwnerDefault gameObject;
public FsmEvent tapEvent;
public FsmEvent allEvents;

private GameObject go;
private UIButton _object;

public override void Reset() {
gameObject = null;
tapEvent = null;
allEvents = null;
}

public override void OnEnter() {

// get the UIButton attached to this object

go = gameObject.OwnerOption == OwnerDefaultOption.UseOwner ? Owner : gameObject.GameObject.Value;
_object = go.GetComponentInChildren<UIButton>();

// set the delegate to capture change event
_object.AddInputDelegate(MyInputDelegate);
Finish();
}

public override string ErrorCheck() {

// TODO: Missing UIButton Object

return "";
}


void MyInputDelegate(ref POINTER_INFO ptr) {

if (tapEvent!=null && ptr.evt == POINTER_INFO.INPUT_EVENT.TAP){
Fsm.Event(tapEvent);
}

if (allEvents!=null){
Fsm.EventData.StringData = ptr.evt.ToString();
Fsm.Event(allEvents);
}

}// MyInputDelegate

}


Bye,

 Jean

330
Feature Requests / clues about State Action and expectations
« on: April 18, 2011, 03:18:58 AM »
Hi,

 Following my last post, I have to expand on this:

 State actions really make State versatile ( obviously... ), they can be instant, synched, waiting, animating, accessing other fsm somehow, etc etc, it's currently impossible to make sure about the behavior of a State on that level just at a glance.

 Her is a list of things that could be identified as actions "properties" are added and that I think should be presented visually in the fsm.

 -- number of actions:
 -- instant or not:
    it's important to see if State is just a one time thing that will then straight away transit, or if it will last in time ( if everyframe is checked or not for example).
-- access variable:
   It's really important to glance through state and know that a particular one is accessing ( setting or getting ) any variable at all.
-- other fsm access:
  Equally important to know when the fsm talk to other
-- Script access:
 same as above.

 I am sure other properties like that can be listed here, but you get the point I think.

 I played in photoshop to demonstrate visually one humble possible way. Just some simple icons or visual elements representing each something specific about the State.

Oh and while we are at it, if from the script api we could tweak that, say we want to add a custom icon somewhere. It could actually be simply a matter of doing it like that, each action can set certain flags that triggers the visual clues in that State . Fsm.State.FlagFsmAccess, Fsm.State.FlagAsTimeSpan etc etc That could be a simple way to do this.

Bye,

 Jean




Pages: 1 ... 20 21 [22] 23 24