How to create a variable from Integer ?
I need to create a variable from Integer , for example : Integer1  , then I want to spawn a variable named 100 . Is there anyway to do that ?
asked May 15 '18 at 12:56 PM in Blueprint Scripting
you could have an array of integers you add your int value to, you could cast the value of your input to string and add it to an array of strings?
Your question is a little unclear though..
answered May 15 '18 at 03:02 PM
I'm not sure I understand what you are trying to do, but I think what you are saying is you want to create an Integer variable and then be able to read the variables value as a string, is that correct?
If so you can do this:
Simply place a Get node into the graph for the Integer, then pull out the wire and type "tostring", the listbox should have "ToString(Int)" selected, then press enter. This creates a Conversion node that will output the value as a string. If you want to store this value as a string variable, right click on the pink dot and select "Promote to Variable", this will create a new string variable and create a Set node for that variable, you just have to name it.
This new string variable will always output the current value of the integer as a string, if the integer value changes, so does the string.
In the image I also created a ToText node as an example, you can convert the integer to pretty much any value type by using the "ToXXX(Int)" format (XXX = variable type, could be float, string, byte, etc).
Hope that helps!
answered May 15 '18 at 04:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here