playMaker

Author Topic: Simon Says with blocks ArrayMaker issue.  (Read 16063 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #15 on: February 20, 2016, 03:31:25 PM »
https://hutonggames.fogbugz.com/default.asp?W329

Seems like a pretty basic example, and that is strictly for scripts you write as oppose to turning scripts into custom playmaker actions right? I'm brainstorming about how I could add things effectively for a game, and I was thinking of ways to add things to simon says scene. For example, ways how to grab objects properly like in this example project video.

http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-jewel-miner-game

Don't know whether or not this is overkill but it's a idea I had.
« Last Edit: February 20, 2016, 03:43:03 PM by coffeeANDsoda »

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #16 on: February 20, 2016, 04:59:51 PM »
Check the API reference in the Manual and the final tutorial in HutongGames youtube playlist.  I've not done any coding, preferring to work in playmaker where possible (and third party assets with playmaker support), so I can't help you here.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #17 on: February 20, 2016, 09:17:11 PM »
So, my final approach... I downloaded the example scene you were working from and made the changes you want (as far as I can tell).  It works perfectly on my end, if it doesn't work properly on your end, then maybe i'm doing something wrong with the export process.

Any State I have changed is highlighted in Orange.

Code: [Select]
SebasController : Sebas Says Controller : Show item : SetFsmGameObject : Could not find variable: go_Cube
UnityEngine.Debug:LogWarning(Object)

Is that why it that console message shows up when send event in the show item stage that is orange doesn't have a send event? It has a Event Target and gameobject variable set up to buttonObj_go.

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #18 on: February 20, 2016, 10:23:28 PM »

Code: [Select]
SebasController : Sebas Says Controller : Show item : SetFsmGameObject : Could not find variable: go_Cube
UnityEngine.Debug:LogWarning(Object)

Is that why it that console message shows up when send event in the show item stage that is orange doesn't have a send event? It has a Event Target and gameobject variable set up to buttonObj_go.

No. That shouldn't be appearing and it certainly shouldn't stop the scene from rinning, but you can go ahead and delete that action (Set FSM Game Object) on the "Show Item" state, and it won't affect anything but will clear the error, that variable isn't called anywhere, I just forgot to remove it.

The important thing is that the Send Event Action in the "Show Item" state, has an event selected, then set up the template fsm like this using a global transition:
https://imgur.com/qsKSgLI

I called the global event "Activate" but you can call it whatever you like.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #19 on: February 23, 2016, 02:30:47 PM »
The important thing is that the Send Event Action in the "Show Item" state, has an event selected, then set up the template fsm like this using a global transition:
https://imgur.com/qsKSgLI

I called the global event "Activate" but you can call it whatever you like.

And it is necessary to make each cube's FSM a template? The manager stays on Bool Test State with the action. I thought it was odd, because I thought it would transition into the small pause state before it goes to watch user input.

Don't really understand why it doesn't want to communicate with activate global.

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #20 on: February 23, 2016, 03:15:17 PM »
It's not necessary to use a template to control the cubes, this is how it was setup in the example before I made the modifications, so I didn't change it. I've actually got very little experience with Templates, so took me a few mins to get my head round the setup... but it does make sense, as all the cubes work in the same way... you get the same result if instead of using a template, you use 4 duplicate FSM's. One on each cube.

Have you got it working now?

1. On the Template, create an Event in the "Events" tab.  Name it Activate, and make sure the checkbox is ticked.

2. Right Click on the "Begin Move" State, and "Add Global transition" called "Activate"

3. In SebasController, on the "Show Item" state, select "Send Event" action, and it asks for an event to send. Set this as "Activate".

I really can't explain it any better than that =/

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #21 on: February 23, 2016, 03:51:47 PM »
For the record, I have experimented with making templates, but they didn't work well.

Have you got it working now?

In send event located in Show Item, I did set it to your modified SebasController example(SimonFinal Scene including scene "Arraylist_03" ), if you mean setting event target to Game Obj FSM, with the buttonObj_Go variable, with the buttons name FSM default name, and Send Event set to a Activate Global Transition (Activate Event is enabled on the checkbox of the button, so it is a Global).

The last state on the button cube with a Set Fsm Bool has a empty local variable that is set to game object right? Empty as well?

I thought I could name the simon says manager a name besides "FSM", therefore I made the manager look like sebazsays a different FSM name. And a bool that is set to false on its Bool Value, and that is local as well. 

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #22 on: February 23, 2016, 04:07:19 PM »

The last state on the button cube with a Set Fsm Bool has a empty local variable that is set to game object right? Empty as well?

No. That should have imported fine =S

That action should be as follows:

Game Object = go_Manager
FSM Name = Sebas Says Controller
Variable Name = Finished
Set Value = True

This is the action that tells the Manager that the animation has finished playing.

go_Manager is a local variable, from the "Setup" state, which finds the "SebasController" Object and stores it.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #23 on: February 23, 2016, 04:27:14 PM »

No. That should have imported fine =S

That action should be as follows:

Game Object = go_Manager
FSM Name = Sebas Says Controller
Variable Name = Finished
Set Value = True

Bare in mind, I recreated the manager with the original sebas disabled as well as template colorbuttons.

I think this is weird though, mouse pick action is suppose to communicate with the buttons and Set Fsm Bool on the button is suppose to my simon says FSM bool. After all the bool located in the manager is set to false and Set Value has the box checked in order to make it a true value right?

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #24 on: February 23, 2016, 04:35:36 PM »
The FSM's on the buttons just control the animation, everything else is controlled in the manager.

In my example, we're not playing the animation of the cube we select, so no, the mouse pick does not interact with the buttons FSM. It just fires a raycast and tests what it hit against the correct button in the pattern.

Yes, the Set FSM Bool on the cubes sets the bool variable to true in the manager, so it can pass the bool test after playing the animation. We then set the bool back to false (In the "Iterate" state) and start over till the pattern is finished playing.

« Last Edit: February 23, 2016, 04:37:23 PM by Chizzler »

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #25 on: February 23, 2016, 04:38:58 PM »
I still get this though. In terms of what the manager does and the button for reference.

https://db.tt/oF9DXpT9

https://db.tt/ceke4YHc

https://db.tt/p82qxOXb

https://db.tt/mWQrkop8


Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #26 on: February 23, 2016, 04:52:46 PM »
You've changed the name of the Manager Game Object.  You need to go into the Start state on the button FSM and update the "Find Game Object" action to find the object with this name.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #27 on: February 23, 2016, 05:11:07 PM »
You've changed the name of the Manager Game Object.  You need to go into the Start state on the button FSM and update the "Find Game Object" action to find the object with this name.

Still the same results. What would that mean for KEY STROKE being a global. Makes me thinking because it isn't included in the button.

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: Simon Says with blocks ArrayMaker issue.
« Reply #28 on: February 23, 2016, 05:23:39 PM »
We're not using "Key Stroke" as a Global anywhere. we're using it as a local transition in the manager (Although there is probably no need too, it's left unchanged from Sebas's example - I changed as little as possible as you're familiar with his from the tutorial video).

When you hit play, head into your variables tab of your Button FSM. does "Test simon says manager" have a game object attached? If it's None. then you've misspelt it in the "Find Game Object" action OR you've applied a tag to it, and are not filtering it in the  "Find Game Object" action.

However, we can actually skip this action entirely if we wanted, and instead drag the "simon says" object from the hierarchy panel into the "Test simon says manager" variable on the buttons, making sure to remove the "Find Game Object" action.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Simon Says with blocks ArrayMaker issue.
« Reply #29 on: February 23, 2016, 05:38:34 PM »
When you hit play, head into your variables tab of your Button FSM. does "Test simon says manager" have a game object attached? If it's None. then you've misspelt it in the "Find Game Object" action OR you've applied a tag to it, and are not filtering it in the  "Find Game Object" action.

Simon says manager is untagged. Checked the name of the managers FSM and the buttons Test simon says manager variable. In runtime for the simon says manager, it does say that Bool Finished bool is true, but it doesn't transition into small pause even if it's set to do so with the DONE! event. I brought up KEY STROKE BEING A GLOBAL regarding mouse button input.