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

    Rama's Suite of Powerful UMG Nodes

    Here are the 3 core BP nodes that I've been using to make all of my complicated interacting UMG menus, including an in-game file browser and a menu that allows you to change the materials on any skeletal mesh, while in-game!

    These nodes are available to you now!

    ~~~

    Get All Widgets of Class

    Allows you to not have to store references everywhere to your widgets, making it easy to interact with the Player Controller and My Character blueprints

    Also makes it easy to remove a loading screen after a level transition, without storing refs in Game Instance class

    Epic added this node of mine, it should be in 4.7 !

    ~~~

    Remove All Widgets Of Class

    You can find and remove any widget any time this way, no matter where you are in BP! (here I am in the Level BP)

    Rama Tip:
    If you make a general superclass for all your widgets (Reparent to a blank UserWidget of your own making), you can clear your entire UI system from the viewport with a single call to RemoveAllWidgetsOfClass, supplying the class that is your super class for all your user widgets!

    So lets say you have 3 user widgets that you made, make a 4th that is blank, reparent your existing 3 to your new empty 4th widget ("WidgetMaster" for example).

    Now you can just call RemoveAllWidgetsOfClass on your new 4th widget, WidgetMaster, and all 3 of your existing widgets will be removed automatically from the viewport!

    ~~~

    Is Widget Of Class In Viewport

    Take action based on the dynamic lookup of whether a certain widget is currently visible!

    No need to store refs or bools anywhere, just do a dynamic look up that is lightning fast!

    If you turn "Top Level Only" off you can iterate over the internal widgets of the visible wdigets that have been added to the viewport!



    Rama

    Click image for larger version

