playMaker

Author Topic: Need some help on Arrays please[SOLVED]  (Read 1685 times)

jrush64

  • Playmaker Newbie
  • *
  • Posts: 20
Need some help on Arrays please[SOLVED]
« on: December 18, 2017, 06:28:17 PM »
Hi,

So I just learned how to use Arrays and its helping.

I'm trying to create a text message system where you press a keyboard button and it displays a message. I have all of them written down and have them as childs to a parent gameobject. the messages are buttons which have text as children.

I want to use 1 fsm to control the messages.

Right now, I'm using an Array variable to manually enter all the message buttons then I use an Array get and store them in another variable.

I then use Array getnext to loop then activate the message with a button press and it works fine.

What I need help with is that instead of manually entering all the values myself, I would like to get them automatically.

I've tried using Get child recursively but that doens't work because it gets everything including the text, instead of just the buttons.
I know i can use get owner in each messages fsm but that would create more fsm's and I would like to use only 1 fsm to manage everything if possible.

Can someone please help? I need to be able to get only the buttons and store them in a variable.

below are pics of my FSM's.









« Last Edit: December 21, 2017, 01:15:44 AM by jeanfabre »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Need some help on Arrays please
« Reply #1 on: December 19, 2017, 02:28:10 AM »
ugh, can you put a bit smaller pictures, i can't get this into context like this.
Available for Playmaker work

omgitstri

  • Playmaker Newbie
  • *
  • Posts: 46
    • My Prototypes
Re: Need some help on Arrays please
« Reply #2 on: December 19, 2017, 02:16:22 PM »
Hello,

Before you go back into the Loop State. You could add a condition check. For example let's say you tag all the buttons to have the tag Button. You can have a check to see whether the tag is "Button" if it's true then you transit over to the Loop State else go back for the Get Next Child
Tri Nguyen
Game Designer at Nvizzio Creations

jrush64

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Need some help on Arrays please
« Reply #3 on: December 20, 2017, 10:24:01 AM »
Hello,

Before you go back into the Loop State. You could add a condition check. For example let's say you tag all the buttons to have the tag Button. You can have a check to see whether the tag is "Button" if it's true then you transit over to the Loop State else go back for the Get Next Child

Thanks. I used that plus ArrayListGetNext. I didn't know there was array list get next.