Download

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

Hey Rama! Awesome plugin! I’ve been using it in my project and it has so much extra nodes that are incredibly helpful! Thanks for that! I’ve run into a bit of a problem though, when I try to package the game for testing on multiple computers I get this error message:
1b5ae56d0cffa9917cfa515cbc113b917959b96f.png

I’m guessing I need to put the plugin somewhere in the packaged game folders, I’ve tried putting it in Projectname/Plugins as well as Engine/Plugins, but still that error message appears so I figured I would ask!

Are you using the current available plugin ? ( Newest ). Are you using UE4.6 and not an older version ? This is supposed to be in :
ProjectName\Plugins
This is a path for one of the files :
ProjectName\Plugins\VictoryPlugin\Source\VictoryBPLibrary\Classes\VictoryBPFunctionLibrary.h
Check if you are not missing anything in that path.

New Node Contributed by Sahkan!

In the most recent version of my Victory BP Library Plugin is a node contributed by Sahkan!

This node lets you switch the player HUD during runtime!

Thanks Sahkan!

Rama

2a371719c9b9ad758d0e522a026e7a55ab9a8bd5.jpeg

Thats easy, the S stands for Super. :smiley:

-Zhi

Hee ehee!

Actually it stand for Sexy!

Rama’s Sexy UMG!

Hee hee!

But I like super too

Maybe RSSUMG ?

:slight_smile:

Rama

Get Your IP Address From Witin UE4

BP Node to Get Your Computer’s IP Address!

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:


**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!

2902549c08d489d31bb43f8a7049793370d4801e.jpeg


**C++ Source Code For You**

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



```


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

You sir, are a god of men.

![eiMyGaRinSmall.png|300x302](upload://6MxFrWe1wueWWksLOWXxNEfCeaO.png)

So I’ve fleshed out two different paths for the new rand functions, basically you don’t have to do anything but either use the construct rand ONCE like in begin play somewhere, or seed rand somewhere like construct rand and use the functions, if you use construct rand, it will determine if you have access to a random device, (entropy chip) if not it will default to a default random engine, it will use this number from either the random device or use “std::chrono::system_clock::now().time_since_epoch().count();” to seed a pseudo random number generator then you can use the random functions i’ve included. You can also construct rand for some generations, then seed with others, it’s pretty awesome! im working on a ton of other engines and distributions exposed but for now there is; rand bool - Bernoulli distribution, rand int uniform 0-1 distribution, rand double uniform 0-1 distribution, rand int - min to max uniform distribution, rand double - min to max uniform distribution, but first i was just wondering, what kind of packaging testing i should do, atm i only have access to the windows 32 path. I packaged it into shipping and it seems to work. Anyone up for some testing on other systems ? Currently the only dependencies are <random> and <chrono> which are both c++ 11 headers

p.s. the picture has an error (not error, but random float has the min and max variables as ints and i guess they should be floats not ints.)

Yeah, I’ve tried both 4.5 and 4.6 using the appropriate plugin, still doesn’t work… And just to be sure we’re on the same page, the plugin itself works just fine, it’s just that when I build the game and try to run the built game I get this error, have you been able to build a game with a plugin? Anything else I need doing for it to work? My project is blueprint only, maybe I need to have a code project?

My project is blueprint only, maybe I need to have a code project?

Yes you do need code based project for now, this issue of plugins not working for BP-only projects is going to be resolved soon by Epic.

This is great Saxon Rah!

If you send me the code or send me my latest plugin version with your code integrated I can add it to Victory Master Branch

:slight_smile:

Rama

Hee Hee!

Have fun with your Get My IP node!

:heart:

Rama

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

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!

♥

Rama

![9b7a621d3332fdafbe78b687447eb1c37f3f558c.jpeg|1035x750](upload://mbqdc9TTsCkJHaeTMyxg2GR6Hak.jpeg)

BP Node to Get Your Computer’s IP Address!

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:


**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!

2902549c08d489d31bb43f8a7049793370d4801e.jpeg


**C++ Source Code For You**

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



```


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

Video Guide to Installing Victory Plugin

By Sahkan

Here’s a guide to installing my Victory Plugin, thanks for making it Sahkan!

Code for you!

Let me know if you want an actual copy.
(note: all of my code should be within BeginRandom and EndRandom comments for ctrl-f ability)

Also you are more than welcome to change anything you see fit. Code is 10000% free

I know it’s been a while, but here’s the info:

I’ve been running it as a dedicated server, and this issue resurfaced recently when I just tried to implement your GetAllWidgetsOfClass and RemoveAllWidgetsOfClass methods. If I have a function library with the method signature “static void testMethod(UObject* WorldContextObject);”, there is no error.

However, “static void testMethodUObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass);” crashes on dedicated server. I’m not calling the method anywhere, just declaring it in a method header. I believe the issue is that UUserWidget does not exist in a strictly server context, so it can’t resolve what it’s a subclass of (hence trying to cast a null to a Blueprint). This would be why it compiles fine and only crashes on server runtime.

