playMaker

Author Topic: Maximum number of EVENTS in a state  (Read 1823 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Maximum number of EVENTS in a state
« on: June 02, 2016, 03:04:32 PM »
I set up a system for my bonuses where a single prefab defines everything by its name.
If I call it in example 0003000, that will be a bonus of 3000 points, and it will spawn the right prefab, and the prefab will do the rest.
I found a problem now though. I have a certain number of these bonuses, more than 20, and the number of possible events in a state seems limited by the size the state can get in the UI.
I added a certain number of events, and it keeps getting them, but they are not visualized past line 16, this last line gets cut in the UI.

Is this to be considered a bug, a limitation, a feature?
Or am I doing it wrong? Is there a better/cleaner way to make this thing clean?

Keep in mind that the bonuses have identified names: there is 0003000, or 0000666 or 0007650. I was setting up case by case with a compare and the string name.
Annoying and dirty work, I know, but once done, I wouldn't have to touch it anymore.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Maximum number of EVENTS in a state
« Reply #1 on: June 02, 2016, 03:36:21 PM »
There's no built in limit to the number of events in a state.
I just tried adding a bunch of events and went past 16.
Can you attach a screenshot of what you're seeing?
What version of Playmaker are you using?

In terms of structure there's probably a cleaner way using either built in Arrays or a Hash Table in ArrayMaker.

For example you could use an integer bonusIndex instead of a name and setup up an array of prefabs that matched the index to the prefab. Use Array Get to get the prefab from the index.

Or if you prefer to keep using the name, you could use Set Event Data to pass the name of the bonus with the "MakeBonus" event. The target state could use an Array Maker HashTable to translate the Name into a prefab reference.

Many options. But your original plan should also work, so I'd like to figure out the issue you're running into...

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Maximum number of EVENTS in a state
« Reply #2 on: June 02, 2016, 04:16:27 PM »
Well, I didn't know I can make an array of objects, maybe that's the most straightforward and clean way to do this.
I will make a video of the issue now so you can understand what I mean.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Maximum number of EVENTS in a state
« Reply #3 on: June 02, 2016, 04:33:01 PM »
Here is the video: https://dl.dropboxusercontent.com/u/858716/SR/bugs/bandicam%202016-06-02%2022-27-40-206.mp4
However, I might have mistaken in calling them EVENTS, they may be called TRANSITIONS... but in the panel they are called EVENTS... thought it was clear though, talking about how many EVENTS can be in one STATE.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Maximum number of EVENTS in a state
« Reply #4 on: June 02, 2016, 05:41:18 PM »
Converted to Array!

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Maximum number of EVENTS in a state
« Reply #5 on: June 02, 2016, 06:02:12 PM »
Lol, love the video, it looked like that fsm was about to get very big.

I have seen that before (i had 30 transitions/events on one state and i think it did something simmilar,) but im pretty sure once i closed unity it was ok again- like i could see all the events. I think it is a bug or something, maybe to do with hardware power, as my laptop is pretty old...

But yeah arraymaker is amazing, once i built up the courage to learn it, i no longer need 30 events lol.

Glad you solved it!

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Maximum number of EVENTS in a state
« Reply #6 on: June 02, 2016, 06:11:24 PM »
Yeah that went pretty easy and straight though.
Only "dirty" thing is that I had to set up two arrays almost identical: one to find the name, so that I could get the index, and then using the index I get the object from the other array.