playMaker

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

jrush64

  • Playmaker Newbie
  • *
  • Posts: 20
    • View Profile
Need some help on Arrays please[SOLVED]
« on: December 18, 2017, 04: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 20, 2017, 11:15:44 PM by jeanfabre »

krmko

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

omgitstri

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
    • My Prototypes
Re: Need some help on Arrays please
« Reply #2 on: December 19, 2017, 12: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
    • View Profile
Re: Need some help on Arrays please
« Reply #3 on: December 20, 2017, 08: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.