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 ... 21 22 [23]
331
Hi,

 I find myself willing to drag from a global transition to different State ( mainly during re factoring or new needs), but that doesn't work. This is especially a pain with the START global transition. I have to copy paste, relink, basically becomes a mess if I want to assign a different state to the Start event.

I tried to create a START event and then have an action to trigger that event but that doesn't work neither.

so, if some kind of easier manipulation would be made around this, it would be helpful.

 Bye,

 Jean

332
Feature Requests / debugging and stack tracing
« on: April 07, 2011, 12:04:06 AM »
Hi,

Had a problem just now, and It was difficult to debug because I wasn't able to know what action triggered the transition. I did put a break point on the transition I was interested in, but it's currently not possible to trace back as to how we actually ended up here.

 This is something that would be extremely useful for fast and efficient debug. That is, having the action that triggered the transition hilited somehow.

 Maybe it's possible but I can't find a way to find this kind of information.

Bye,

Jean

333
Share New Actions / FsmBoolTest.cs
« on: April 06, 2011, 10:10:18 PM »
Hi Everyone,

 Posting this as it really speed up my development and saves me duplicating variables all over.

Yes, it's intended to be used only once, no every frame as it will less effective than checking its own local variable in terms of speed, but for some organization, it makes perfect sense. When for example there is a fsm responsible for storing variables for a given process, while other fsm can check against them when needed. Or simply when you can't be bother spending the extra time of creating a duplicate variable, and making the actions to retrieve it, store it and finally check for it.

For convenience, I have created an Unity package, that can be downloaded here: http://dl.dropbox.com/u/17356625/Unity/playmaker/actions/FsmBoolTest.unitypackage

1: have your unity project opened
2: in the menu, select Assets->Import Package->Custom Package
3: locate and select FsmBoolTest.unitypackage on your computer
4: Click Open
5: there is one file, make sure it's selected and import
6: done, you can now access this new action in the "Logic" Action category

 Hope you find it useful,

 Bye,

 Jean


Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
// Modified by Jean Fabre : contact@fabrejean.net
// this is a combination of BoolTest and GetFsmBool since I don't want the extras steps required otherwise.
// I also don't feel like saving a variable for every single check from other fsm, I want to avoid redundance sometimes.
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Logic)]
[Tooltip("Sends Events based on the value of a Bool Variable from another FSM.")]
public class FsmBoolTest : FsmStateAction
{
[RequiredField]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.FsmName)]
[Tooltip("Optional name of FSM on Game Object")]
public FsmString fsmName;
[RequiredField]
[UIHint(UIHint.FsmBool)]
public FsmString variableName;
[RequiredField]
[UIHint(UIHint.Variable)]

public FsmEvent isTrue;
public FsmEvent isFalse;

public bool everyFrame;

private bool storedValue;

GameObject goLastFrame;
PlayMakerFSM fsm;


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


storedValue = false;
isTrue = null;
isFalse = null;
}

public override void OnEnter()
{
DoGetFsmBool();

Fsm.Event(storedValue ? isTrue : isFalse);

if (!everyFrame)
Finish();
}

public override void OnUpdate()
{
DoGetFsmBool();

Fsm.Event(storedValue ? isTrue : isFalse);
}

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

// only get the fsm component if go has changed

if (go != goLastFrame)
{
goLastFrame = go;
fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
}

if (fsm == null) return;

FsmBool fsmBool = fsm.FsmVariables.GetFsmBool(variableName.Value);

if (fsmBool == null) return;

storedValue = fsmBool.Value;
}

}
}

334
Hi,

 As I develop fsms, I build processed that are ready before other parts of the projects are, just because event systems allow that kind of freedom and power.

Now, I wish I could trigger an event by simply right clicking to it and select "trigger" or something. I could easily verify a local process and not have to build junk/testing code or fsm for nothing.

 That would be increasing productivity dramatically.

 Bye,

 Jean

335
Action Requests / FsmBoolTest.cs
« on: April 04, 2011, 05:28:29 AM »
Hi Everyone,

 Posting the custom action that I use the most currently as I build flow charts involving several fsm and central fsm for variable pooling. It saves me several creation steps every time and more importantly prevent having to store duplicate variables all over fsm.

 If you have suggestions, critics or better code for that, it's all welcome!

Hope you'll find it useful :)

 Bye,

 Jean


Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
// Modified by Jean Fabre : contact@fabrejean.net
// this is a combination of BoolTest and GetFsmBool since I don't want the extras steps required otherwise.
// I also don't feel like saving a variable for every single check from other fsm, I want to avoid redundance sometimes.
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Logic)]
[Tooltip("Sends Events based on the value of a Bool Variable from another FSM.")]
public class FsmBoolTest : FsmStateAction
{
[RequiredField]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.FsmName)]
[Tooltip("Optional name of FSM on Game Object")]
public FsmString fsmName;
[RequiredField]
[UIHint(UIHint.FsmBool)]
public FsmString variableName;
[RequiredField]
[UIHint(UIHint.Variable)]

