Announcement

Collapse
No announcement yet.

(39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

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

    44+ Extra BP Nodes For You!

    No c++ required!

    No compile required!

    Download and plug in!



    Rama
    100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

    UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

    Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

    Comment


      Featured Node

      Trace for Closest Socket

      Perform a trace against a mesh that will identify the closest socket to the trace hit location on the mesh!

      Click image for larger version

Name:	picofclosestsocket.jpg
Views:	2
Size:	238.0 KB
ID:	1050478

      Click image for larger version

Name:	traceforcharactermeshsocket.jpg
Views:	3
Size:	297.8 KB
ID:	1050479
      100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

      UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

      Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

      Comment


        Get Current Operating System Time

        annnnd

        Get Milliseconds/Seconds/Minutes/Hours Passed Since Previous Recorded Time!


        These two nodes can be used to

        1. obtain the current local Operating System Time for your computer.

        2. obtain the amount of milliseconds/seconds/minutes/hours that have passed since the time you recorded for the first node! You can stores as many times as you want! They are simply stored as a string!


        You can use these two nodes to record down to the sub-millisecond the amount of time passing between game events!

        The milliseconds portion is a float, so you can record far smaller than 1 millisecond!


        In the attached picture I record the amount of real-world time between two key presses

        Click image for larger version

Name:	DateTime1.jpg
Views:	2
Size:	357.2 KB
ID:	1051009

        Enjoy!

        Rama
        100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

        Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

        Comment


          Taking Simple BP Node Requests

          Anyone have a simple thing they'd like to have added to Blueprints that is not there already?

          I am taking small scale requests at the moment, since I dont have any immediate BP node ideas of my own.

          Has to be very simple

          Let me know!

          Rama
          100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

          UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

          Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

          Comment


            Hello Rama,

            I had to write a custom BP node for a project I am working on. I thought I would share it with the community. Since you already have a good package of BP nodes, perhaps you could integrate this into yours.

            Node: ExplodeString
            Description: Splits a string based on given delimiter. Unlike the ParseIntoArray() function, the delimiter can be a multi-character string (eg '::'). There is also aan optional automatic trimming that will cleanup the returned substrings.

            I am attaching the source here and if anyone is interested, have fun . Please note that currently it is implemented as a BlueprintFunctionLibrary, you might want to change that to suit your needs.

            UStringUtils.h
            Code:
            #pragma once
            
            #include "StringUtils.generated.h"
            
            /**
             * 
             */
            UCLASS()
            class UStringUtils : public UBlueprintFunctionLibrary
            {
            	GENERATED_UCLASS_BODY()
            
            	/**
            	* Split a string into an array of substrings based on the given delimitter.
            	* Unlike ParseIntoArray() function which expects single character delimitters, this function can accept a delimitter that is also a string.
            	*
            	* @param InputString - The string that is to be exploded.
            	* @param Separator - The delimitter that is used for splitting (multi character strings are allowed)
            	* @param limit - If greater than zero, returns only the first x strings. Otherwsie returns all the substrings
            	* @param bTrimElelements - If True, then each subsctring is processed and any leading or trailing whitespcaes are trimmed.
            	*/
            	UFUNCTION(BlueprintPure, meta = (FriendlyName = "Explode string", Keywords = "split explode string"), Category = String)
            	static TArray<FString> ExplodeString(FString InputString, FString Separator = ",", int32 limit = 0, bool bTrimElements = false);
            	
            };
            UStringUtils.cpp
            Code:
            #include "YourGame.h" //<-  Change this to match your-own header file
            #include "StringUtils.h"
            
            
            UStringUtils::UStringUtils(const class FPostConstructInitializeProperties& PCIP)
            	: Super(PCIP)
            {
            
            }
            
            TArray<FString> UStringUtils::ExplodeString(FString InputString, FString Separator, int32 limit, bool bTrimElements)
            {
            	TArray<FString> OutputStrings;
            
            	if (InputString.Len() > 0 && Separator.Len() > 0) {
            		int32 StringIndex = 0;
            		int32 SeparatorIndex = 0;
            
            		FString Section = "";
            		FString Extra = "";
            
            		int32 PartialMatchStart = -1;
            
            		while (StringIndex < InputString.Len()) {
            
            			if (InputString[StringIndex] == Separator[SeparatorIndex]) {
            				if (SeparatorIndex == 0) {
            					//A new partial match has started.
            					PartialMatchStart = StringIndex;
            				}
            				Extra.AppendChar(InputString[StringIndex]);
            				if (SeparatorIndex == (Separator.Len() - 1)) {
            					//We have matched the entire separator.
            					SeparatorIndex = 0;
            					PartialMatchStart = -1;
            					if (bTrimElements == true) {
            						OutputStrings.Add(FString(Section).Trim().TrimTrailing());
            					}
            					else {
            						OutputStrings.Add(FString(Section));
            					}
            
            					//if we have reached the limit, stop.
            					if (limit > 0 && OutputStrings.Num() >= limit) {
            						return OutputStrings;
            					}
            
            					Extra.Empty();
            					Section.Empty();
            				}
            				else {
            					++SeparatorIndex;
            				}
            			}
            			else {
            				//Not matched.
            				//We should revert back to PartialMatchStart+1 (if there was a partial match) and clear away extra.
            				if (PartialMatchStart >= 0) {
            					StringIndex = PartialMatchStart;
            					PartialMatchStart = -1;
            					Extra.Empty();
            					SeparatorIndex = 0;
            				}
            				Section.AppendChar(InputString[StringIndex]);
            			}
            
            			++StringIndex;
            		}
            
            		//If there is anything left in Section or Extra. They should be added as a new entry.
            		if (bTrimElements == true) {
            			OutputStrings.Add(FString(Section + Extra).Trim().TrimTrailing());
            		}
            		else {
            			OutputStrings.Add(FString(Section + Extra));
            		}
            
            		Section.Empty();
            		Extra.Empty();
            	}
            
            	return OutputStrings;
            }
            Usage and sample output:
            Click image for larger version

Name:	explode_string_usage.jpg
Views:	1
Size:	47.7 KB
ID:	1056379
            Last edited by mindfane; 09-07-2014, 12:28 AM.
            I expected challenges - but I never thought they'd be so bad, so long, and so frequent.

            Comment


              Originally posted by Rama View Post
              Taking Simple BP Node Requests

              Anyone have a simple thing they'd like to have added to Blueprints that is not there already?

              I am taking small scale requests at the moment, since I dont have any immediate BP node ideas of my own.

              Has to be very simple

              Let me know!

              Rama
              Do we have a BP node that can rotate and Actor around a random Pivot? The Pivot should be given as a WorldSpace Location OR could be an Actor. It should also accept a Rotator which specify the rotation needed. What the node will do is Move and rotate the Actor around the given Pivot while keeping the original distance. Could be useful for settings up things that orbit other Actors. However I think there should an additonal parameters to specify Up Vector and Right vector (in world space) to make the rotation unambiguous)

              So the general signature could be like this:

              RotateActorAroundPivot(Actor/Vector Pivot, Rotator rotation, Vector UP, Vector Right, bMaintainAngleToPivot = true) ---> probably need polymorphic versions (one for Actor Pivot, and another for Vector.)
              Pivot - The Actor or Location around which to rotate
              Rotation - angles to rotate
              Up - The Up vector (given in world space)
              Right - The right vector (given in world space)
              bMaintainAngleToPivot - If true, rotate the Actor to keep the same angle to Pivot as before the rotation.

              We could implement this in BP itself (I did actually), but I think if you can do it in C++, it would be faster.
              Last edited by mindfane; 09-07-2014, 12:44 AM.
              I expected challenges - but I never thought they'd be so bad, so long, and so frequent.

              Comment


                Originally posted by mindfane View Post
                Hello Rama,

                I had to write a custom BP node for a project I am working on. I thought I would share it with the community. Since you already have a good package of BP nodes, perhaps you could integrate this into yours.

                Node: ExplodeString
                Description: Splits a string based on given delimiter. Unlike the ParseIntoArray() function, the delimiter can be a multi-character string (eg '::'). There is also aan optional automatic trimming that will cleanup the returned substrings.
                As far as i know ParseIntoArray for blueprints does work with a multi-character string and i assume that would be the same for c++, but ofcourse i could be wrong.

                Comment


                  I would really really like to see a MoveTo-Node for any Actor.

                  Comment


                    Originally posted by Thommie View Post
                    As far as i know ParseIntoArray for blueprints does work with a multi-character string and i assume that would be the same for c++, but ofcourse i could be wrong.
                    No, you are right. There are two version of ParseIntoArray, which I did not notice. I was working on C++ to break up strings, and I tried to use the wrong version. I thought the Bp version was similar. But looks like I was wrong and what I wanted was already there. Anyway I needed to set a limit and trim on the elements, so I guess it was not a complete waste of time.
                    I expected challenges - but I never thought they'd be so bad, so long, and so frequent.

                    Comment


                      New BP Node

                      Explode String!!!


                      Originally posted by mindfane View Post
                      Usage and sample output:
                      [ATTACH=CONFIG]10914[/ATTACH]
                      Node Description:

                      Code:
                      	/**
                      	*
                      	* Contributed by: Mindfane
                      	*
                      	* Split a string into an array of substrings based on the given delimitter.
                      	* Unlike ParseIntoArray() function which expects single character delimitters, this function can accept a delimitter that is also a string.
                      	*
                      	* @param InputString - The string that is to be exploded.
                      	* @param Separator - The delimitter that is used for splitting (multi character strings are allowed)
                      	* @param limit - If greater than zero, returns only the first x strings. Otherwsie returns all the substrings
                      	* @param bTrimElelements - If True, then each subsctring is processed and any leading or trailing whitespcaes are trimmed.
                      	*/
                      Dear MindFane,

                      Your BP offering is very nice!

                      Anyone find it funny that I was taking requests to make new nodes and ended up getting a node from Mindfane instead? Hee hee!

                      I modified the node a little to return the FString array by reference, an important optimization for larger amounts of data.

                      This node is now live in my Victory BP Library plugin!

                      Latest version can be downloaded from my original post!


                      Or here!

                      https://wiki.unrealengine.com/File:VictoryPlugin.zip
                      100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                      UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                      Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                      Comment


                        Originally posted by Wolfsblut View Post
                        I would really really like to see a MoveTo-Node for any Actor.
                        This is a great idea, but hard to do without a tick function, not something available to me in static BP library node context.

                        The incremental move BP nodes that are already available are your best bet at the moment

                        Best I could do is an incremental move to location that you have to call every tick, I can check when unit has reached within radius of destination and stop moving it more.

                        But doing collision detection is bit of issue

                        If you really want any actor to follow nav mesh path, well that's beyond scope of a BP node

                        Rama

                        ~~~

                        Originally posted by mindfane View Post
                        Do we have a BP node that can rotate and Actor around a random Pivot? The Pivot should be given as a WorldSpace Location OR could be an Actor. It should also accept a Rotator which specify the rotation needed. What the node will do is Move and rotate the Actor around the given Pivot while keeping the original distance. Could be useful for settings up things that orbit other Actors. However I think there should an additonal parameters to specify Up Vector and Right vector (in world space) to make the rotation unambiguous)

                        So the general signature could be like this:

                        RotateActorAroundPivot(Actor/Vector Pivot, Rotator rotation, Vector UP, Vector Right, bMaintainAngleToPivot = true) ---> probably need polymorphic versions (one for Actor Pivot, and another for Vector.)
                        Pivot - The Actor or Location around which to rotate
                        Rotation - angles to rotate
                        Up - The Up vector (given in world space)
                        Right - The right vector (given in world space)
                        bMaintainAngleToPivot - If true, rotate the Actor to keep the same angle to Pivot as before the rotation.

                        We could implement this in BP itself (I did actually), but I think if you can do it in C++, it would be faster.
                        This is a great idea! will work on this when I get time

                        meantime, see the just-higher post about your string node!!!

                        Rama
                        100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                        Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                        Comment


                          Get Screen Resolutions Now Works in Packaged Game

                          My Get Screen Resolution Nodes works in packaged games now!

                          In 4.3 the core function in C++ was not working in BP, but now it is! Epic fixed it!

                          Enjoy getting the screen resolutions of the end user's hardware in your game now!

                          It is obtained from the user's display adapter directly! No guessing or preset values!



                          Click image for larger version