I tried adding “Client” to the UFUNCTION macro, but it gives me an error saying static functions can’t be replicated, so no luck there.

I didn’t find the log file particularly helpful (though it is full of UMG errors that might give credence to my theory that a designated server doesn’t know what a widget is), and it is extremely large, so I’ve cut out most of the middle and attached it here.

I’ll keep working on getting it working, but let me know if you need any more info from me!

EDIT: I tried adding
[FONT=Lucida Console]
virtual bool NeedsLoadForClient() const override
{
return false;
}
virtual bool NeedsLoadForServer() const override
{
return false;
}

to the Blueprint Function Library class (as suggested by this AnswerHub question) but that didn’t seem to do anything, no matter what combination of true and false I put in the return statements. After I added some debug statements to it, it didn’t seem like it was ever calling NeedsLoadForServer/Client from the BlueprintFunctionLibrary.

Wohoo!

I look forward to integrating this!

Yes please send me the code by pm :slight_smile:

Rama

**Rama’s Multiplayer Game Mode Solution

Find Player Start

Choose Player Start

Can Player Restart

These core Multiplayer functions are now fully implementable/overridable in Blueprints!**

I have found a solution for the issue of implementing FindPlayerStart, ChoosePlayerStart, and CanPlayerRestart in Blueprints!

And I’ve tested it as working!

**You can now implement core network coding of choosing player starts entirely in Blueprints!
**


**How To Use**

In my picture below I show how to use my Game Mode overrides!

1. **First make a new BP and select my VictoryGameMode class** which comes with my Victory BP Library (make sure you have the latest download https://wiki.unrealengine.com/File:VictoryPlugin.zip)

If you already have a Game Mode BP, choose File -&gt; Reparent and use my Victory Game Mode BP


2. Make sure you are using my Victory Game Mode in your **World Settings**!

3. Setup the Victory Game Mode BP the same as my picture below!

4. Celebrate! You can now implement core multiplayer logic in Blueprints!

*(right click -&gt; new tab to see larger pic)*
![VictoryGameMode.jpg|1280x960](upload://1psgB0eeaCt9i59C4zf1sNwPmLm.jpeg)

CPP Override and CPP Override Var

Please note the notation I am using, any variable that has CPPOverride Var in its name is used only with the corresponding event. This is how I enable you to implement core multiplayer coding logic in Blueprints!


**Simple Data Types**

Please note that for the function that is designed to return a boolean value, CanPlayerRestart, you must pass the boolean and also a special variable, **CPPOverride SelfReference**, this is how you tell the CPP that you are implementing the Game Mode function in BP!

Non Destructive Solution

My solution is entirely optional and if you do not implement the event in Blueprints, and your programmer does it in C++, my solution will not interfere at all with your existing code base!


**Log Message**

If you do implement my solution in BP, I am printing log information to indicate this, so you/your programmer knows you are using a BP override and any C++ code will not be run.

C++ Code

Here is my C++ code for FindPlayerStart which shows how I worked around the issue of overriding FindPlayerStart via Blueprints!

Again I’ve tested this as entirely working in PIE and commandline games!

.h



//Find Player Start
public:
	/** Use this var inside the body of CPP Override ~ Find Player Start event to override the C++ functionality! */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Victory Game Mode")
	AActor* CPPOverrideVar_FindPlayerStart;
	
	/** 
	 * Use CPPOverrideVar_FindPlayerStart inside of this event to implement FindPlayerStart in BP ! <3 Rama
	 *
	 * Return the 'best' player start for this player to start from.
	 * @param Player - is the AController for whom we are choosing a playerstart
	 * @param IncomingName - specifies the tag of a Playerstart to use
	 * @returns Actor chosen as player start (usually a PlayerStart)
	 */
	UFUNCTION(BlueprintImplementableEvent, meta=(FriendlyName = "CPP Override ~ Find Player Start"))
	virtual void CPPOverride_FindPlayerStart();

	virtual class AActor* FindPlayerStart( AController* Player, const FString& IncomingName = TEXT("") ) override;


.cpp



//Find
AActor* AVictoryGameMode::FindPlayerStart( AController* Player, const FString& IncomingName )
{
	//Clear any previous to indicate whether BP did an override
	CPPOverrideVar_FindPlayerStart = NULL;
	
	//=======================
	//BP Hook by Rama
	this->CPPOverride_FindPlayerStart();
	//=======================
	
	if(CPPOverrideVar_FindPlayerStart) //Did BP programmer set the var?
	{ 
		//Indicate that the BP override was found and is being used.
		UE_LOG(VictoryGameModeLog, Log, TEXT("

"));
		UE_LOG(VictoryGameModeLog, Log, TEXT("FindPlayerStart: CPP override found in %s and used instead of C++ implementation"), *GetName());
		UE_LOG(VictoryGameModeLog, Log, TEXT("

"));

		return CPPOverrideVar_FindPlayerStart;
	} 
	 
	//Default C++ Implementation
	return Super::FindPlayerStart(Player,IncomingName);
}



**Enjoy!**

Rama