Download

How does the Enum Variable know what to retreive?

I disected this tutorial:

f3fcba47b69ae90562df33226665e86ae19567bb.jpeg

It is a bit confusing for me how the enum knows what string to return to the print.
I know it is obvious that the set function is meant to set the enum to something before the ‘get’ is done.
Maybe I should see it that it has an extra variable or pointer telling it to prepare for one of the 0-7 settings.

I just played the 15 seconds at the link but the enum is being set by the (floored) float at the Switch on Int event.

I don’t understand what you mean
.

Wait what?

The Enum is set by one of the 7 SET nodes. After one of them is set, the Print node gets called. Since it needs a string, you need to cast/convert the Enum Value
into a string. That is the green/pink block. And the Enum Variable it self is plugged into it.

So what ever the Enum is set to, the Print will get the value of the Enum at the exact moment it is called and convert it into a string.
This should print a number if i’m correct, since an Enum is only a Named numerical series.

0 = North, 1 = NorthEast, or something like that (just check the Enum you created). So if the “Set DirectionEnum = North” is called and then the print string,
it will get the Value of DirectionEnum and, suprise, show “North” or the matching number.

Yes, yes, I know that the Enumerator is being by set by the SET nodes.

I meant that the yaw value (float) of the character is being divided into eights (45) which is then floored (int). This makes it so that if the value of the yaw is <45 it will read as 0, if it’s >45 but < 90 it will become a 1, etc.

Then a switch on int is called with 0-7 hooked up to the SET node for the enumerator. All the set nodes are then linked to a print string command that’s hooked up to a GET node for the enumerated list.

Example: yaw (player rotation) is at 82 (float). 82/45 = 1.82 (float), floor it and it becomes 1 (int). This returns a 1 to the switch on int which, in turn, uses a SET command to tell the enumerator that it’s current value is “NorthEast.” The set command then continues along the EXEC path to the print string node which uses a GET node to print whatever the enumerator is based on everything prior.

Understand?

Here.

I do not take credit for this picture as it isn’t mine and the NW and NE are in the wrong spots

23f1b91a6c22dc95a51a8c9bdd13d0895c4c62c3.png

Never mind I get this now.