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

Pages: [1] 2
1
Feature Requests / Action Browser in Playmaker Editor Window
« on: January 20, 2017, 08:48:38 PM »
I'd love to see the option of the Action Browser in the main Playmaker editor window.

Two panels usually not a big hassle, however as I build larger FSM logic I like to maximize the Editor Window with shift-space to see the whole system. Helps especially when Im working on a laptop.

The current workflow is to hit the action browser in bottom of the state tab. But then when I go back to the regular layout I have a random action browser floating around.

Thanks!

2
Playmaker Help / Array Maker Split String to Characters
« on: August 31, 2016, 04:25:10 PM »
Hey friends,

I'm attempting to split a string like "word" into individual characters and then add them into to an array maker array.

I'm looking at the split text, but this is really handy for lists of words that have clear dividers. How can you pull this off with a single long string?

Thanks!

3
Playmaker Bug Reporting / Custom Actions Missing
« on: June 21, 2016, 03:00:35 PM »
Updated to 1.8.1 and getting this error:

Missing Action: Could not Create Action (Maybe Script is Missing)

The actions aren't showing up in the action browser but are apart of the project and are causing no console errors on their own.

Any thoughts?

4
User Showcase / Winner Is Dinner
« on: April 10, 2016, 08:27:20 AM »
Hey friends!

Wanted to share the latest app I made.



http://devpost.com/software/winner-is-dinner

Its a simple dinner app. You choose a city. Select two contenders. They duke it out and the winner is your dinner.

This app makes use of the Yelp API database and I relied heavily on Playmaker for the a good chunk of the the interaction. But! Something I feel really good about, because I dived into making my own Playmaker actions, a positive side effect is that I began to learn C#. So I'm happy to report that in some instances I wrote my own scripts! Albeit simple in nature, they made me feel good about this journey. And I made this app in less than 4 weeks.

5
Playmaker Help / ArrayMaker Remove Empty Data[SOLVED]
« on: March 10, 2016, 09:14:08 AM »
Hi there! I'm pulling some info from the web and passing the info to an ArrayMaker array. Works lovely.

However, sometimes the content shows up with some empty data. Any idea about how I could remove those empty entries?

6
Playmaker Announcements / [Released] Run'N Gun 2D For Playmaker
« on: November 25, 2015, 08:54:06 AM »
Hey friends!

Really pumped to announce that my playmaker kit is available in the asset store!

Run'N Gun 2D aims to kickstart you off into making your very own 2D Platformer Shooter game!


Featuers:

- Three types of timing (360 degree aiming, eight-way aiming, simple bi-directional aiming)
- Three types of enemy AI (simple patroller, advanced patroller, flying enemy)
- 21 Custom Playmaker Actions
- Smooth follow camera with a shake feature
- 2D non-physics based controls
- Mobile example scenes (Tested on the iPhone. Android APK in the works)
- All the logic is built in playmaker

Screenshots:







I so look forward to seeing what you make!

7
Action Requests / Arraymaker components to String
« on: November 06, 2015, 12:56:29 PM »
I'm trying to write an action that will take string variables from my Array and join them into a string. This is what I have so far but the result ends up as "System.Collections.ArrayList" Any thoughts?

Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("ArrayMaker/ArrayList")]
[Tooltip("Joins all elements from a PlayMaker ArrayList Proxy component into a string")]
public class ArrayListJoin : ArrayListActions
{
[ActionSection("Set up")]

[RequiredField]
[Tooltip("The gameObject with the PlayMaker ArrayList Proxy component")]
[CheckForComponent(typeof(PlayMakerArrayListProxy))]
public FsmOwnerDefault gameObject;

[Tooltip("Author defined Reference of the PlayMaker ArrayList Proxy component ( necessary if several component coexists on the same GameObject")]
public FsmString reference;

[ActionSection("Result")]
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmString result;

public bool everyFrame;

public override void Reset()
{
gameObject = null;
reference = null;
result = null;
everyFrame = false;
}


public override void OnEnter()
{
if ( SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject),reference.Value) )
JoinArrayList();

