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"

String to Enum blueprint

Hello,

is it possible to select from a String an enum, so that I give a String and get an enum in blueprint?

Thanks. Jojii.

Product Version: UE 4.10
Tags:
more ▼

asked Mar 12 '16 at 01:00 PM in Using UE4

avatar image

Jojii
41 11 11 16

avatar image giffen Oct 06 '16 at 03:10 PM

alt text

This is how I did it, but it requires a new function for each enum.

string to enum.png (155.3 kB)
avatar image Xenon2112 Jun 09 '18 at 08:29 PM

This is my solution. It's a bit clumsy, but it gets the job done, allowing you to reference thereafter and use Enum-based switches. I'm just going to change it around a bit to tell me if it can't find one of the enum entries to match the name.alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You could try Set Value as Enum, but I'm not sure it has the same properties as if you were to parse a string as an enum. Otherwise, if you know C++ it wouldn't be too hard to write a function that could parse enums.

alt text

capture.png (52.9 kB)
more ▼

answered Mar 12 '16 at 01:18 PM

avatar image

Sentura
415 32 9 27

avatar image Jojii Mar 12 '16 at 02:56 PM

I know programmlanuages like java and so on, I know the basics of C++, but I can't programm this in UE4

avatar image Sentura Mar 12 '16 at 07:09 PM

Have you at least tried to use Set Value as Enum?

avatar image Jojii Mar 12 '16 at 10:06 PM

I don't use Blackboards or Behaivour Trees, or does this not matter?

avatar image Sentura Mar 13 '16 at 01:11 AM

Right - my bad. It may be that you could hack a parse if you had a blackboard component and used the function, but otherwise I don't think it's plausible to do in blueprints.

avatar image Jojii Mar 13 '16 at 10:19 AM

Ok, do you have any idea, how to do this in C++ or do you know a good tutorial, which include things like these?

avatar image Sentura Mar 13 '16 at 10:21 AM
avatar image Jojii Mar 13 '16 at 10:22 AM

thanks. :)

avatar image Sentura Mar 13 '16 at 10:25 AM

If you feel that this has answered your question, please mark the question as answered.Thanks! =)

avatar image Jojii Mar 13 '16 at 10:23 AM

Do you have so good answers, on my other questions, which nobody answers?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Bit late to the party, but this works for me.

alt text

more ▼

answered Jun 19 '18 at 06:31 PM

avatar image

Wobbleyheadedbob
68 6 9 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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