playMaker

Author Topic: [Solved] With Int Switch - can I use "else"?  (Read 2059 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
[Solved] With Int Switch - can I use "else"?
« on: May 12, 2015, 08:00:30 AM »
Hi all,

I often use Int Switch with PlayMaker.

However, if I get a rogue number for my Int variable that is not listed in my Int Switch options... the FSM of course stops there in that state.

Is there a way to easily write "else"?

For Example:
If Int = 1, send event 1
If Int = 2, send event 2
If Int = 3, send event 3
Else, send event 4

I've made workarounds with extra states, but it seems sloppy to me.  I'm wondering what the best practice is.

Thank you!
Createasaurus
« Last Edit: May 12, 2015, 08:44:27 AM by createasaurus »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: With Int Switch - can I use "else"?
« Reply #1 on: May 12, 2015, 08:08:52 AM »
If none of the switches fire then it continues to the next action in the State. You could just add a Send Event if you wanted to fire and Event if none of the switches fire.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: With Int Switch - can I use "else"?
« Reply #2 on: May 12, 2015, 08:44:08 AM »
Thank you Lane!

I was hoping there was a simple solution.

To recap:

First I put Int Switch Action
Then I put Send Event Action

Send Event works as "clean up" taking care of a rogue variable out of the expected Int Switch range.

Thank you again!
« Last Edit: May 12, 2015, 11:59:33 AM by createasaurus »