if (!everyFrame)
Finish();
}

public override void OnUpdate()
{
if ( SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject),reference.Value) )
JoinArrayList();

Finish();
}


public void JoinArrayList()
{
if (! isProxyValid())
return;

result.Value = proxy.arrayList.ToString();
}
}
}

8
Playmaker Help / ArrayMaker Split String To Array[SOLVED]
« on: November 04, 2015, 01:59:59 PM »
Hi friends,

I'm attempting to split a string into a char array using ArrayMaker. So for example I'd like to take a word like "apple" and split it into:

0 = a
1 = p
2 = p...

And so forth

I think I'm on to something using the Split Text to Array action, however, I'm unsure how to break the string into individual characters.

Any thoughts on this?

9
Work In Progress... / 2D Run N Gun Starter Kit
« on: October 21, 2015, 01:34:51 PM »
Hey friends! Wanted to share with you a little kit I've been working on that I hope to be dropping in the asset pretty soon.

This kit aims to start you off on the path to making your very own 2d Platformer Shooter game.

Check out the demo: http://bit.ly/RunNGunDemo

Here are some screenshots:





It will feature:

- Three Types of Aiming (360 degree aiming, eight-way aiming, simple bi-directional aiming)
- Three different types of enemy AI (simple patroller, advanced patroller, flying enemy)
- Smooth follow camera with a shake feature
- 2D non-physics based controls
- Mobile example scenes

Looking forward to hearing your feedback!

10
Share New Actions / Prime 31 Character Controller 2d Action
« on: October 07, 2015, 11:38:55 AM »
Hey friends,

I translated the demo script into an input action script for Prime 31's open source 2d Character Controller:

https://github.com/prime31/CharacterController2D

Add the CharacterController2D Component to your player object and an FSM with this action on it. Be sure to configure the CharacterController2D with the appropriate tags and layers and what not.

The action uses the Horizontal/Vertical input axis. The original script controlled the animations as well, this script does not do this. Id suggest using an Axis Event to control animations.

Code: [Select]
using UnityEngine;
using System.Collections;
using Prime31;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Character)]
[Tooltip("Moves a Game Object with a Character Controller 2D from Prime31")]
public class P31CharacerterController2D : FsmStateAction

