Download

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

I am mostly just using UE4 API functions for this, so I am not sure what the cause of the issue is.

Here is the relevant portion of the source code for this node:



bool UVictoryBPFunctionLibrary::Victory_SavePixels(const FString& FullFilePath,int32 Width, int32 Height, const TArray<FLinearColor>& ImagePixels, FString& ErrorString)
{
	//Create FColor version
	TArray<FColor> ColorArray;
	for(const FLinearColor& Each : ImagePixels)
	{
		ColorArray.Add(Each.ToFColor(true));
	} 
	 
	if(ColorArray.Num() != Width * Height) 
	{
		ErrorString = "Error ~ height x width is not equal to the total pixel array length!";
		return false;
	}
	  
	TArray<uint8> CompressedPNG;
	FImageUtils::CompressImageArray( 
		Width, 
		Height, 
		ColorArray, 
		CompressedPNG
	);
	    
	return FFileHelper::SaveArrayToFile(CompressedPNG, *FinalFilename);


There’s not much room here for me to make mistakes of my own, its really just API calls.

But clearly something is amiss, I tested saving as a bmp and got the same unusual results as with compressed png:

I did a test with 0.25 and got 137 as well, instead of what you’d expect, 63.75 (255 * 0.25).

I tested 0.715 and got 220 instead of 182.325

The culprit appears to be the ToFColor function:



//Create FColor version
TArray<FColor> ColorArray;
for(const FLinearColor& Each : ImagePixels)
{
	ColorArray.Add(Each.ToFColor(true)); 
	UE_LOG(LogTemp,Error,TEXT("float is %f, byte added as %d"), Each.R, ColorArray.Last().R); 
} 


yields this:



LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.250000, byte added as 137
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 1.000000, byte added as 255
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.715000, byte added as 220
LogTemp:Error: float is 0.000000, byte added as 0


So the conversion you are not enjoying is being done by FLinearColor::ToFColor

ToFColor has this sRGB option:



/** Quantizes the linear color and returns the result as a FColor with optional sRGB conversion and quality as goal. */
FColor FLinearColor::ToFColor(const bool bSRGB) const
{


The sRGB conversion algorithm can be found in Color.cpp if you want to see it for yourself!

When I set that to false then the values you’d expect are returned:



LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.250000, byte added as 63
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 1.000000, byte added as 255
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.000000, byte added as 0
LogTemp:Error: float is 0.715000, byte added as 183
LogTemp:Error: float is 0.000000, byte added as 0


You can read about sRGB here:

I’ve now made this sRGB conversion optional, and off by default :slight_smile:

The update will be in my next plugin release

:slight_smile:

Rama

5d8746ac041d5a035d21134660068b96185bcc48.jpeg

VictoryEd 4.11 worked smoothly, thanks again for your work :smiley:

Hi Rama,
I have read on GitHub that your level instance loading solution might cause problems in cooked/packaged projects (maybe I misunderstood that comment), but you wrote it was tested.
So is there an actual conflict? And if yes, is there a chance to have a workaround for it in future?
I started to built on it an important part of my game system (a pseudo random world due to the lack of runtime landscape creation/deformation possibilities), so this feature would be essential for me…
thanks.

NICE JOB RAMA! Thanks a lot to share it!!

I just would like to know if there is any BP to execute an external file, it would save my life.

i really don’t know how to use this “FPlatformProcess::CreateProc(TEXT(“C:\Users\Cero\Desktop\Test.exe”), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);”

Yay it works great :slight_smile:
Another bugging question, will you be working on the shift+i similar to merge actors blueprint again? :slight_smile:
it is currently disabled with this version :frowning:

How to Ensure Maps Get Packaged With Your Game

Hi there!

I responded on Git hub, with 2 solutions that are already built into UE4, as well as the fact that I rely on my Load Level instance BP node for my own game and it has worked great in packaged win32 and win64, development and shipping.

https://github.com/EpicGames/UnrealEngine/pull/2320

For those without github access, if you ever find maps are not packaging with the game, you can use 1 of these 2 solutions, that are already built-in with the Engine!

Again I myself have not needed to use these 2 solutions, all my maps are stored in a Maps folder and they all package great even though not directly referenced as a sublevel, which is what gives my BP node its great usefulness (not having to store the sub-levels in the level list)

I have a wiki on adding non-uasset or uasset/umap files to your cooked build here:

:heart:

Rama

Manually specify maps to include in packaged game
7c529abf7e12846927385eb5adbb3166325b93d6.jpeg

Can add an entire folder of UE4 assets if you want to!

Use “Additional Assets to Cook” for .umaps!

b8c038088d5377cec93cf000bc8cfcde3f2d2c34.jpeg

ooooh, that’s a great one!

Will work on it soon as I can :slight_smile:

Rama

New BP Node ~ Is Alpha Numeric

Dear Community,

This BP node lets you find out if a string contains only letters and numbers!

This is very useful when allowing users to pick login names and passwords!


**C++ Code For You**

My solution relies entirely on a core C++ function called isalnum.

So I am not making up my own solution, I am enabling you to call this core C++ function via a BP node, doing the necessary conversion to go from UE4 FString to c++ std::string / UTF8 char string



```


#include <string>
bool UVictoryBPLibrary::IsAlphaNumeric(const FString& String)
{
	std::string str = (TCHAR_TO_UTF8(*String));
	    
	for ( std::string::iterator it=str.begin(); it!=str.end(); ++it)
	{
		if(!isalnum(*it))
		{   
			return false;
		}
	}
	
	return true;
}


```



**New Download (50.21mb, Media Fire)**
https://www.mediafire.com/?ieovbd5l9d7yub2

Please note my downloads also include these packaged binaries:

1. Win64 Development
2. Win64 Shipping  **&lt;~~~~~~ NEW!**
3. Win32 Development
4. Win32 Shipping
4. HTML5 Development

Please see my instructions for [Packaging UE4 Plugins With Your Game](https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=476476&viewfull=1#post476476).

**Donations can be sent to me via:**
http://lightningfitness.org/donate/

♥

Rama

Great news, thanks Rama for the prompt answer!

And that wiki page is also super useful for me! But I have a question:

I need a custom level save/load system (not ready), and later want to add some modding features via text files (an advice: never start to develop RTS games :D), and you mention these additional non-uasset directories should be placed out of game project content folder, so is the best practice to make an own directory e.g. “MyOwnData” and use FPaths::ConvertRelativePathToFull(FPaths::GameDir() + “/MyOwnData/”); to access my files runtime in packaged game?
and is there an easy way to have the same work with the development version ? I think in development I should not use ConvertRelativePathToFull(), and there should exist a precompiler directive…

P.S.
with the dark skin your purple letters and really invisible :cool:

Thanks Rama ! I’m donating some good vibes because I am a poor programmer right now. Have had a lot of usage of the plugin over the past year or so. First paycheck and I can donate some actual dollar. GL HF !

Victory Plugin For Mac!

Dear Community,

Today is a happy day!

I now offer a version of my Victory Plugin for Mac, including packaged binaries!


**New Download (50.21mb, Media Fire)**
https://www.mediafire.com/?ieovbd5l9d7yub2

Please note my downloads also include these packaged binaries:

1. Win64 Development
2. Win64 Shipping  **&lt;~~~~~~ NEW!**
3. Win32 Development
4. Win32 Shipping
4. HTML5 Development

Please see my instructions for [Packaging UE4 Plugins With Your Game](https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=476476&viewfull=1#post476476).

**
Mac Editor and Packaged Game Binaries** **<~~~~~~ NEW!**

  1. Mac Editor Build
  2. Mac Shipping (any architecture)
  3. Mac Development (any architecture)
  4. Source code!

Victory Plugin For Mac (~14.22mb)


**Donations can be sent to me via:**
http://lightningfitness.org/donate/

♥

Rama

oooooh, I use Hacker Vision for Chrome, so I did not notice that :slight_smile:

Hey see the just higher post! tell all your mac friends!

Rama

Wow Mac version now! :slight_smile:
Although I’m not a Mac user, but this is great for the Mac community!
Champ Rama cheers once again for your efforts!

@Rama Hey Rama, by any chance can you (or anyone else!) expose EHMDDeviceType::Type (https://docs.unrealengine.com/latest/INT/API/Runtime/HeadMountedDisplay/EHMDDeviceType__Type/index.html) to blueprints? This would help immensely to a whole lot of VR developers!

What functions do you need it for that are already exposed to BP, or what exactly do you nee to do with it?

I can help but I need more info :slight_smile:

I can’t expose stuff in the engine, but I can make my own version that ties into the requiste BP functions, or write my own BP functions to call what you need, just need a function list :slight_smile:

Rama

@Rama Basically a function that detects what HMD the user is currently using. This would be beneficial for people developing for both the Rift and the Vive (along side the GearVR). There is currently a function in UE4 that does this, however, it is solely based in C++, and not exposed to blueprints for some reason.

Almost there, I am just compiling all the binaries now

:slight_smile:

Rama

New BP Node ~ Get Current Head Mounted Display Device, When You Have Multiple!

Dear Community,

At the request of @SaviorNT and for the benefit of all you lovely VR enthusiasts who have more than one VR headset that you are testing with, I present to you a BP node to let you know which type of headset is currently hooked up to the computer!

Please keep in mind that I’ve added my own addition, which is the None option, this can happen if you don’t have any device hooked up and could help with debugging, especially in packaged games.

e18c8d72f1d9b089fc4384a911a2f6aeaf2af722.jpeg

New Download (50.21mb, Media Fire)

Please note my downloads also include these packaged binaries:

  1. Win64 Development
  2. Win64 Shipping **<~~~~~~ NEW!**
  3. Win32 Development
  4. Win32 Shipping
  5. HTML5 Development

Please see my instructions for Packaging UE4 Plugins With Your Game.

Donations can be sent to me via:
http://lightningfitness.org/donate/

:heart:

Rama

Hey Rama, this plugin’s quite amazing! :smiley: I’m using your node to get the available resolutions for the display adapter and while it works, I always get duplicates. For example 800x600 will show up 16 times in my dropdown menu :stuck_out_tongue: I’m not including refresh rates. Do you reckon this happens because I have a more than 1 monitor?

Hey Rama,

i find your plugin very handy thank you for that.

At the moment i’m a little bit stucked with ismActor. I use the “Ism Convert To Victory Ism Actor”. It works fine and generate a Victory Ism Actor but i loose my material.
I tried also to manualy create a “Victory ISM” and add a simple cube with one simple meterial it works but also no material. (only default checkerboardtecture visible)

Do you have any idear what i made wrong ? UE Version is 4.11.2.