public FsmEvent isTrue;
public FsmEvent isFalse;

public bool everyFrame;

private bool storedValue;

GameObject goLastFrame;
PlayMakerFSM fsm;


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


storedValue = false;
isTrue = null;
isFalse = null;
}

public override void OnEnter()
{
DoGetFsmBool();

Fsm.Event(storedValue ? isTrue : isFalse);

if (!everyFrame)
Finish();
}

public override void OnUpdate()
{
DoGetFsmBool();

Fsm.Event(storedValue ? isTrue : isFalse);
}

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

// only get the fsm component if go has changed

if (go != goLastFrame)
{
goLastFrame = go;
fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
}

if (fsm == null) return;

FsmBool fsmBool = fsm.FsmVariables.GetFsmBool(variableName.Value);

if (fsmBool == null) return;

storedValue = fsmBool.Value;
}

}
}

336
Feature Requests / public private fsm variables
« on: April 04, 2011, 04:12:03 AM »
Hi,

I think it would be good to be able to declare fsm variable as private or public, so that other fsm can or can not see them when setting variables of others. Not only it's a good practice as is, but in the perspective that an ecosystem will emerge with lots of ready made fsm, it will become necessary to guarantee protection just like normal script do as well.

 Bye,

 Jean

337
Feature Requests / State shortcut to avoid links clutter and cross
« on: April 04, 2011, 02:55:20 AM »
Hi,

 It would be good to be able to define shortcuts to existing State in a fsm, so that from transition far apart visually, linking to that state doesn't overlap or cross the drawings. It would have a special visual appearance like dashed or something, and clicking on it would move the view to display the actual State in question.

 Bye,

 Jean

338
Feature Requests / taking a screenshot of fsm
« on: April 04, 2011, 02:51:43 AM »
Hi,

 Wanted to take a screenshot of my fsm.... it was too big even full screen... ;D
 
 So, would it be possible to integrate a screenshot function within the playmaker fsm so that it capture the whole canvas, not just the actual view?

 I know fsm shouldn't be that big, but got carried away...

 Bye,

 Jean

339
Feature Requests / Events type differentiation
« on: April 01, 2011, 03:54:29 AM »
Hi,

 As I build more and more complex fsm, I see three different categories or events emerging so far.

-- The obvious one are built in events coming from the system, user inputs, triggers, etc, all the ones pre builted ( with the exception of "FINISHED" which would belong to my third category)

-- The second category are events describing the actual process  described by the fsm. They are very specific "ROBOT IS READY", or "PLAYER WOUNDED", anything very specific about what you are building.

-- The third category are events helping out in describing the generic flow, basically transition's events. For example, I find myself creating a "DONE" event when a routine is finished. A "TRUE" "FALSE" event pairs, when I build a state checking for a bool. a "YES" "NO" pair when asking more plain english question to the system ( true or false basically..). They are exclusively used in transition because a global event "TRUE" means nothing really... The built in "FINISHED" event belongs to this category I would say.
They are very useful and prevent creating too much events from the second category which leads to cluttered events and basically too much of them in the end.

I think there is room to organize events so that differentiating between such types of event becomes clearer and more manageable.

 Bye,

 Jean

340
Feature Requests / In view editing tools
« on: April 01, 2011, 03:39:22 AM »
Hi,

 While building a fsm, it would be nice that the current selected state displays a toolbar around itself with shortcuts to create basically the same functionnalities accessible via a right Click ( at least the mean ones). I know this is not critical, but the worflow would greatly benefit from this, instead of several step required to create and select a transition for example. A single click on a little + icon would create AND reveal the list of events to pick one from.

Bye,

 Jean

341
Hi,

 Obviously, complexity is added over time. It would be very good to have some kind of special note so that as we build the basic structure, we can quickly flag the state or event with a Todo: flag. Very much similar to how IDE implement such features. The very unique nture of fsm makes conventionnal todo system less useful and break the flow. Infos and tooltip do not allow yet this kind of emphasis.

 Something maybe to add with custom notes etc etc.

 Bye,

 Jean

342
Playmaker Bug Reporting / global event width adjustment [FIXED]
« on: March 31, 2011, 03:46:41 AM »
Hi,

 Noticed that for very long event name, the corresponding global event doesn't expand enough. Tho, it works fine for a State.

Maybe this should be consistent, so that we can have long events not cropped in the view, which doesn't look very nice.

 Bye,

 Jean

Pages: 1 ... 21 22 [23]