Skip to content

A simple plugin that adds additionial blueprint switch statement nodes

License

Notifications You must be signed in to change notification settings

Amir-BK/ExtraBlueprintSwitchStatements

Repository files navigation

image

image

image

image

Switch on Int array (allows switching on an arbitrary collection of ints rather than consecutive ints as with the default switch on int node):

image

Custom blueprint nodes which inherit from K2Node_Switch and extend it.

K2Node_Switch creates a map of 'boolterms' that map between the output execution pins and functions that can be evaluated to a boolean, when the default node is shown and connected all other statements need to be evaluated, only if they return false will the default fire. The inner working of the K2Node_Switch are a bit confusing but the various examples in this repo should be helpful, essentially the BP compiler 'collects' the value assosciated with the pin through the 'GetTextForExport' methods we return a string from which the compiler can reconstruct our desired variable, as the comparator method itself needs to be static we use this string to pass on 'extra data' such as the tolerance in the float functions, etc, any function that can be made static and can return a bool can be used to create a blueprint switch statement.

About

A simple plugin that adds additionial blueprint switch statement nodes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published