Name:	UMGRamaNodes.jpg
Views:	5
Size:	162.4 KB
ID:	1065929
    Last edited by Rama; 02-03-2015, 03:42 AM.
    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


      Nice plugin Rama.
      I got a problem, i like use your nodes to read / write in the ini file, but i like use with a custom ini file, i added to the plugin for this:

      VictoryBPFunctionLibrary.h
      /** Get Custom Config Var! These are stored in Saved/Config/Windows/GameSettings.ini */
      UFUNCTION(BlueprintPure, Category = "VictoryBPLibrary|Config Reader")
      static FString ConfigGetCustomConfigVar_String(FString SectionName, FString VariableName);

      /** Set Custom Config Var! These are stored in Saved/Config/Windows/GameSettings.ini */
      UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary|Config Writer")
      static void ConfigSetCustomConfigVar_String(FString SectionName, FString VariableName, FString Value);
      VictoryBPFunctionLibrary.cpp
      FString UVictoryBPFunctionLibrary::ConfigGetCustomConfigVar_String(FString SectionName,FString VariableName)
      {
      if(!GConfig) return "";
      //~~~~~~~~~~~

      FString Value;
      GConfig->GetString(
      *SectionName,
      *VariableName,
      Value,
      FString( TEXT( "GameSettings" ) )
      );
      return Value;
      }

      void UVictoryBPFunctionLibrary::ConfigSetCustomConfigVar_String(FString SectionName,FString VariableName, FString Value)
      {
      if(!GConfig) return;
      //~~~~~~~~~~~

      GConfig->SetString(
      *SectionName,
      *VariableName,
      *Value,
      FString( TEXT( "GameSettings" ) )
      );
      GConfig->Flush( false, FString( TEXT( "GameSettings" ) ) );
      }
      And in the game folder Config/ added the "DefaultGameSettings.ini" file with
      [Profile]
      pAccountName=HelloWorld
      now in the editor, in the Level Blueprint i using this nodes and the print node to print in the screen.

      Then i got 2 problems:
      1º- When i read the value to get the name, i got "" = nothing, but if set before the value to x name, i got the name changed, but no idea where is saved, because the name no is in the inis of the game folder or engine folder (and don't is in my file or in the created saved files but is changed in somewhere).
      2º- My friend Moss, tell me i need load the ini in cache creating a new class, i have created in the game project this:

      GameSettingsConfig.h
      // Fill out your copyright notice in the Description page of Project Settings.

      #pragma once

      #include "Object.h"
      #include "GameSettingsConfig.generated.h"

      /**
      *
      */
      UCLASS( Config = GameSettings )
      class GAMENAME_API UGameSettingsConfig : public UObject
      {
      GENERATED_BODY()

      UPROPERTY( Config )
      uint32 bBoolValue : 1;


      };
      GameSettingsConfig.cpp
      // Fill out your copyright notice in the Description page of Project Settings.

      #include "GAMENAME.h"
      #include "GameSettingsConfig.h"
      and now this generate a empty (with 2 space lines) files in the Saved/ and but without the vars...

      Then where is saved that data and how make this works correctly ?
      Thanks.
      Hevedy - Instance Tools: https://hevedy.itch.io/hevedyinstances
      Hevedy - Image Tools: https://hevedy.itch.io/imagetools

      Comment


        Rama,

        One idea for super handy node would be to write a UFUNCTION to expose the ability to add and search for data in a TMap via blueprint. TMap's can't be exposed directly to blueprints as a UPROPERTY, but it would be very very hand to have the ability to store stuff in a container that can be searched quickly via blueprint. It's one of the major shortcomings of using arrays in blueprint beyond a certain point because to search on them begins to take a long time compared to a dictionary/hash map
        Trevor Lee

        Comment


          Originally posted by Hyperloop View Post
          Rama,

          One idea for super handy node would be to write a UFUNCTION to expose the ability to add and search for data in a TMap via blueprint. TMap's can't be exposed directly to blueprints as a UPROPERTY, but it would be very very hand to have the ability to store stuff in a container that can be searched quickly via blueprint. It's one of the major shortcomings of using arrays in blueprint beyond a certain point because to search on them begins to take a long time compared to a dictionary/hash map
          That's a great idea!

          I could make an Actor that you spawn that could store tmaps

          The one issue is how to define the types of the tmap

          I might have to just go with some stock variants like

          FString,FString,
          FString,int32
          FString,Vector

          buuut, this is rather limiting

          The types have to be defined for the TMap at compile time though...

          sooooo

          How about you tell me what Tmap combination you need, and other people can do the same, and I'll just keep making tmaps on this one actor, the TMapActor, and whichever one you need is the one you use.

          Obviously not a perfect solution but I have no idea how to allow you to pick the tmap types via BP, maybe the reason they are not BP exposed in first place.

          But what I've described as a solution could work , as one extra actor is a lot less troublesome that having really slow lookups of large amounts of data, constantly, during game time.

          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


            New Node

            Save String Array To File


            The previous String File IO could only save a single line of text, even if you put "\n" into your string

            So I"ve made a new node that lets you save multiple lines of text to file, each FString of the array is on its own line!

            See pic!

            Enjoy!

            Rama

            Click image for larger version

Name:	SaveStringArrayToFile.jpg
Views:	3
Size:	188.3 KB
ID:	1065988

            Download Link (6.5mb)

            UE4 Wiki, Plugin Download Page
            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


              FYI if anyone is using 4.7.0 here are the steps you need to take in order to get the plugin to work. Latest version above:

              1) In VictoryEdAlignMode.cpp (Line 602) change RV_TraceParams.IgnoreActors.Empty(); to RV_TraceParams.IgnoreComponents.Empty();

              2) Comment out (temp measure) lines 220 & 883 in VictoryBPFunctionLibrary.cpp

              3) In VictoryEdEngine.Build.cs add "Slatecore" (inc quotes) after "Slate"

              Works perfectly!

              Peter

              Comment


                Originally posted by Rama View Post
                That's a great idea!

                I could make an Actor that you spawn that could store tmaps

                The one issue is how to define the types of the tmap

                I might have to just go with some stock variants like

                FString,FString,
                FString,int32
                FString,Vector

                buuut, this is rather limiting

                The types have to be defined for the TMap at compile time though...

                sooooo

                How about you tell me what Tmap combination you need, and other people can do the same, and I'll just keep making tmaps on this one actor, the TMapActor, and whichever one you need is the one you use.

                Obviously not a perfect solution but I have no idea how to allow you to pick the tmap types via BP, maybe the reason they are not BP exposed in first place.

                But what I've described as a solution could work , as one extra actor is a lot less troublesome that having really slow lookups of large amounts of data, constantly, during game time.

                Rama
                Those stock variants seem like the most useful. most other data types could technically be stored using one of those, at the cost of some memory and conversion time.

                The two use cases I have would be covered by storing strings, and storing an int.

                Thanks again for contributing so much to our community!
                Trevor Lee

                Comment


                  BP Node to Get Your Computer's IP Address!

                  UPDATE: The VictoryPC class got removed from my plugin somehow between updates, this post below is now fully integrated into the plugin again!

                  Now you can get your computer's IP from within UE4, from within Blueprints!

                  Dear Community,

                  I've finally succeeded at implementing a node that many have been trying to implement since the Beta!

                  This is a BP node that gets the IP address of your computer!

                  My node relies on http://api.ipify.org, a free and easy way to get your current IP address.

                  Because this node involves an HTTP request I can't make it a static library node, so I instead made a VictoryPC class that contains only this functionality.

                  You can easily re-parent your current player controller blueprint to use my plugin VictoryPC class!

                  File->Reparent

                  and if you are not using a PC already, make sure to go to World Settings and use my VictoryPC as your player controller!

                  As long as my Victory BP Library is an active plugin for you, then this VictoryPC class will show up!

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

                  ~~~

                  Celebration!

                  Yay!

                  Now we can all get the IP address of the local computer for use with multiplayer games or webserver activities!

                  Enjoy!

                  Rama

                  ~~~

                  Pic

                  Here's the setup you should create in your Blueprinted version of my VictoryPC!

                  Click image for larger version

