How to get a the Suffix of an item?
I am trying to create an achievement system in the game and I want the script to be reusable for all the text so I don't have to manually input it. So I have a Data Table with all the achievement information on it and on my widget I want the text to find the correct row on the data table and display the name of the achievement.
My Data tables are names 00, 01, 02 etc. and my achievement text objects are named Achievement_00, Achievement_01, Achievement_02 etc. I want to create a binding, and in that binding will be a script that will reference the self, get the name of the self. The part I don't know how to do is to get the suffix (the number), which will then call the correct number in the data table.
Any ideas how to get this to work?
Thanks in advance
asked Nov 02 '18 at 06:16 PM in Blueprint Scripting
There is a node that splits a string into an array of strings, breaking it at the character or character sequence you indicate. I think it's called "Split" (which only splits once into two pieces - there's another one called Parse String Into Array or something like that which does it multiple times).
YOu could use the underscore character "_" as your splitter, and then just get array index 1 to grab the suffix number you just split off from the original string.
answered Nov 02 '18 at 06:48 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here