Name:	Resolutions2BP.jpg
Views:	8
Size:	579.1 KB
ID:	1053539


                          https://wiki.unrealengine.com/File:VictoryPlugin.zip

                          Rama
                          100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                          UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                          Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                          Comment


                            Get OS Platform

                            Click image for larger version

Name:	OSGet.jpg
Views:	7
Size:	127.5 KB
ID:	1050872

                            Platforms you can check for:

                            Windows
                            Mac
                            Linux

                            PS4
                            XBoxOne

                            iOS
                            Android

                            HTML5

                            WIN RT
                            WIN RT ARM


                            Enjoy!

                            Rama
                            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                            Comment


                              Originally posted by Rama View Post
                              This is a great idea, but hard to do without a tick function, not something available to me in static BP library node context.

                              The incremental move BP nodes that are already available are your best bet at the moment

                              Best I could do is an incremental move to location that you have to call every tick, I can check when unit has reached within radius of destination and stop moving it more.

                              But doing collision detection is bit of issue

                              If you really want any actor to follow nav mesh path, well that's beyond scope of a BP node

                              Rama

                              ~~~



                              This is a great idea! will work on this when I get time

                              meantime, see the just-higher post about your string node!!!

                              Rama
                              isn't possible to just use the time graph thingy in blueprints and just set actor location with some animation xd

                              Comment


                                As Mentioned in Hourence's Twitch Stream Today!

                                This is the same node you could see in the Epic twitch stream today!

                                I told Hourences I could give him the real system time and he did wonders with it!


                                Get Current Operating System Time

                                annnnd

                                Get Milliseconds/Seconds/Minutes/Hours Passed Since Previous Recorded Time!


                                These two nodes can be used to

                                1. obtain the current local Operating System Time for your computer.

                                2. obtain the amount of milliseconds/seconds/minutes/hours that have passed since the time you recorded for the first node! You can stores as many times as you want! They are simply stored as a string!


                                You can use these two nodes to record down to the sub-millisecond the amount of time passing between game events!

                                The milliseconds portion is a float, so you can record far smaller than 1 millisecond!


                                In the attached picture I record the amount of real-world time between two key presses

                                Click image for larger version

Name:	DateTime1.jpg
Views:	2
Size:	357.2 KB
ID:	1051009

                                Enjoy!

                                Rama
                                100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                                UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                                Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                                Comment

                                Working...
                                X