Announcement

Collapse
No announcement yet.

Large useful blueprint function library (Morepork Games)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Large useful blueprint function library (Morepork Games)


    (Updated 2017-06-09)

    Hello,

    Been far to uninvolved with the community so far, so wanted to share my fairly large and (imo) useful set of Blueprint functions and macros.

    They come "as is, where is" - by that I mean: I just made functions when I needed them or found myself doing the same thing a lot. So some may be useful, some may be a bit useless, some are lacking fail-safes, and of course there could be bugs (but I'm using most of them in a game I intend to ship within 3 months, so hopefully not).

    I've tried to give them all descriptions though, and also categorized them in the same categories they would be in if they were standard Epic functions (though they are all grouped under "MPG" to keep them clearly separate). I've also tried to make them as performant as possible.

    My personal favourites / ones I use a lot: RandomIntegerByChance, SortFloatArray/SortIntArray, Get Random Element (Array), ForEachLoopReverse, Do N & Notify, Platform Switch, GetDistance, GetFurthestOrClosestLocation, IsObjectOnScreen, GetAllActorsWithTag, V2_Lerp, RoundToMultiple

    I will endeavour to update this post if I have a significant update to the library, but don't expect too much action.

    Hope they are useful to some Please don't distribute modified versions.

    ------------------------------------

    Morepork Blueprint Functions

    Author: Cory Spooner (Morepork Games)
    Twitter: @TheRealSpoonDog
    Website: www.moreporkgames.com
    Last update: 2016-07-05 (UE4.12.4)

    These blueprint functions are free to use in any commercial or non-commercial project, but I'd appreciate a mention if you do!

    The pack contains 185 functions and macros, within 4 files - MoreporkFunctions, MoreporkMacros, MoreporkMacrosActor (some macros had to be in an actor class to use certain nodes), and MoreporkUMGFade (used by a fade macro).

    EDIT: Get latest download 4.22 version here

    Download old/original version here


    Update 2: (44 new nodes)

    Added:
    Branch To Bool - Converts two execution branches to a bool
    ClampColor - Clamps a color (per element)
    ClampRotatorPerElement - Clamps each element of a Vector individually between a minimum and maximum.
    CycleInt - Increments an int if it is still below max, else it will reset it to min
    Delay While - Delays as long as the condition is true. Useful where you're not sure how long to delay because of random startup timing
    FindTagInActors - Returns all actors in the given array that have the given actor tag.
    ForEach Material - Does a loop for each material present on the given primitive. Useful for e.g. creating a dynamic instance of all materials on a mesh.
    ForEachLoop Wait - Same as a regular ForEachLoop, except it will only execute each loop when triggered. Good for when you want to do latent actions in the loop body e.g. stream levels
    ForLoopWait - Same as a regular ForLoop, except it will only execute each loop when triggered. Good for when you want to do latent actions in the loop body e.g. stream levels
    Frame Delay - Delays for a certain number of frames.
    Get Random Element (Copy) - Simple version of Get Random Element for arrays
    Get Random Element (Ref) - Simple version of Get Random Element for arrays
    Get_ALL_WidgetChildren - Gets all the child widgets of the given widget (recursively i.e. including children of children).
    GetAllActorsRenderable - Slightly presumptuous function that gets all actors that have a mesh or particle system component in them. Could be added to.
    GetDistFromScreenCenter - Returns a 0 to 1 value representing the player's distance from the center of the screen (0 is exact center, 1 is edge of screen)
    GetWidgetChildren - Gets all the DIRECT child widgets of the given widget.
    IntToChar - Converts a 0-255 value to it's ASCII character equivalent
    Is Empty - Branches depending on whether the array is empty or not
    LocalVariable_(String) - Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Transform) - Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocationIsWithinVolume - Returns whether the given location is inside a volume of the given class. NOTE: Will not work if the volume isn't of the "WorldDynamic" object type.
    Max_(Vector) - Returns the maximum value of A and B (the return value is calculated per element, NOT on vector length i.e. Max(A.X,B.X), Max(A.Y,B.Y), Max(A.Z,B.Z) )
    MaxOfByteArray_(Impure) - Returns the maximum value of a byte array, and the value's index
    MaxOrMinOfStringArray - Finds the max or min of a string array (alphabetically) - this is fairly presumptuous and limited, but it's enough to sort a list of strings (e.g. server or player names) in a rudimentary fashion that 99% of people would accept.
    Min_(Vector) - Returns the minimum value of A and B (the return value is calculated per element, NOT on vector length i.e. Min(A.X,B.X), Min(A.Y,B.Y), Min(A.Z,B.Z) )
    More Than X Players - Whether there are more than the given amount of players currently connected.
    NameCompare - Compares two names
    Random Int (No Repeat) - Gives a *brand new* value in the given range each time i.e. no repeats until all values are used or the macro is reset manually
    RandomColorInRange - Returns a random color within the given range. It simply picks a value for each individual element.
    RandomRotatorInRange - Generate a random rotation between min and max
    RandomString - Generates a random string of ASCII characters, of the given length. If ValidChars is empty, then all chars are valid (from 32-127 only).
    RandomVectorInRange - Generate a random vector between min and max (works per component, good for e.g. random scale)
    RemoveAllPlayerWidgets - Removes ALL current user widgets
    Set Level Visibility - Sets the visibility of a streaming level
    SetMaterialQualityLevel - Sets r.MaterialQualityLevel at runtime. 0 = Low, 1 = High, 2 = Medium
    SetScreenResolution - Sets the screen resolution (via console command). If Resolution is empty then it will just set the fullscreen mode.
    SetVsyncEnabled - Sets vsync enabled or not, along with max frames per second (via console command)
    SnapRotatorToDegrees - Snaps a rotator to a certain amount of degrees, on all axis. Only supports whole numbers.
    SortFloatArray - Sorts an array by value. The "Order" output is an array of the original indices in the new order (you can use it to e.g. make another array match the new order of the one you just sorted)
    SortIntArray - Sorts an array by value. The "Order" output is an array of the original indices in the new order (you can use it to e.g. make another array match the new order of the one you just sorted)
    SortStringArray - Sorts a string array alphabetically or reverse-alphabetically. The "Order" output is an array of the original indices in the new order (you can use it to e.g. make another array match the new order of the one you just sorted)
    Stream Level If Valid - Stream levels in and out with automatic validity checking
    StripChars - Strips the given chars from the given string. If "Except" is ticked, then it strips everything BUT the given chars.
    Wait Gate - Will fire the "Condition Met" output once the input has been fired the amount of times specified by "Condition". If "Once Only" is checked, then successive fires are ignored. Unnamed output pin fires regardless.

    Updated: (others were updated too for performance etc but these have added functionality)
    SortFloatArray - Sorts an array by value. The "Order" output is an array of the original indices in the new order (you can use it to e.g. make another array match the new order of the one you just sorted)
    SortIntArray - Sorts an array by value. The "Order" output is an array of the original indices in the new order (you can use it to e.g. make another array match the new order of the one you just sorted)

    Removed:
    AppendAndSetString - Annoyingly appears before the common "Append" node when typing
    GetAllActorsWithTag - There is an official epic one now
    GetLocalPlayerController_(Client) - Unnecessary (GetPlayerController(0) does the same thing
    GetPlayerStateByPlayerIndex - Misleading
    MaxOfFloatArray_(Impure) - Slower than the built-in node
    MaxOfIntArray_(Impure) - Slower than the built-in node
    MinOfFloatArray_(Impure) - Slower than the built-in node
    MinOfIntArray_(Impure) - Slower than the built-in node
    Set Array Element - The official epic one got fixed


    Update 1: (18 new functions and 1 macro)

    GetCurveFloatValue - Same as "Get Float Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveVectorValue - Same as "Get Vector Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveLinearColorValue - Same as "Get Linear Color Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveTimeRange - Same as "Get Time Range", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveValueRange - Same as "Get Value Range", except it allows you to specify the curve asset instead of having to assign it to a variable first.

    RoundFloatDecimals - Rounds a float to the specified number of decimal places e.g. 56.7857 rounded to 2 decimal places would becomes 56.79
    Switch Is Server - The "Server" output is fired if the world that the calling object is from is on the host. Otherwise, the client output is fired.
    ArrayToString_(String) - Converts an array of values to a string so you can easily print the array to the log.
    GetAspectRatio - Gets the current screen aspect ratio (requires small delay after BeginPlay because viewport size has a delay before it is initialized)
    GetScreenScale - Gets the scale of the current screen, relative to a base resolution. Useful for UI scaling (requires small delay after BeginPlay because viewport size has a delay before it is initialized)

    HasScalarParameter - Returns true if the given Material Instance has a parameter with the specified name.
    HasTextureParameter - Returns true if the given Material Instance has a parameter with the specified name.
    HasVectorParameter - Returns true if the given Material Instance has a parameter with the specified name.

    SelectName - If Pick A is True, A is returned, otherwise B is
    SelectParticleSystem - If Pick A is True, A is returned, otherwise B is
    SelectSound - If Pick A is True, A is returned, otherwise B is
    SelectText - If Pick A is True, A is returned, otherwise B is
    SelectVector2D - If Pick A is True, A is returned, otherwise B is

    LocalVariable_(Vector2D) - Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.


    Full Descriptions: (Split across two posts due to image count limit - lots of nodes are missing from this list because I couldn't be bothered taking pics of them any more)
    GetBoundsCornerLocations Returns an array of locations representing the corners of a bounding box (use with Get Bounds).
    TraceToGround Convenience function to do a typical ground trace. Will start from Actor if one is supplied, else it will start from the given Location.
    IsActorOverlapping Returns true if the given actor is overlapping any other actors (which you can optionally filter with "Class Filter"), along with the actors it overlapped, if any.
    GetLargestPrimitive Returns the largest component from the given actor. If CollidingOnly is True then it will only compare colliding components. Bounds are used to determine the largest.
    ComponentHasCollisionType Returns true if the given primitive component has the given collision type.
    GetArrayOf_ObjectTypes Returns an array with all of the possible EObjectTypeQuery. Useful if you want to do a trace against all types of things.
    SetCollisionEnabledAll Sets collision enabled type for all primitive components on the given actor.
    IsWithinBounds Returns true if the object or location is within the given bounds. Unticking "completely" means it only has to be partially within the bounds. If Actor is passed in, it will use that, else it will use the component if one is given, else it will check if the given Location is in the bounds. "Actor Use Colliding Only" means it will only use colliding components on the given actor when checking.
    DestroyAllChildComponents Destroys all child components of the given component.
    Component Has Tag Fires output depending on if the given component has the given tag or not.
    GetFloatParameterValue Gets a parameter value from a particle system. ONLY WORKS IF the parameter was initially added as an INSTANCE PARAMETER (can't just get any parameter from a particle system apparently).
    GetVectorParameterValue Gets a parameter value from a particle system. ONLY WORKS IF the parameter was initially added as an INSTANCE PARAMETER (can't just get any parameter from a particle system apparently).
    SpawnActorsFromClass_(Multiple) Same as SpawnActor, except you can specify how many you want to spawn at once.
    GetCameraTransform Gets the transform of the player camera. If PlayerIndex is > -1, it will attempt to get camera for the specified Player Index, else it will get the camera for the local player
    GetPlayerControllerFromPlayerState Gets the player controller associated with the given player state.
    GetPlayerStateByPlayerIndex Gets the player state for a particular player index
    GetLocalPlayerController_(Client) Gets the player controller for the local machine.
    ForEach PlayerState Executes the loop for each player state in the game.
    ForEach PlayerController Executes the loop for each player controller in the game (on the local machine).
    GetCurveFloatValue Same as "Get Float Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveVectorValue Same as "Get Vector Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveLinearColorValue Same as "Get Linear Color Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveTimeRange Same as "Get Time Range", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    GetCurveValueRange Same as "Get Value Range", except it allows you to specify the curve asset instead of having to assign it to a variable first.
    Byte Compare Compares two bytes (or enums).
    AddAndSetFloat Convenience function that adds a value to a variable and SETS the variable to the resulting value.
    RoundToMultiple Rounds a float to nearest multiple of int
    FInterp Pulse Interpolate between A and B, applying a sine function (so interpolating between 0 and 1, an Alpha of 0.0 will give 0.0, an Alpha of 0.5 will give 1.0, and an Alpha of 1.0 will give 0.0). Effectively a pulse.
    FInterpStepped Interpolate between A and B in a "stepped" fashion.
    TruncateToMultiple Truncates a float to nearest multiple of int
    MaxOfFloatArray_(Impure) "Impure" version of MaxOfFloatArray, so if you use the value twice in a function it doesn't calculate it every time.
    MinOfFloatArray_(Impure) "Impure" version of MinOfFloatArray, so if you use the value twice in a function it doesn't calculate it every time.
    GetFloatRange Given an array of ranges and a value, returns the range that the value is in e.g. if range<0> is 7 and the value is < 7, it will be in that range.
    TotalOfFloatArray Gives the total value of an array of floats.
    Float Compare Compares two floats (just a cleaner version of "Compare Float").
    RoundFloatDecimals Rounds a float to the specified number of decimal places e.g. 56.7857 rounded to 2 decimal places would becomes 56.79
    ExtendLine Extends a given line and returns the new line endpoint. Line extends by the distance given (in world units), or if LineMultiply is > 0, it will *instead* multiply the current line length.
    AddAndSetInt Convenience function that adds a value to a variable and SETS the variable to the resulting value.
    TotalOfIntArray Gives the total value of an array of integers.
    MaxOfIntArray_(Impure) "Impure" version of MaxOfIntArray, so if you use the value twice in a function it doesn't calculate it every time.
    MinOfIntArray_(Impure) "Impure" version of MinOfIntArray, so if you use the value twice in a function it doesn't calculate it every time.
    GetIntRange Given an array of ranges and a value, returns the range that the value is in e.g. if range<0> is 7 and the value is < 7, it will be in that range.
    Int_/_Int_(ReturnFloat) Returns a float value of A divided by B.
    MapRange_(Int) Returns Value mapped from one range into another. (e.g. 20 normalized from the range 10->50 to 20->40 would result in 25). If "Clamp" is checked, Value is clamped to the input range. If "Truncate" is checked, value is truncated instead of rounding (cheaper).
    Int Compare Compares two integers (just a cleaner version of "Compare Int").
    V2_InterpTo Same as VInterp To except for Vector2
    V2_InterpToConstant Same as VInterp To Constant except for Vector2
    BlendVector Same as the standard Ease function, except it exposes the Exponent and Steps in case the ease type is not constant.
    BlendFloat Same as the standard Ease function, except it exposes the Exponent and Steps in case the ease type is not constant.
    BlendColor Same as the standard Ease function, except it exposes the Exponent and Steps in case the ease type is not constant.
    BlendVector2D Same as the standard Ease function, except it exposes the Exponent and Steps in case the ease type is not constant.
    RandomIntegerByChance Generates a random integer, biased by the input Chances array e.g. if Chances<1> is 1 and Chances<2> is 10, then the output is 10x more likely to be 2. If seed is left at -1, it uses a random seed each time. Returns -1 if invalid chances passed in.
    RandomFloatInRange_(Impure) "Impure" version of RandomFloatInRange, so if you use the value twice in a function it doesn't calculate it every time.
    RandomBoolByChance Gives a random bool based on the chance specified e.g. if True_Chances is 1 and False_Chances is 10, the result is 10x more likely to be false.
    FindLookAtRotation_(YawOnly) Same as "Find Look at Rotation" except ignores the Z position of the start/target. Essentially this is a "Find 2D Look at Rotation" (top-down).
    VectorIsNull Returns true if the vector is exactly 0,0,0. Like "Equal (Vector)" except without a tolerance, must be exactly 0.0.
    VectorIsNegative Returns true if the TOTAL OF THE COMPONENTS of a vector is less than zero (not the length of the vector)
    Absolute_(Vector) Returns the absolute (positive) value of A
    AddAndSetVector Convenience function that adds a value to a variable and SETS the variable to the resulting value.
    GetMaxElementIndex Returns the index of the AXIS with the highest value
    ClampVectorPerElement Clamps each element of a Vector individually between a minimum and maximum.
    Vector Compare Compares the length/magnitude of two vectors.
    Direction Compare Compares two directions, with a tolerance value (1.0 is exactly the same direction, -1.0 is exactly the opposite direction, 0.0 is perpedicular). Also outputs what the result was.
    Equal_(Vector2D) Returns true if A is equal to B
    vector2d_*_vector2d Returns A multiplied by B
    vector2d_/_vector2d Returns A divided by B
    V2_Lerp Same as Lerp (Vector) except for Vector 2D.
    Absolute_(Vector2D) Returns the absolute (positive) value of A
    ClampVector2D_Size Clamps a Vector 2D between a minimum and maximum LENGTH.
    ClampVector2D_PerElement Clamps each element of a Vector 2D individually between a minimum and maximum.
    Vector2D Compare Compares the length/magnitude of two vector 2Ds.
    SelectVector2D If Pick A is True, A is returned, otherwise B is
    Switch Is Server The "Server" output is fired if the world that the calling object is from is on the host. Otherwise, the client output is fired.
    SetSimulatePhysicsAll Sets "simulate physics" for all primitive components on the given actor.
    SetActorPhysicsEnabled Sets all "physics" (collision AND physics simulation) on or off for all primitives on the given actor (and sets collision on the actor itself, too). If input is false, CollisionTypeIfEnabling is ignored and collision is turned off. If you ONLY want to set physics simulation and leave collision as it is (or vice versa), use SetCollisionEnabledAll or SetSimulatePhysicsAll.
    GetPhysicsTotalMovementAmount Gets the magnitude of the component's linear AND angular velocity. Useful in situations when you're checking for any movement before doing something.
    GetDynamicMaterial Gets the MaterialInstanceDynamic assigned to the given component, if it has one
    HasScalarParameter Returns true if the given Material Instance has a parameter with the specified name.
    HasTextureParameter Returns true if the given Material Instance has a parameter with the specified name.
    HasVectorParameter Returns true if the given Material Instance has a parameter with the specified name.
    CreateAndAddWidget Creates a widget of the specified class and adds it to the viewport.
    Toggle Widget Toggles a widget's enabled status AND it's visibility
    Last edited by Spoondog; 04-05-2019, 08:03 PM.
    Dev Blog
    Twitter: @TheRealSpoonDog
    150 FREE Blueprint functions for your project

    #2
    Continued from first post:

    GetFurthestOrClosestLocation Returns the furthest or closest location from a given array of locations. Will return the furthest unless "UseClosest" is true.
    GetDistance Gets the distance between two world locations. Check "Squared" for cheaper version that returns the distance squared (skips doing the square root).
    GetFurthestOrClosestActor Returns the furthest or closest actor from a given array of locations or actors. Will return the furthest unless "UseClosest" is true.
    NormalizedScreenToWorldLocation_(Typical) Converts normalized (0 to 1) screen coordinates to a 3D world location, tracing against static world geometry. WARNING, requires a small delay at level start, because the viewport size doesn't get initialized straight away.
    WorldToNormalizedScreenLocation Converts a world location to a normalized (0-1) screen location.
    IsObjectOnScreen Returns whether the actor or component is currently on screen (uses actor if one is passed in, otherwise uses component). By default it only returns true if the objects bounds are *completely* on screen, uncheck "Completely" to change this.
    GetFurthestOrClosestLocationToScreenCenter From a set of locations, gets the one that is furthest (or closest, if ticked) to the centre of the screen.
    FindClosestLocationBetween Get the closest point between the given points A and B, to the given location. Outputs the closest location found and a 0-1 value that represents where between the two points it was found (0 is closer to A, 1 is closer to B). Higher Accuracy values produce better results but can be a lot more expensive.
    GetAllActorsOfSeveralClasses Like "Get All Actors Of Class" except will take multiple classes.
    GetAllActorsWithTag Gets all actors with the specified Actor Tag (not component tag). Can be optionally filtered to make it cheaper.
    GetAllActorsWithCollisionType Gets all actors with the specified Collision Type. Can be optionally filtered to make it cheaper.
    Alpha Over Time Interpolates from 0 to 1, over the time given. Useful for interpolating a value, especially where timelines aren't possible. Requires Tick to be hooked up to the tick function in the class you are using it.
    Alpha Pulse Over Time Interpolates from 0 to 1 and back to 0 again, over the time given. Useful for pulsing a value, especially where timelines aren't possible. Requires Tick to be hooked up to the tick function in the class you are using it.
    Fade Fades the screen to or from a color over the time specified, with several options.
    Loop Counter Useful for counting iterations in a loop. Trigger to increment the count.
    Alpha Over Time Auto Tick Interpolates from 0 to 1, over the time given. Useful for interpolating a value, especially where timelines aren't possible.
    Alpha Pulse Over Time Auto Tick Interpolates from 0 to 1 and back to 0 again, over the time given. Useful for pulsing a value, especially where timelines aren't possible.
    Fade With Notification Same as "Fade" in MoreporkMacros, except gives notification when the fade is started / stopped / paused / finished.
    SelectParticleSystem If Pick A is True, A is returned, otherwise B is
    SelectSound If Pick A is True, A is returned, otherwise B is


    SortFloatArray Sorts an array by value
    SortIntArray Sorts an array by value
    Array Length Compare Compares the length of two arrays.
    Get Latest Item Gets the last entry in an array.
    Item Is Latest Returns whether the array item is the latest in the array. If Index is -1, it will use the supplied item, else it will return whether the index is the latest.
    Array Replace Similar to "Set Array Elem" (actually I can't remember what the difference is, but it made sense at the time).
    Array Length Int Compare Compares the length of an array with the specified value.
    Conditional Get Gets an array value at the given index, but only attempts to if the index is within the bounds of the array (else returns 0 and fires the Failed output).
    Array Item Exists Fires the "True" output if the item exists in the array.
    Set Array Element Same as "Set Array Elem" except it will not trigger an array out of bounds warning (warning shouldn't fire because array is expanded to fit)
    Get Random Element Gets a random element from the array. If "Unique" is checked, then it will not pick the same element twice (unless the "Reset" input is triggered).
    Get Random Elements (Multiple) Gets the specified number of elements randomly from the array (will not pick the same element twice in the same execution).
    Remove Items (Multiple) Removes multiple items from an array at once.
    Add (Multiple) Adds multiple items to an array at once.
    Add Unique (Multiple) Adds multiple items to an array at once - only adds an item if it is unique.
    Set Array Length Expands or shrinks an array to the specified length


    Bool Compare Compares two bools.
    Select Bool Selects A or B depending on the value of "Select A" (same as Select Float, Select Int, etc).


    ClassCompare Compares two classes.


    ForEachLoopReverse Same as ForEach except in reverse. Essential if you are going through an array and deleting things (with a normal ForEach loop, deleting array entries duing the loop would cause entries to be missed).
    Do N & Notify Same as "Do N" except it will fire the "N Hit" pin if it hits N
    Platform Switch Fires output pin depending on what platform the game is currently running on.
    Branch By Chance Branches based on the chance specified e.g. if A is 1 and B Chance is 10, the result is 10x more likely to be B.


    AppendToName Adds a suffix and/or prefix to a Name.
    SelectName If Pick A is True, A is returned, otherwise B is


    Object Compare Compares two objects


    IntToStringWithSign Converts an integer to string, with + prepended if the int is positive.
    AppendAndSetString Adds a prefix and/or suffix to a string AND SETS the String variable.
    IntToStringMinDigits Converts an integer to a string with a minimum number of digits (e.g. 1 with min digits 3 would give a string "001".
    ArrayToString_(Integer) Converts an array of values to a string so you can easily print the array to the log.
    ArrayToString_(Float) Converts an array of values to a string so you can easily print the array to the log.
    String Compare Compares two strings, outputs == if it matches exactly (including case), outputs ~= if it matched with different case, or != if it didn't match at all.
    String Compare Converts an array of values to a string so you can easily print the array to the log.


    SelectText If Pick A is True, A is returned, otherwise B is


    GetWorldTransformWithoutScale Gets a scene component world transform without the scale (i.e. leaves scale at 1.0, 1.0, 1.0)
    GetActorVelocity_(Local) Gets the velocity of an actor, transformed to local space, optionally normalized.
    GetComponentVelocity_(Local) Gets the velocity of a component, transformed to local space, optionally normalized.
    Compare Actor Distance Compares the distance between two actors, against the given distance.


    LocalVariable_(Vector) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Rotator) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Integer) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Actor) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Component) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Float) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Bool) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
    LocalVariable_(Vector2D) Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.


    GetAspectRatio Gets the current screen aspect ratio (requires small delay after BeginPlay because viewport size has a delay before it is initialized)
    GetScreenScale Gets the scale of the current screen, relative to a base resolution. Useful for UI scaling (requires small delay after BeginPlay because viewport size has a delay before it is initialized)
    Last edited by Spoondog; 07-04-2016, 07:51 PM. Reason: Added descriptions for functions in update 1
    Dev Blog
    Twitter: @TheRealSpoonDog
    150 FREE Blueprint functions for your project

    Comment


      #3
      P.S. anyone know if there is a way to insert anchors in a post (so I can have a simple TOC / quick jump list at the top)?
      Dev Blog
      Twitter: @TheRealSpoonDog
      150 FREE Blueprint functions for your project

      Comment


        #4
        wow thank you very much! lots of these seem very useful. thanks for the good documentation as well.

        Comment


          #5
          These look very useful, I think I am going to use at least the random one

          Originally posted by Spoondog View Post
          P.S. anyone know if there is a way to insert anchors in a post (so I can have a simple TOC / quick jump list at the top)?
          You may be able to insert HTML code into the post, But IDK.

          Could you post a guideline on how a person is supposed to accredit you?
          Never say Never, Because Never comes too soon. - ryan20fun

          Frames Per Second is NOT a proper performance metric, You should use frame time. You can read this or this as to why.
          (Profiling) Tools: RenderDoc (UE4 Plugin), NVIDIA nSight, AMD GPU PerfStudio, CodeXL
          Good articles/Series: A trip through the Graphics Pipeline 2011

          Comment


            #6
            Awesome!
            That should prove to be a massive time saver
            portfolio/website: www.nelsonmaps.wordpress.com
            follow me on Twitter if you like!

            My UDK game Figure 8 on itch.io

            Comment


              #7
              Thank you very much. Have to look into fade and random
              My small game on IndieDB ****** Beams on Twitter ****** Beams on Steam ****** VideoStuff ****** PictureStuff
              UE brings Math back into my life or i am not sure.

              Comment


                #8
                Thanks, very helpful!
                Noob question: How do I install/add these?

                Comment


                  #9
                  Awesome! I've created few macros as well (Check my profile), they are mostly in your library too.

                  Comment


                    #10
                    Thanks so much this is amazing stuff!

                    Comment


                      #11
                      Thank you very much..! It is cool.

                      Comment


                        #12
                        Originally posted by Link_AJ View Post
                        Thanks, very helpful!
                        Noob question: How do I install/add these?
                        Woops, that might've been a good thing to stick in the ReadMe, I suppose... Just unzip to your project directory, in the "Content" folder (where your maps and other assets are, there is probably already a Blueprints folder there). Load the editor and they should all magically appear

                        Originally posted by ryan20fun View Post
                        Could you post a guideline on how a person is supposed to accredit you?
                        Any kind of mention is fine in your game credits - "thanks to Cory Spooner for Morepork Functions", or just a name under a general thank you's.
                        Last edited by Spoondog; 03-15-2016, 12:58 AM.
                        Dev Blog
                        Twitter: @TheRealSpoonDog
                        150 FREE Blueprint functions for your project

                        Comment


                          #13
                          Just went through all your list.

                          Thank you very much!

                          I'm not sure if I will use them but it certainly gave me the will to create my own base of macro libraries that I'm going to use in every of my projects.
                          [Released] Multiplayer Combat Editor
                          A-RPG Sacred Swords
                          Youtube Tutorials

                          Comment


                            #14
                            Wow, that's an incredible library! Really great!
                            Twitch /unrealalexander| Twitter @UnrealAlexander
                            How to report a bug? | Installation & Setup issues?
                            Call me to a thread by posting this: [MENTION]Alexander Paschall[/MENTION]

                            Comment


                              #15
                              Update 1 Added

                              New update! 18 new functions and 1 new macro. Mostly not too exciting but a couple of useful ones in there, and it's compiled in 4.12.4. Here are the descriptions, and I've updated the full descriptions in first post with pics etc:

                              GetCurveFloatValue - Same as "Get Float Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
                              GetCurveVectorValue - Same as "Get Vector Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
                              GetCurveLinearColorValue - Same as "Get Linear Color Value", except it allows you to specify the curve asset instead of having to assign it to a variable first.
                              GetCurveTimeRange - Same as "Get Time Range", except it allows you to specify the curve asset instead of having to assign it to a variable first.
                              GetCurveValueRange - Same as "Get Value Range", except it allows you to specify the curve asset instead of having to assign it to a variable first.

                              RoundFloatDecimals - Rounds a float to the specified number of decimal places e.g. 56.7857 rounded to 2 decimal places would becomes 56.79
                              Switch Is Server - The "Server" output is fired if the world that the calling object is from is on the host. Otherwise, the client output is fired.
                              ArrayToString_(String) - Converts an array of values to a string so you can easily print the array to the log.
                              GetAspectRatio - Gets the current screen aspect ratio (requires small delay after BeginPlay because viewport size has a delay before it is initialized)
                              GetScreenScale - Gets the scale of the current screen, relative to a base resolution. Useful for UI scaling (requires small delay after BeginPlay because viewport size has a delay before it is initialized)

                              HasScalarParameter - Returns true if the given Material Instance has a parameter with the specified name.
                              HasTextureParameter - Returns true if the given Material Instance has a parameter with the specified name.
                              HasVectorParameter - Returns true if the given Material Instance has a parameter with the specified name.

                              SelectName - If Pick A is True, A is returned, otherwise B is
                              SelectParticleSystem - If Pick A is True, A is returned, otherwise B is
                              SelectSound - If Pick A is True, A is returned, otherwise B is
                              SelectText - If Pick A is True, A is returned, otherwise B is
                              SelectVector2D - If Pick A is True, A is returned, otherwise B is

                              LocalVariable_(Vector2D) - Just allows storing of a "local" variable in the event graph or in a macro, so you can compute something once and use it several times without fear of it changing.
                              Dev Blog
                              Twitter: @TheRealSpoonDog
                              150 FREE Blueprint functions for your project

                              Comment

                              Working...
                              X