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.


Messages - tomraegan

Pages: [1]
1
Playmaker Help / Re: unity timeline actions?[SOLVED]
« on: August 23, 2018, 03:17:09 PM »
oops...yes, that was me.

I wasn't sure if the word [SOLVED] in the thread title  meant that new posts might be overlooked. I waited a few days after posting here first and concluded that must be the case, then went and started a new thread.

Apologies.

2
Playmaker Help / Re: Timeline Set Duration
« on: August 22, 2018, 02:43:27 PM »
Hi,

 that's ok, I am here for that :)

I have pushed a new action on the Ecosystem called SetPlayableSpeed

It works on my tests, let me know if all is well on your end.


 Bye,

Jean




Works perfectly.

Thanks kindly. Such great support on these boards.

3
Playmaker Help / Re: Timeline Set Duration
« on: August 21, 2018, 02:18:58 AM »
Thanks for the reply, jeanfabre. I rely heavily on your support of these forums.

I'm trying to set the speed of the timeline, replicating what I believe (but am not sure of) is contained inside this line of code:

Code: [Select]
playableDirector.playableGraph.GetRootPlayable(0).SetSpeed
My goal is to be able to increase and decrease the speed at which timelines play in realtime.

4
Playmaker Help / Timeline Set Duration
« on: August 18, 2018, 03:25:37 PM »
Hi!

https://hutonggames.com/playmakerforum/index.php?topic=15465.15

This thread contains Timeline actions. It includes a Get Duration, which grabs the duration of the timeline without an issue. I want to change the duration of the timeline and then Set Duration. Set Duration does not yet exist as an action.

I was wondering if someone could help me by creating a Set Duration?

Here is the code for Get Duration:

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2017. All rights reserved.
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/

using System;
using UnityEngine;
using UnityEngine.Playables;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Timeline")]
[Tooltip("Get the current timelines duration. This action requires Unity 2017.1 or above.")]

public class  getTimelineDuration : FsmStateAction
{
[RequiredField]
[CheckForComponent(typeof(PlayableDirector))]
[Tooltip("The game object to hold the unity timeline components.")]
public FsmOwnerDefault gameObject;

[Tooltip("Returns the current timeline duration in seconds as a float.")]
[UIHint(UIHint.Variable)]
public FsmFloat duration;
private double _duration;

[Tooltip("Check this box to preform this action every frame.")]
public FsmBool everyFrame;

private PlayableDirector timeline;

public override void Reset()
{

gameObject = null;
everyFrame = false;
duration = null;
}

public override void OnEnter()
{
var go = Fsm.GetOwnerDefaultTarget(gameObject);
timeline = go.GetComponent<PlayableDirector>();

timelineAction();

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

}

public override void OnUpdate()
{

timelineAction();

}

void timelineAction()
{
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go == null || timeline == null)
{
return;
}

_duration = timeline.duration;
duration.Value = (float)_duration;
}

}
}

Thanks!

5
Playmaker Help / Re: unity timeline actions?[SOLVED]
« on: August 12, 2018, 10:51:15 PM »
Quick question about these actions (thanks for them btw).

I'd like to be able to set the speed of the timeline. I think this is the scripted method.

Code: [Select]
playableDirector.playableGraph.GetRootPlayable(0).SetSpeed
I've looked at each of the playmaker timeline actions and none of them seem capable of setting speed.

Am I missing something or is it not in the set of actions?

Thanks.

6
Playmaker Help / Re: Get Property help
« on: December 10, 2017, 12:33:44 AM »
Ok.

 ::)

I assigned tags to each of the separate Grid children and yep...it works.


7
Playmaker Help / Re: Get Property help
« on: December 10, 2017, 12:09:48 AM »
Thanks for that last sentence, Deeks. It opened up a new vein of exploration.

Inside Get Property with the UI Grid set as Target Object, I cannot find a Property of UI Grid that allows for the active/centered grid item to be received. Here they are, minus sub-menus.



Now, obviously, right at the top, it says "active". But it's a bool allowing true/false data only. Can this be interpreted to allow the range of values to be read, like an int?

I've also added other components, attempting to receive updates from the NGUI event. The event triggers in PM without fail but I cannot capture data from the grid children.

You are correct in that my script caused interference to NGUI Center on Child.

As I'm a complete beginner, I appreciate it's not up to experts to provide solutions. In truth, I've developed a taste for experimenting and I'm in no great rush. But any tips anyone has I would appreciate.

8
Playmaker Help / Re: Get Property help
« on: December 09, 2017, 01:21:38 PM »
Thanks kindly, Deek. I tried your suggestions and have made this discovery.

My script stops NGUI/On Center on Child from firing.

If I disable the script, the NGUI/On Center on Child Global Transition in my FSM fires. If I enable the script, it does not. So the problem isn't with the FSM, it's within the script.

Can you identify anything in the script that would interfere with the NGUI event firing in the FSM?

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

