playMaker

Author Topic: Array Maker - Array List Get Next and Get Previous issue  (Read 2576 times)

bcmorris

  • Playmaker Newbie
  • *
  • Posts: 9
Array Maker - Array List Get Next and Get Previous issue
« on: January 30, 2015, 07:03:39 AM »
Hello,

I have an "Play Maker Array List Proxy" that I add a set number of game objects manually before runtime. In this FSM it's 2, in another it may have 4 or 6 etc...

I'm using a get key down action to toggle through the array. It works in the middle of the array but...

The problem is that currently I have to press twice to update the game-object variable when going from the end of the "Array List Get Next" to the "Array List Get Previous", or the end of the "Array List Get Previous" to the "Array List Get Next."

Too complicate matters I use "Array List Get" at the beginning of the FSM to get data from the first game-object variable for another purpose so when I start the list I have to use a variable that I reset to zero after the first next loop or I will miss the first click as well. This seems to work but maybe there is a better way?

I have the "Array List Get Next" feeding back into itself the a "Finish parameter" transition so I can cycle past the last index  but the "Array List Get Previous" won't work in the same manner and the "Finish parameter" has to act like the "Loop Parameter" or the "Array List Get Previous" will get stuck. Is this correct?

This is driving me mad, can anyone help me with the logic here?

Thanks in advance, Brian

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Array Maker - Array List Get Next and Get Previous issue
« Reply #1 on: January 30, 2015, 07:21:02 AM »
you may also use a Int variable on wich you'll add or substract 1 when you clic on the button or do the action,
and use it as ID with a 'Array list Get'

bcmorris

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Array Maker - Array List Get Next and Get Previous issue
« Reply #2 on: January 30, 2015, 09:59:56 AM »
you may also use a Int variable on wich you'll add or substract 1 when you clic on the button or do the action,
and use it as ID with a 'Array list Get'

So this is an alternative to using my "reset to zero" to handle the first click problem or does it relate to the main problem of clicking twice? Guess I ask to many questions in the same post :)