playMaker

Author Topic: Split apart a string?  (Read 2307 times)

wowdesigner

  • Playmaker Newbie
  • *
  • Posts: 3
Split apart a string?
« on: September 13, 2016, 11:58:53 AM »
I'm having a tough time figuring out how to split a string of text into each individual letter.
Current setup is this...
1) I'm getting words from a text doc
2) Choose a random word from the list
3) Create an array list, to hold the letters I'm about to generate
4) Split the text string into individual letters, using GetStringLeft
5) Place the individual letters into the array I just made

The problem is I can only get it to split the first letter from the text string.  No matter what I've tried.

Any thoughts would be appreciated.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Split apart a string?
« Reply #1 on: September 13, 2016, 07:40:41 PM »
Hi.
There is a custom action called iterate on the Ecosystem
that you can use to loop.

Here is how you can set it up :


wowdesigner

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Split apart a string?
« Reply #2 on: September 13, 2016, 09:22:28 PM »
Thanks for the help.  It's still not going past the first letter, but I'm not giving up yet.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Split apart a string?
« Reply #3 on: September 14, 2016, 04:35:27 AM »
Hi,
This should work.

How are you getting the word?

You can right click on a state to set a breakpoint (pause) for example on the state with the iterate and also turn on debug.

If you can't get it to work, can you show a video with your states / actions ?
or share that part of your project?

wowdesigner

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Split apart a string?
« Reply #4 on: September 14, 2016, 11:48:22 AM »
Thanks for your help Dino,

After some troubleshooting I was able to get it working.

I'm using Split Text To Array List to get my words into the FSM.  Maybe part of the problem I was the document was formatted wrong.  Cant have spaces before the words and each word needs to be on a separate line.

-Ben

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Split apart a string?
« Reply #5 on: September 14, 2016, 12:46:39 PM »
Hi,
I am happy you got it to work  :)