{
[Tooltip("The GameObject to move.")]
public FsmOwnerDefault gameObject;

[Tooltip("Gravity is applied automatically")]
public FsmFloat gravity;

[Tooltip("Horizontal speed.")]
public FsmFloat runSpeed;

[Tooltip("How fast the player can change directions. Higher equal faster")]
public FsmFloat groundDamping;

[Tooltip("How much control we have over the character while in the air")]
public FsmFloat inAirDamping;

[Tooltip("How high we can jump")]
public FsmFloat jumpHeight;

// movement config
//public float gravity = -25f;
//public float runSpeed = 8f;
//public float groundDamping = 20f; // how fast do we change direction? higher means faster
//public float inAirDamping = 5f;
//public float jumpHeight = 3f;

[HideInInspector]
private float normalizedHorizontalSpeed = 0;
private CharacterController2D _controller;
private RaycastHit2D _lastControllerColliderHit;
private Vector3 _velocity;

public override void Reset()
{
gravity = -25f;
runSpeed = 8f;
groundDamping = 20f;
inAirDamping = 5f;
jumpHeight = 3f;
}


public void OnStart()
{
var go = Fsm.GetOwnerDefaultTarget(gameObject);

_controller = go.GetComponent<CharacterController2D>();

// listen to some events for illustration purposes
_controller.onControllerCollidedEvent += onControllerCollider;
_controller.onTriggerEnterEvent += onTriggerEnterEvent;
_controller.onTriggerExitEvent += onTriggerExitEvent;
}


#region Event Listeners

void onControllerCollider( RaycastHit2D hit )
{
// bail out on plain old ground hits cause they arent very interesting
if( hit.normal.y == 1f )
return;

// logs any collider hits if uncommented. it gets noisy so it is commented out for the demo
//Debug.Log( "flags: " + _controller.collisionState + ", hit.normal: " + hit.normal );
}


void onTriggerEnterEvent( Collider2D col )
{
Debug.Log( "onTriggerEnterEvent: " + col.gameObject.name );
}


void onTriggerExitEvent( Collider2D col )
{
Debug.Log( "onTriggerExitEvent: " + col.gameObject.name );
}

#endregion


// the Update loop contains a very simple example of moving the character around and controlling the animation
public override void OnUpdate()
{
var go = Fsm.GetOwnerDefaultTarget(gameObject);

_controller = go.GetComponent<CharacterController2D>();

// listen to some events for illustration purposes
_controller.onControllerCollidedEvent += onControllerCollider;
_controller.onTriggerEnterEvent += onTriggerEnterEvent;
_controller.onTriggerExitEvent += onTriggerExitEvent;

if (_controller.isGrounded)
_velocity.y = 0;

if( Input.GetAxisRaw("Horizontal") > 0)
{
normalizedHorizontalSpeed = 1;
if( go.transform.localScale.x < 0f )
go.transform.localScale = new Vector3( -go.transform.localScale.x, go.transform.localScale.y, go.transform.localScale.z );

}
else if( Input.GetAxisRaw("Horizontal") < 0 )
{
normalizedHorizontalSpeed = -1;
if( go.transform.localScale.x > 0f )
go.transform.localScale = new Vector3( -go.transform.localScale.x, go.transform.localScale.y, go.transform.localScale.z );

}
else
{
normalizedHorizontalSpeed = 0;

}


// we can only jump whilst grounded
if( _controller.isGrounded && Input.GetAxisRaw("Vertical") > 0)
{
_velocity.y = Mathf.Sqrt( 2f * jumpHeight.Value * -gravity.Value );
}


// apply horizontal speed smoothing it. dont really do this with Lerp. Use SmoothDamp or something that provides more control
var smoothedMovementFactor = _controller.isGrounded ? groundDamping.Value : inAirDamping.Value; // how fast do we change direction?
_velocity.x = Mathf.Lerp( _velocity.x, normalizedHorizontalSpeed * runSpeed.Value, Time.deltaTime * smoothedMovementFactor );

// apply gravity before moving
_velocity.y += gravity.Value * Time.deltaTime;

// if holding down bump up our movement amount and turn off one way platform detection for a frame.
// this lets uf jump down through one way platforms
if( _controller.isGrounded && Input.GetAxisRaw("Vertical") < 0)
{
_velocity.y *= 3f;
_controller.ignoreOneWayPlatformsThisFrame = true;
}

_controller.move( _velocity * Time.deltaTime );

// grab our current _velocity to use as a base for all calculations
_velocity = _controller.velocity;
}
}
}

11
Share New Actions / Cross Platform Input Actions
« on: September 23, 2015, 01:21:33 PM »
Hi friends!

I've been toying around with the standard assets package for awhile now and thought I'd share a set of actions I created for the Cross Platform Input asset.

You will need to be sure to import the Cross Platform Input asset:



Let me know if you have any trouble with these! I've attached a zip file with all these down below!

Get Axis Raw:
Code: [Select]
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("CrossPlatformInput")]
[Tooltip("Gets the value of the specified Input Axis and stores it in a Float Variable. Requires Standard Assets CrossPlatformInput.")]
public class CrossPlatformGetAxisRaw : FsmStateAction
{
[RequiredField]
[Tooltip("The name of the axis. Set in the Unity Input Manager.")]
public FsmString axisName;

[Tooltip("Axis values are in the range -1 to 1. Use the multiplier to set a larger range.")]
public FsmFloat multiplier;

[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("Store the result in a float variable.")]
public FsmFloat store;

[Tooltip("Repeat every frame. Typically this would be set to True.")]
public bool everyFrame;

public override void Reset()
{
axisName = "";
multiplier = 1.0f;
store = null;
everyFrame = true;
}

public override void OnEnter()
{
DoGetAxis();

if (!everyFrame)
{
Finish();
}
}

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

void DoGetAxis()
{
var axisValue = CrossPlatformInputManager.GetAxisRaw(axisName.Value);
// if variable set to none, assume multiplier of 1
if (!multiplier.IsNone)
{
axisValue *= multiplier.Value;
}

store.Value = axisValue;
}
}
}

