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"

[BUG][C++]Horrible Enum bug

Hello,

I ran into nasty behavior. I have a C++ Enum which is declared like this (shortened version):

 UENUM(BlueprintType)
 enum class ActorStatesEnum : uint8
 {
     WALK UMETA(DisplayName = "Walk"),
     RUN UMETA(DisplayName = "Run"),
     NONINTERACTIVE UMETA(DisplayName = "Noninteractive"),
     EYETURNER UMETA(DisplayName = "Eye Turner")
 };

I also have C++ method for switching Actor states by providing this Enum members

I've created many blueprints implementing different behavior switches and it all worked till the moment when I added new member to this Enum. At that point every single Blueprint utilising this enum got broken.

So given the fact that this is a bug since 4.6 I believe, what is the recommended way? To use strings in Blueprints and than convert them into enum in C++ static method of my class?

Or am I missing something obvious?

Thanks! Jan

Product Version: UE 4.10
Tags:
more ▼

asked Jan 09 '16 at 05:29 PM in C++ Programming

avatar image

metamorphium
107 8 13 23

avatar image Jamie Dale STAFF Jan 09 '16 at 05:38 PM

Which was the new entry you added?

avatar image metamorphium Jan 09 '16 at 05:40 PM

Thank you!

The current version is:

 UENUM(BlueprintType)
     enum class ActorStatesEnum : uint8
     {
         WALK UMETA(DisplayName = "Walk"),
         RUN UMETA(DisplayName = "Run"),
         NONINTERACTIVE UMETA(DisplayName = "Noninteractive"),
         EYETURNER UMETA(DisplayName = "Eye Turner"),
         STYLUSCONTROL UMETA(DisplayName = "Stylus control")
     };

Also the method handling the switch is:

 UFUNCTION(BlueprintCallable, Category = "Functional")
     void SwitchActorState(ActorStatesEnum newState);




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

1 answer: sort voted first
more ▼

answered Mar 02 '17 at 01:38 AM

avatar image

CanadianGuy43
24 1 4 5

(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