Enum newb question


#1

Hello, I’m really liking SK so far!

Sorry if this is a dupe. I’ve managed to hookup Skookum Script to my project which has both C++ and BPs. The C++ side of things are working , as I’ve used the guide here on the forums. However I have an issue on the BP side of things with my Enums.

I have an issue where many of my enums have their initial bit (0) set to
’None’ for example:
image

When sk classes are generated, the classes that use the enums cannot reconcile because ‘none’ is of course a keyword and not a member!
image

Not sure if I should try renaming the properties via +RenameProperties or just update the key in UE4 to be something other than None.

The issue I have with the first option is that some of these are referenced in instance methods:
image

I’m not sure how to construct a Rename string on a Class method using +RenamePropeties.

The second option would be to update them to be something other than None and regenerate the sk. I’m nervous about doing this because I’m not sure if UE4 will go and update all places where the Enum bit is referenced.

Thanks in advance for any advice.


#2

Welcome back!

Glad you are liking Sk.

We’ll take look and get back to you…


#3

Hmm I just tried to reproduce this but it worked fine (I added a value named None to a user defined BP enum, and it correctly produced a value @@none in the Sk class). What version of Sk are you on? Also, what does the class definition (and the class contructor) of EMovementNode look like? Is @@none simply not there or is there some other issue?


#4

Hey Markus , that’s interesting you have it working!

I’m on 3.0.5 Beta … marketplace plugin ,
image

Actually I’m dealing with a ton of stuff here and apologies if my situation is confusing.

My custom Enums generate fine and I’m not seeing any issues after regenerating

The issue appears to be my component which uses EMovementMode in a function called switch_movement: it’s an engine type :
image

As you can see … the Component that uses that Enum in Switch Movement references @@None , but it’s being created as @@Move_none
image
image
I can edit the .sk for this component … but I think I have to unload the plugin , set a default value to something other than none.


#5

Hmm that is odd - the plugin should use the display name for the enum. I’ll have a closer look tomorrow.

Why can’t you simply use @@move_none for now?


#6

Yep, the issue there was that it was this method is readonly, I can edit the sk file, but I was worried it’d get overwritten the next time I regenrated the sk files, as it’s in Project-GeneratedBP.

What’s weird is that I changed the Enum to be a different default value in the BP, regenerated the SK and it still shows up. I’m sure there is way to prevent this!


#7

You could put any additions or changes in your Project overlay which won’t be regenerated.

You can see more about overlays in the online docs.


#8

Awesome! I’ll do that. Thanks for the help!


#9

Note that in this case, you’d have to manually keep the enum in sync with the BP version of it though!


#10

Shouldn’t be a problem!