playMaker

Author Topic: Advancing through an array of text objects  (Read 598 times)

humanizer

  • Playmaker Newbie
  • *
  • Posts: 3
Advancing through an array of text objects
« on: December 29, 2022, 05:48:28 PM »
I'm trying to set up a navigation system that activates text/game objects using forward and back buttons. Watched some tutorials and I think I understand, but something isn't working.

Set First Text (see attached images) works, pulling up the initial text. Advancing doesn't. The '>' button triggers the Get Next state, but the screen text doesn't update. Maybe this approach doesn't work with text?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
    • jinxtergames
Re: Advancing through an array of text objects
« Reply #1 on: December 30, 2022, 04:41:16 AM »
Hi.
Array get is always getting a value on index 0
your state is not set as sequence (right click on a empty space in the action window and enable)
if a state is set as sequence, each action will wait for the previous action to fininsh (which you want in this case)
if a state is not set as sequence it will start each state (from top to bottom) but will Not wait for actions to finish to start the next one.

for you state setup :

"Array Lenght" 'Array Lenght Value'
"Int Add" 'Array Lenght Value' -1
"Int Compare" int 1 'index' int 2 'Array Lenght Value' Equal/Greater : FINISHED Event
"Int Add" 'index' +1
"Array Get"  'index'
(other Actions you need)


for previous :

"Int Compare" int 1 'index' int 2 '0' Equal/Less: FINISHED Event
"Int Add" 'index' -1
"Array Get"  'index'
(other Actions you need)

humanizer

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Advancing through an array of text objects
« Reply #2 on: December 30, 2022, 02:47:13 PM »
Yes! Thanks so much for the help! Working now.