Announcement

Collapse
No announcement yet.

String separation each letter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    String separation each letter

    Hi all,

    Working hard on my game, I decided to put in an interface, that allows my user to put in words. This is a sort of teaching game (edutainment?) category. Without getting too much into it (although i will be blogging about it this week) I need to take words that the user puts in, and parse them.

    So if they put in the word blue, I need to get the first character, the second, the third, the fourth and use them to build things in the game based on the letters they put in.

    So I will need to grab a class from my library called, CLS_B_SOLID for instance, and if I know that first character I can do that with the append command.

    I had insomnia last night (again) and was thinking my way through this. I used to do this stuff all the time when I worked in VFX, but still feeling my way around UE4, it's been less than a year I've been hunkered down in it trying to transfer all my skills here.

    thanks for any insights.

    #2
    actually I'm moving in the right direction. I found the docs on the string Actions

    https://docs.unrealengine.com/latest...ing/index.html


    I'm currently using the function Left to grab the first letter. I'm still working on this. I want the letters individually, but if I change the count to 2, it gives me the first and second letter, rather than the first letter.

    I then tested LeftChop and RightChop. Dangit. I think this is going to end up being one of those things where i have to chop off the end of the word, and then the start of the word i don't want, to find the character I do.

    Comment


      #3
      I don't have the editor handy so I don't know the exact node names, but try doing a for loop. First index 0, last index the length of the word. The on each loop get substring, the start index being the loop index and the length being 1, then you can shove the character into an array of strings and do what you need to do.
      Procedural, modular, on-the-fly animation - iTween For UE4
      - Actors - Components - UMG - Ease In - Ease Out - Path-constrained Animation - $0

      Runtime Datatable
      -All the fun of DataTables dynamically loaded from text or Google Sheets while your game is running!

      Comment


        #4
        Pretty sure in RAMA's plugin he has some extra string parsing functionality too so you might want to give that a look

        Comment


          #5
          TR8R!

          -----

          This is much easier done in C++ :/
          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

          Comment


            #6
            Get character array from string.

            Comment

            Working...
            X