Axis Event:
Code: [Select]
sing UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("CrossPlatformInput")]
[Tooltip("Sends events based on the direction of Cross Platform Input Axis (Left/Right/Up/Down...).")]
public class CrossPlatformAxisEvent : FsmStateAction
{
[Tooltip("Horizontal axis as defined in the Input Manager")]
public FsmString horizontalAxis;

[Tooltip("Vertical axis as defined in the Input Manager")]
public FsmString verticalAxis;

[Tooltip("Event to send if input is to the left.")]
public FsmEvent leftEvent;

[Tooltip("Event to send if input is to the right.")]
public FsmEvent rightEvent;

[Tooltip("Event to send if input is to the up.")]
public FsmEvent upEvent;

[Tooltip("Event to send if input is to the down.")]
public FsmEvent downEvent;

[Tooltip("Event to send if input is in any direction.")]
public FsmEvent anyDirection;

[Tooltip("Event to send if no axis input (centered).")]
public FsmEvent noDirection;

public override void Reset()
{
horizontalAxis = "Horizontal";
verticalAxis = "Vertical";
leftEvent = null;
rightEvent = null;
upEvent = null;
downEvent = null;
anyDirection = null;
noDirection = null;
}

public override void OnUpdate()
{
// get axes offsets

var x = horizontalAxis.Value != "" ? CrossPlatformInputManager.GetAxis(horizontalAxis.Value) : 0;
var y = verticalAxis.Value != "" ? CrossPlatformInputManager.GetAxis(verticalAxis.Value) : 0;

// get squared offset from center

var offset = (x * x) + (y * y);

// no offset?

if (offset.Equals(0))
{
if (noDirection != null)
{
Fsm.Event(noDirection);
}
return;
}

// get integer direction sector (4 directions)
// TODO: 8 directions? or new action?

var angle = (Mathf.Atan2(y, x) * Mathf.Rad2Deg) + 45f;
if (angle < 0f)
{
angle += 360f;
}

var direction = (int)(angle / 90f);

// send events bases on direction

if (direction == 0 && rightEvent != null)
{
Fsm.Event(rightEvent);
//Debug.Log("Right");
}
else if (direction == 1 && upEvent != null)
{
Fsm.Event(upEvent);
//Debug.Log("Up");
}
else if (direction == 2 && leftEvent != null)
{
Fsm.Event(leftEvent);
//Debug.Log("Left");
}
else if (direction == 3 && downEvent != null)
{
Fsm.Event(downEvent);
//Debug.Log("Down");
}
else if (anyDirection != null)
{
// since we already no offset > 0

Fsm.Event(anyDirection);
//Debug.Log("AnyDirection");
}
}
}
}

Get Button:

Code: [Select]
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("CrossPlatformInput")]
[Tooltip("Gets the pressed state of the specified Button and stores it in a Bool Variable. Requires Standard Assets CrossPlatformInput.")]
public class CrossPlatformGetButton : FsmStateAction
{
[RequiredField]
[Tooltip("The name of the button. Set in the Unity Input Manager.")]
public FsmString buttonName;

[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("Store the result in a bool variable.")]
public FsmBool storeResult;

[Tooltip("Repeat every frame.")]
public bool everyFrame;

public override void Reset()
{
buttonName = "Fire1";
storeResult = null;
everyFrame = true;
}

public override void OnEnter()
{
DoGetButton();

if (!everyFrame)
{
Finish();
}
}

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

void DoGetButton()
{
storeResult.Value = CrossPlatformInputManager.GetButton(buttonName.Value);
}
}
}

