playMaker

Author Topic: Repetition in FSM's. Is there a simpler way?  (Read 1375 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Repetition in FSM's. Is there a simpler way?
« on: December 23, 2016, 04:29:20 PM »
Out of curiosity, is there a simpler way to do this kind of repetition?

You can't save a string then set an FSM variable by name- it has to be manually selected, it seems.

In the example above, I need to do operations to 12 fsm variables, in order. all that changes here is that a number increments (including the fsm variable name).

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Repetition in FSM's. Is there a simpler way?
« Reply #1 on: December 23, 2016, 04:29:56 PM »
just a number increments each time, until all have been gone through and operated on.

marv

  • Junior Playmaker
  • **
  • Posts: 50
Re: Repetition in FSM's. Is there a simpler way?
« Reply #2 on: December 30, 2016, 09:07:52 AM »
I've moved on from that approach to just store most of my persistent variables in arraymaker arrays and hash tables. As far as I know there's no way to create new variables inside an FSM in runtime. So iterating through variables with an index integer (then int to string + add to the variablename) and getting their values from an array/hash table is the best solution for this imo.

That also makes it easier to save/load with easy save. (you can find arraymaker and actions for easy save/array maker on the ecosystem)
« Last Edit: December 30, 2016, 09:09:26 AM by marv »