public class Read_From_Centre : MonoBehaviour {

public UICenterOnChild myGrid;
public int grid_01_value;

public GameObject[] gridItems = new GameObject[4];

public void knowWhatIsCentered(GameObject _centeredItem)
{
if(_centeredItem == gridItems[0])
{
print("item 0 selected");
grid_01_value = 1;
Debug.Log("grid_01_value = " + grid_01_value);
}
else if(_centeredItem == gridItems[1])
{
print("item 1 selected");
grid_01_value = 2;
Debug.Log("grid_01_value = " + grid_01_value);
}
else if(_centeredItem == gridItems[2])
{
print("item 2 selected");
grid_01_value = 3;
Debug.Log("grid_01_value = " + grid_01_value);
}
else
{
print("item 3 selected");
grid_01_value = 4;
Debug.Log("grid_01_value = " + grid_01_value);
}
}
// Use this for initialization
void Start () {

myGrid.onCenter = knowWhatIsCentered;

}

// Update is called once per frame
void Update () {


}
}

9
Playmaker Help / Re: Get Property help
« on: December 09, 2017, 01:04:13 AM »
I keep doing this (posting, then figuring it out, so sorry if it's a bother. I had spent a day on it before posting and it wasn't going to give. Then I mowed the lawn and gave my daughter a swing. Next thing I know...)

When I've worked out exactly how I did it (still a bit of a mystery to me), I'll post an update.

Edit: I cannot make Center on Child in the NGUI package work. On Click works, On Drop, no problem. But Center on Child remains a mystery. It would be convenient if it did work. This would mean I could create a single FSM on the NGUI Scroll Grid that governed all its children. As it sands, using On Click instead, means two things:

1. User interaction will rely on clicking the object
2. FSM's need to be placed on each child

Neither of these things are too bothersome, but if anyone can see why the Center on Child isn't working, please let me know.

Thanks.

10
Playmaker Help / Get Property help [SOLVED]
« on: December 08, 2017, 04:37:59 PM »
Hi.


I'm trying to get my variable, grid_01_value into PlayMaker from a script, but I can't find evidence of it being read by my FSM. I'm using Get Property and dragged the component itself into the Target Object field. grid_01_value is a public variable and I can list it as the Property. I then store it as 01_int_display_g. I'm then trying to convert and view the result. This is where I can't get a result.

Here is the FSM.


The variable grid_01_value is set from this code:
Code: [Select]
[size=8pt]using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Read_From_Centre : MonoBehaviour {

public UICenterOnChild myGrid;
public int grid_01_value;

public GameObject[] gridItems = new GameObject[4];

public void knowWhatIsCentered(GameObject _centeredItem)
{
if(_centeredItem == gridItems[0])
{
print("item 0 selected");
grid_01_value = 0;
Debug.Log("grid_01_value = " + grid_01_value);
}
else if(_centeredItem == gridItems[1])
{
print("item 1 selected");
grid_01_value = 1;
Debug.Log("grid_01_value = " + grid_01_value);
}
else if(_centeredItem == gridItems[2])
{
print("item 2 selected");
grid_01_value = 2;
Debug.Log("grid_01_value = " + grid_01_value);
}
else
{
print("item 3 selected");
grid_01_value = 3;
Debug.Log("grid_01_value = " + grid_01_value);
}
}
// Use this for initialization
void Start () {

myGrid.onCenter = knowWhatIsCentered;
}

// Update is called once per frame
void Update () {
}
}[/size]

I'm a complete scripting n00b and the above is mostly copied, but it is working as intended. I attach this script to a GameObject and fill the Public field "My Grid" with the NGUI Scroll grid object. I then populate the other fields with the grid objects. All of this part works.


I've noticed the FSM state "Get and Convert Grid Value" doesn't pulse green when I click on the scroller. The debug console updates with the correct values, but my data isn't getting into PM.

edit: Forgot to mention that the NGUI Label , irrespective of my scroller selection, sits on 0.

I'd appreciate some help. Thanks.

11
Playmaker Help / Re: NGUI On Drop Question
« on: December 05, 2017, 01:42:32 AM »
My error. Upon reinstalling the lot, it all shows up.

Have a nice day  8)

12
Playmaker Help / NGUI On Drop Question [SOLVED]
« on: December 04, 2017, 03:17:33 AM »
Hi. I've been reading the forums and the admin do a great job here.

In relation to NGUI, I've installed the Eco package and come across something strange. I'm following these instructions, posted by Jean a while ago:

Quote
1: open the ngui example11 scene
2: select the gameObject 3D/Stage/DragDropSurface
3: add the component "NGuiEventsToPlaymakerFsmEvents" to it
4: add a Fsm component to DragDropSurface as well
5: in the fsm, add a state with a global transition "NGUI / ON DROP" ( all ngui events are available in the transition menu under "global events"
6: double check that in the NGuiEventsToPlaymakerFsmEvents, the Drop entry turned green, this means, we have detected that you are actually implement the "NGUI / ON DROP" event.
7: run the scene, drop something onto the cube, and the fsm will receive the drop event.

Now, if you ae building a scene from scratch, it could simply be that you don't set up ngui properly to being with.
-- also, you may think that the gameobject you have adde the component NGuiEventsToPlaymakerFsmEvents received drop events, but actually doesn't, that's something you will need to verify outside playmaker

environment, like dropping a simply script that listen to drop events ( very much like "DragDropSurface" script provided in the example 11 scene.
[/size]

My problem is that the NGUI On Drop transition does not show up when I attempt to add it to the state. I can add various others, such as On Click, which then results in the Click entry turning green.

Is there a reason On Drop is not appearing?

Thanks kindly.

Pages: [1]