Get Button Up:

Code: [Select]
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("CrossPlatformInput")]
[Tooltip("Sends an Event when a Button is released. Requires Standard Assets CrossPlatformInput.")]
public class CrossPlatformGetButtonUp : FsmStateAction
{
[RequiredField]
[Tooltip("The name of the button. Set in the Unity Input Manager.")]
public FsmString buttonName;

[Tooltip("Event to send if the button is released.")]
public FsmEvent sendEvent;

[Tooltip("Set to True if the button is released.")]
[UIHint(UIHint.Variable)]
public FsmBool storeResult;

public override void Reset()
{
buttonName = "Fire1";
sendEvent = null;
storeResult = null;
}

public override void OnUpdate()
{
var buttonUp = CrossPlatformInputManager.GetButtonUp(buttonName.Value);

if (buttonUp)
{
Fsm.Event(sendEvent);
}

storeResult.Value = buttonUp;
}
}
}

Get Button Down:

Code: [Select]
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("CrossPlatformInput")]
[Tooltip("Sends an Event when a Button is pressed. Requires Standard Assets CrossPlatformInput.")]
public class CrossPlatformGetButtonDown : FsmStateAction
{
[RequiredField]
[Tooltip("The name of the button. Set in the Unity Input Manager.")]
public FsmString buttonName;

[Tooltip("Event to send if the button is pressed.")]
public FsmEvent sendEvent;

[Tooltip("Set to True if the button is pressed.")]
[UIHint(UIHint.Variable)]
public FsmBool storeResult;

public override void Reset()
{
buttonName = "Fire1";
sendEvent = null;
storeResult = null;
}

public override void OnUpdate()
{
var buttonDown = CrossPlatformInputManager.GetButtonDown(buttonName.Value);

if (buttonDown)
{
Fsm.Event(sendEvent);
}

storeResult.Value = buttonDown;
}
}
}

12
User Showcase / 100 Orcs
« on: February 02, 2015, 06:58:01 AM »
With much relief, I can finally call my first project complete. I can't tell you how grateful I am to this plugin and community for helping me achieve this goal.

Check it out! I hope you enjoy it.

http://gamejolt.com/games/action/100-orcs/47384/




13
Action Requests / Simple webpage access
« on: January 26, 2015, 04:33:34 PM »
Attempting to do make an action similar to this:

 (from here -> http://docs.unity3d.com/ScriptReference/WWW.html)

Code: [Select]
// Get the latest webcam shot from outside "Friday's" in Times Square
var url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg";
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url);
// Wait for download to complete
yield www;

Here is what I have so far. But I'm stuck on this bug and unsure how to proceed.

"OnEnter()' cannot be an iterator block because `void' is not an iterator interface type"


Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Application)]
[Tooltip("Url Request")]
public class UrlRequest : FsmStateAction
{

[RequiredField]
public FsmString url;

public override void Reset()
{
url ="";
}

public override void OnEnter()
{
WWW www = new WWW (url);
yield return www;
Finish();
}
}
}

Any thoughts?

14
Action Requests / Split String Action
« on: January 24, 2015, 01:42:40 PM »
Looking for an action similar to the Build String action. However, instead of adding the strings together, I'd like to split the strings apart based on a character. For example,

"Dan: 05 | Sally: 09 | Ted: 01" would become:

Dan:05 |

Sally: 09 |

Ted: 01 |

Any thoughts on this?

KJ

15
Playmaker Help / DreamLo Plugin Names and Scores
« on: January 21, 2015, 08:10:37 PM »
Hi,

Searching for some answers regarding Dreamlo Leaderboards. (Worked pretty awesome and out of the box)

However, I'm attempting to minimize the amount of data that I get with the "Get Scores" action. I only wish to display the Player Name and their score. This topic was brought up back in September:(http://hutonggames.com/playmakerforum/index.php?topic=8429.msg40374#msg40374)

I thought I'd try to see if there was any one who made headway with this.

Thanks!

Pages: [1] 2