playMaker

Author Topic: FSMs not registering events  (Read 3362 times)

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
FSMs not registering events
« on: June 07, 2017, 06:22:27 PM »
I started a new project and I noticed my FSMs no longer register when I make an event. If I make a trigger event, it doesn't recognize that a transition event must be added to the state after triggering. If I make an Int Compare, it doesn't recognize that the transition events must be added for each condition. No errors pop up, it doesn't tell me that the corresponding events aren't being used, it doesn't ask me if I want to add one, and of course, it doesn't trigger or send the event in question.

Has anyone else experienced this? Any helpful tips?
Thanks in advance

Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: FSMs not registering events
« Reply #1 on: June 08, 2017, 09:18:38 PM »
taking screen shots of your fsms would be helpful

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #2 on: June 09, 2017, 04:46:13 PM »
Thanks for the reply.

Here are some snapshots of the FSMs.

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #3 on: June 09, 2017, 04:50:06 PM »
And this finishes off my Health Manager.

I've had some trouble getting the Trigger Event to work for the Bomb, so I changed it to a Collider Event.

Now I'm having trouble getting the Bomb to respawn once clicked or it hits the Collider at the bottom of the screen and is destroyed.

I'm also having trouble destroying the other two Bombs that drop once you've made a choice (it's a pick 1 out of 3 game).

Any help you could have would be greatly appreciated.

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #4 on: June 09, 2017, 05:28:45 PM »
This is the FSM for the Bomb.


Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: FSMs not registering events
« Reply #5 on: June 09, 2017, 08:33:28 PM »
so far i have'nt seen too much wrong with your fsm setup
1. i would advise that you have your collision or trigger events at the very buttom of all your actions
2. you should ensure that your bomb has a rigid body
3. try to add a wait after spawning new objects before returning back to a state, at least 0.5 seconds would be fine, because in some cases you actually don't spawn anything. especially on mobile
4. click the fixed update toggle for your translate action, it doesn't require your object to have a rigid body but it's used to move static rigid bodies, so set velocity or addforce every frame could be a better option.
5. try to put your destroy self in another state after you spawn exlosion, traditionally it should have a delay option, but you could just add a wait action there.
6. be sure to send global events to a game object with only one fsm

hope this helps, let me know if there was something you didn't understand

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #6 on: June 13, 2017, 01:00:08 PM »
Great! I'll give these a shot and update you.

Thanks!

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #7 on: June 13, 2017, 03:30:05 PM »
With your suggestions I was able to get the Bombs to continue to drop after each set is destroyed, so that's a big fix. So far, these are my results:

- Clicking on a bomb causes it to explode, which is correct.
- Clicking on the winning Bomb takes no damage, which is correct.
- Clicking on the losing Bomb DOES take damege, which is correct.

However, I'm still struggling to get the Bombs that were NOT clicked to explode along with the Bomb that WAS clicked. I want them all to disappear after the player makes a choice.

I'm trying to execute that plan like so:

- I have two Bombs (Bomb Correct) and (Bomb Incorrect).
- I have three Bomb Spawners, Left, Middle, Right.
- One of the Bombs that spawns is Bomb Correct.
- The other two Bombs are Bomb Incorrect.
- The player must click on the right Bomb.
- If the player picks Bomb Correct, I want all the bombs to explode and no damage is given.
- If the player picks Bomb Incorrect, I want all the bombs to explode and the player takes 1 damage point.
- If the player does not choose in time, the Bombs hit the bottom of the screen, the Bombs explode, and the player takes 1 damage point.


Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: FSMs not registering events
« Reply #8 on: June 14, 2017, 12:58:34 PM »
that's a pretty easy setup but it's based on your project and what you're trying to do, i don't exactly know how your fsms are set up, in regards to your points and damage fsms.

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #9 on: June 14, 2017, 08:15:36 PM »
I start with a Global Variable called Health with a Value of 30.

Health = 30

I have two Bomb Prefabs. One is called Bomb Correct, and the other is Bomb Incorrect.

Clicking on Bomb Correct does NOT send a damage +1 event the Health Manager. That part is working correctly.

Clicking on Bomb Incorrect sends a damage +1 event. That is also working.

When you click on a Bomb, it explodes.

What isn't working right now is that after I click on a Bomb Correct, I want the other Bombs to also explode and disappear.

Also, I've set up something called a Question Manager to start the Bombs falling in stages. However, the FSMs are not talking to each other. The event to create object (Bomb Correct and Incorrect) are not being sent.

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: FSMs not registering events
« Reply #10 on: June 14, 2017, 08:16:34 PM »
And this is what the bombs look like now after some of your previous suggestions.