Name:	IPGetMyIP.jpg
Views:	11
Size:	177.0 KB
ID:	1066059

                  ~~~

                  C++ Source Code For You

                  Here is the C++ source code I wrote just earlier today!

                  Code:
                  bool AVictoryPC::VictoryPC_GetMyIP_SendRequest()
                  {
                  	FHttpModule* Http = &FHttpModule::Get();
                  	
                  	if(!Http)
                  	{
                  		return false;
                  	}
                  	 
                  	if(!Http->IsHttpEnabled()) 
                  	{
                  		return false;
                  	} 
                  	//~~~~~~~~~~~~~~~~~~~
                  	
                  	FString TargetHost = "http://api.ipify.org";
                  	TSharedRef < IHttpRequest > Request = Http->CreateRequest(); 
                  	Request->SetVerb("GET");
                  	Request->SetURL(TargetHost);
                  	Request->SetHeader("User-Agent", "VictoryBPLibrary/1.0");
                  	Request->SetHeader("Content-Type" ,"text/html");
                   
                  	Request->OnProcessRequestComplete().BindUObject(this, &AVictoryPC::HTTPOnResponseReceived);
                  	if (!Request->ProcessRequest())
                  	{
                  		return false;
                  	}
                  	  
                  	return true;
                  }
                  	
                  void AVictoryPC::HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
                  {
                  	this->VictoryPC_GetMyIP_DataReceived(Response->GetContentAsString());
                  }


                  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


                    Rama's Blueprints TMap Solution!

                    I've now made a BP TMap solution!

                    TMap is a data structure that is not yet exposed to BP, but I've made a component-based solution for you so that you can use TMaps in BP!

                    ~~~

                    What's a TMap?

                    A TMap is a data structure based on Key,Value pairs, where for any Key there is only one Value.

                    This allows internal data structure look up times that are much faster than a regular dynamic array.

                    This also allows for the association of dissimilar data types in a way that you organize.

                    For example, you can map a set of integers to a set of Vectors, so that each integer is related to exactly one vector.

                    Or, as I provide you with in my plugin, you can relate a String to an Actor!

                    This means you can look up an Actor reference via a simple string input!

                    Or you can look up Vector data based on String data!

                    The primary use of TMaps is for efficient lookup of data, which dynamic arrays simply cannot do because there is no guarantee or assumption with dynamic arrays of anything like a key,value where each key has only 1 value.

                    The rules of TMaps allow for efficient look up to speed up your game flow!

                    ~~~

                    Actor Component

                    My solution is component-based, which means you can have per-instance TMap data for your game's actors!

                    You simply add my Victory TMap Component to any actor you want!

                    I used the My Character blueprint in my own tests!!!

                    You can use literally any actor you want, or make a new actor BP whose only role is to house the TMap Component

                    Click image for larger version

