x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to create a variable from Integer ?

I need to create a variable from Integer , for example : Integer1 [100] , then I want to spawn a variable named 100 . Is there anyway to do that ? alt textalt text

Product Version: Not Selected
Tags:
help01.png (18.2 kB)
help02.png (17.4 kB)
more ▼

asked May 15 '18 at 12:56 PM in Blueprint Scripting

avatar image

Howard Zheng
1 1

avatar image Nebula Games Inc May 16 '18 at 02:20 PM

You can't "spawn" a variable.....do you mean "display" that number to the screen or something?

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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..

more ▼

answered May 15 '18 at 03:02 PM

avatar image

surfsquid
1

(comments are locked)
10|2000 characters needed characters left

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: alt text

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!

inttostring.jpg (91.5 kB)
more ▼

answered May 15 '18 at 04:52 PM

avatar image

DotCam
3.1k 74 34 147

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question