playMaker

Author Topic: Constantly test if an FSM array has changed?  (Read 1095 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Constantly test if an FSM array has changed?
« on: July 17, 2018, 12:50:08 AM »
I need to update the inventory memo list text mesh pro displays.

if you find a new memo paper, it updates that line item to display its title. a list of text files, basically, that you can choose to read. Like in resident evil games.

In an fsm i have a bool array. when you find a memo, it updates that bool to true in the array. if I got memo 8, set bool at index 8 to true.

I can normally get an fsm bool each frame and test to see if it has changed. I am not sure how to "Test Array" each frame to see if its bools have changed.

There's no "if FSM Array Changed" action, and there's no "Test Array Bools" action. So what am I missing? I need to, each frame, check the entire array to see if its bools have changed, and update a text mesh pro if it has changed, to either show or hide the title text for that file in the list.



verybinary

  • Junior Playmaker
  • **
  • Posts: 81
    • The Museum of Digital
Re: Constantly test if an FSM array has changed?
« Reply #1 on: July 17, 2018, 01:33:50 PM »
you could have an FSM that manages this?
set array index 0 as index0
set array index 1 as index1
set array index 2 as index2

check if index0 changed
check if index1 changed
check if index2 changed

or..........................................

when you set index X to true, set a var, somewhere, to something, in the same state and have your read paper FSM look at that var? (this one is probably better in most cases)