Name:	AddComponent.jpg
Views:	3
Size:	96.3 KB
ID:	1066062

                    ~~~

                    Supported Types

                    Click image for larger version

Name:	VictoryTMap.jpg
Views:	3
Size:	246.8 KB
ID:	1066063

                    ~~~

                    Supported TMap Functions

                    Click image for larger version

Name:	VictoryTMap2.jpg
Views:	3
Size:	207.5 KB
ID:	1066064

                    Click image for larger version

Name:	categorized.jpg
Views:	1
Size:	133.1 KB
ID:	1066065

                    ~~~

                    Additional TMap Combinations

                    If you find that you cannot use my existing set of TMap Combinations to fulfill your game's needs, let me know by posting in this thread and I can add additional TMaps to the component.

                    ~~~

                    Per Instance

                    Remember that what I providing you with is a component-based solution, so you can add this TMap data to as many actors in your game as you want, and have per-instance variations in the data contained therein!

                    Enjoy!

                    Rama
                    Last edited by Rama; 02-05-2015, 06:53 PM.
                    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


                      Hi Rama - this is a brilliant node (The image loader) that will make my life very much easier! I was using VaQuole to load images through a web address (to a local path) - this is going to make my life so much easier!

                      Thanks, and thanks again for my socket plugin.

                      Dan.

                      Comment


                        Hello Rama,
                        Great piece of work!
                        I do have some requests on the tmap comp.
                        could you also provide a node to only add unique KV pair?
                        could you add a node wher value is Transform?
                        and a node where value is struct?
                        and lastly a node where value is targetpoint?

                        Many tnx in advance.

                        Greetz,
                        G

                        Comment


                          Wow, Thanks for the Tmap nodes that will be so handy!
                          Trevor Lee

                          Comment


                            Originally posted by Dannington View Post
                            Hi Rama - this is a brilliant node (The image loader) that will make my life very much easier! I was using VaQuole to load images through a web address (to a local path) - this is going to make my life so much easier!

                            Thanks, and thanks again for my socket plugin.

                            Dan.
                            Hee hee! You're welcome Dan!

                            Originally posted by gpvd View Post
                            Hello Rama,
                            Great piece of work!
                            could you also provide a node to only add unique KV pair?
                            could you add a node wher value is Transform?
                            and a node where value is struct?
                            and lastly a node where value is targetpoint?

                            Many tnx in advance.

                            Greetz,
                            G
                            " only add unique KV pair" All KV pairs are unique already! That's how a TMap works.

                            "value is Transform?" What do you want the key to be?

                            "targetpoint?" you can do that already, target points are Actor, you can use FString,Actor

                            "where value is struct?" no I can't do a generic struct like that in c++



                            Originally posted by Hyperloop View Post
                            Wow, Thanks for the Tmap nodes that will be so handy!
                            Let me know how it goes Hyperloop!

                            Rama
                            Last edited by Rama; 02-06-2015, 12:59 PM.
                            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,

                              They key for value Transform could be an int.
                              I asked about unique kv pair, because i saw in the image you posted a comment that when you add a kv pair where key already exists, the value will be overwritten.
                              So i meant an extra node where adding will fail if key already exist, instead of overwrite the value.
                              I thought targetpoint could be handy, so that casting/ extra checking isn't neccesary.

                              Many tnx in advance.

                              Greetz,
                              G

                              Comment


                                Rama's Blueprints TMap Solution!

                                I've now made a BP TMap solution!

                                TMap is a data structure that is not yet exposed to BP, but I've made a component-based solution for you so that you can use TMaps in BP!

                                My solution is component-based for per-instance variations!

                                Click image for larger version

Name:	AddComponent.jpg
Views:	3
Size:	96.3 KB
ID:	1066062

                                ~~~

                                Supported Types

                                Click image for larger version

Name:	VictoryTMap.jpg
Views:	3
Size:	246.8 KB
ID:	1066063

                                ~~~

                                Full details here!
                                https://forums.unrealengine.com/show...l=1#post216979

                                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