Download

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

Nice work John Alcatraz!

:slight_smile:

Rama

I’ve not yet worked on extrusion due to time constraints, but if you choose to let me know what you come up with!

:wink:

Rama

Dear Community,

The code in this node was first presented by Epic staff, Marc Audy, as code used in Fortnite.

I’ve fully implemented the code as well as making it user-friendly.

In particular I’ve presented a solution for ensuring you can spawn multiple instances of the same UE4 level, by giving you an “Instance Number” that you should increment each time you spawn an instance of a level.

This allows me to enable you to easily create as many uniquely translated and rotated instances of a level as you want!

This is ideal for Dynamic Level Generation!


![65784d2e1f959b9e9b4ea8e4d04f78a466d2e655.jpeg|2500x960](upload://etDY5PoTOTGDt1kztxp5EnB6wp7.jpeg)

![LoadLevelInst_Graph.jpg|1273x793](upload://xve7tvcTCpva9Kw6st1yY0YshPB.jpeg)

Can Include Landscapes and Other Fancy Level Features!

In my demo I included a landscape in my level “tile.”


**Level Scripting / Level Blueprint**

You can also include level scripting that will run uniquely per level isntance!

Victory Load Level Instance


**Latest plugin download on the UE4 Wiki: **
https://wiki.unrealengine.com/File:VictoryPlugin.zip

**Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki: **
https://wiki.unrealengine.com/File:VictoryPluginPackaged.zip

Victory Plugin on Media Fire

If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!

Please note clicking this link will not start a download instantly, it will just take you to the Media Fire file description.

Editor binaries and Packaged binaries in one file:
Win32 Shipping and Win64 Development Supported


**Note on Packaging Victory Plugin**

https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=368790&viewfull=1#post368790

Enjoy!

:)

Rama

Thanks for this Rama. I’ve been working on my own similar solution for the last few weeks in my spare time and while I got something working I find your method a better implementation than what I had going.

The only thing I notice is that the level loaded callback doesn’t seem to work when using your method. Do you have any idea why this is? Right now I use that to determine when all the levels are loaded and streamed in so I can do the next step in my process.

Here is my original function in which the callback did fire.





void ADreamProjectGameMode::SetupNonStreamingLevelLoad()
{  
	auto positionOffset = FVector();
	auto mapNames = GetAllMapNames();
	for (auto mapName : mapNames)
	{ 
		FString fullMapPath = FString::Printf(TEXT("/Game/Rooms/Maps/%s"), *mapName);
		UE_LOG(LogTemp, Warning, TEXT("Loading level %s"), *fullMapPath); 
		ULevelStreaming* pStreaming = UGameplayStatics::GetStreamingLevel(GetWorld(), *fullMapPath);

		if (pStreaming)
		{
			UE_LOG(LogTemp, Warning, TEXT("Streaming level setup for %s with transform offset of %f "), *fullMapPath, positionOffset.Y);
			//pStreaming->LevelTransform = FTransform(positionOffset); 
			pStreaming->bShouldBeLoaded = true;
			pStreaming->bShouldBeVisible = true;
			pStreaming->OnLevelLoaded.AddDynamic(this, &ADreamProjectGameMode::OnLevelLoaded);
			numLevelsToLoad++;
			positionOffset.X += 10;
		}
		else
		{
			UE_LOG(LogTemp, Warning, TEXT("Unable toload map %s"), *fullMapPath);
		}
	} 
}


So a followup. I did manage to get the callback firing. I had upgraded my engine and it seemed to no longer like UFUNCTION being on a private method so I removed the markup. I didn’t realize that was a prerequisite for using delegates.

That said I’m still suffering one issue where the transform applied to the streaming level does nothing. I can get the level to transform if I do it after the level is loaded via a function who’s name escapes me right now (ULevel member function called applytransform or something to that effect) but I get a lot of warnings about transforming static objects. My hopes were that applying the transform to the streaming level before it’s loaded would avoid those warnings. I’m not sure how critical they are but nevertheless I don’t like to have a lot of warnings.

I’m considering just authoring the different rooms in my level at non-overlapping positions and doing away with the whole transformation stuff for now because this issue is taking my time away from actually working on my game and since this is more of a small learning project for me it’s not absolutely critical that I author all rooms at 0,0,0 (although in a real project this would indeed be critical).

So between both Rama’s method and my method not seeming to use the level transform my guess is that something about the way I’ve authored my levels is causing the streaming transform to get ignored. I’ll post back if I can figure out why this is.

Did you add this line to my version to trigger the delegate?



pStreaming->OnLevelLoaded.AddDynamic(this, &ADreamProjectGameMode::OnLevelLoaded);


it would go here:



    StreamingLevel->LevelColor = FColor::MakeRandomColor();
    StreamingLevel->bShouldBeLoaded = true;
    StreamingLevel->bShouldBeVisible = true;
    StreamingLevel->bShouldBlockOnLoad = false;
    StreamingLevel->bInitiallyLoaded = true;
    StreamingLevel->bInitiallyVisible = true;


4 New Nodes For You! Sort Array of Int/Float and Int += and -= operators for faster integer math!

Dear Community,

I have 4 new BP nodes for you!


**Efficiently Sort Integer / Float Array**

Now you can easily and efficiently sort an integer or float array, with the smallest entry being put at index 0!

This modifies the original array, saving you from creating unnecessary duplicate array data.

So my BP sort node is very efficient!

![bbca2414d736997bb47f825479abe221c9369d8a.jpeg|1042x777](upload://qNgn3LnIAFwIWUcYraeqbrNSavw.jpeg)

Plus Equals and Minus Equals Integer Math Operators

Typically you have to Get an integer variable and then Set it with some value added/subtracted in order to modify an integer value.

I find this rather cumbersome, especially because in C++ there is the += and -= operators which make adding and subtracting from integers very fast!

Using my new BP Operators you can easily add a value to an integer or subtract a value from an integer!

Note my operator modifies the original value and returns it, so I cannot make these operators Pure. Execution pins are required because the value is getting modified.

a24b2aedf5eaa54e981a57d52b1f190e88861b58.jpeg


**The C++ Code Involved**

In order to make these 4 new nodes I took advantage of UPARAM(ref) which allows a BP variable to be modified in C++ and returned back to Blueprints.

I wrote a [wiki on UPARAM(ref)](https://wiki.unrealengine.com/How_To_Modify_Blueprint_Variable_References_In_C%2B%2B_Without_Copying)that you can enjoy!



```


void UVictoryBPFunctionLibrary::VictoryIntPlusEquals(UPARAM(ref) int32& Int, int32 Add, int32& IntOut)
{  
	Int += Add;
	IntOut = Int; 
} 
void UVictoryBPFunctionLibrary::VictoryIntMinusEquals(UPARAM(ref) int32& Int, int32 Sub, int32& IntOut)
{ 
	Int -= Sub;
	IntOut = Int; 
}


```


**Latest plugin download on the UE4 Wiki: **

**Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki: **


**Victory Plugin on Media Fire**

If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!

Please note clicking this link will not start a download instantly, it will just take you to the Media Fire file description.

**Editor binaries and Packaged binaries in one file:**
   *Win32 Shipping and Win64 Development Supported*
https://www.mediafire.com/?g6uf9kt5ueb2upj

Note on Packaging Victory Plugin

Enjoy!

:slight_smile:

Rama

Great new nodes!

Thanks! I always wondered why it isn’t there in the first place. You are awesome as always! :slight_smile:

I did indeed and the delegate is firing (it wasn’t previously due to the lack of UFUNCTION markup on the callback). The only issue right now is it seems to ignore the transform and always spawns the level at 0,0,0 regardless of what the transforms translation value is.

I’ll make a quick standalone project this weekend using engine source so I can put in some breakpoints and see what’s going on with the streaming level transform not functioning. If I have anything to share that might benefit the rest of the community I’ll make a proper thread to share my findings.

I’v found the ParticleSystemComponent has no GetColorParameter in blueprint, but only the Set one.
So I think this one will be a nice addition to the plugin:


FLinearColor UMyBlueprintFunctionLibrary::GetParticleSystemColorParameter(UParticleSystemComponent* particleSystem_, FName name_)
{
	if (!particleSystem_)
		return FLinearColor::Black;

	FLinearColor color_;
	particleSystem_->GetColorParameter(name_, color_);
	return color_;
}

Also, for better debugging, please check this feature request I’v posted in the “Feedback for epic” subforum, If you could implement that somehow, that would be great!

Hey I have an update on the level streaming transform not working and it’s a doozy.

If you use the default constructor for FRotator the function silently fails and does not transform your geo.

This invocation will fail



if (!LoadLevelInstance(
			GetWorld(),
			mapsFolder,
			mapName,
			levelIdx,
			positionOffset,
			FRotator()
			))


This will succeed



if (!LoadLevelInstance(
			GetWorld(),
			mapsFolder,
			mapName,
			levelIdx,
			positionOffset,
			FRotator(0,0,0)
			))


EDIT : Apologies if I polluted this thread. I’m a little new and may not have the right etiquette. Should I have started a new thread for this?

Naw, this is the right place for it. :slight_smile:

Hee hee!

You’re welcome Sahkan!

I already created a set of debug messages to give you class function and also exact line number here:

How to get a UE4 FString of Calling Class Function and Line Number

This is strange! And its true of all the gets, GetFloat, GetVector, etc very odd indeed.

I’ll look into this further :slight_smile:

:slight_smile:

Rama

**Thanks for sharing your research AlexM! **

It will surely help others out!

:slight_smile:

Rama

Get a Hard-drive accurate listing of all Save Game Objects!

29133cff34e19b6d5f6450f26dd03f0fbc0104a7.jpeg

Get a Hard-drive accurate listing of all Save Game Objects!

Dear Community,

This node gives you a hard-drive accurate listing of all save game files that you’ve created!

I am referring to UE4’s Save Object system!

You can now access a full listing in a developer build or in a packaged game, to know all the save files that have been saved!

These save files are stored in GameDir/Saved/SaveGames

26bed6e9726e2f5bd0c108371726fef9d0d800a1.jpeg


**UE4 Blueprint Save System?**

If you did not know, you can use UE4's save system like this:

1. Create a new blueprint based on SaveGame
2. Add your variables to the blueprint that you want to save the values of
3. in level BP or some other blueprint, create a save game object, and set the values of that object
4. Save this object to a Save Game Slot, as shown in my pictures
5. You can load a save game object from a Slot name at any time!

6.** Now with my new Victory BP Library, you can obtain a full listing of all existing save games as stored on your computer's hard disk! **This let's you know whether a file exists before you try to load it! You can also find out how many save files exist from within BP!

**Latest plugin download on the UE4 Wiki: **

**Latest plugin packaged binaries, Win32 Shipping and Win64 Development on UE4 Wiki: **


**Victory Plugin on Media Fire**

If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!

**Editor binaries and Packaged binaries in one file:**
   *Win32 Shipping and Win64 Development Supported*
https://www.mediafire.com/?g6uf9kt5ueb2upj

Enjoy!

:)

Rama

Thanks this is awesome!

Here is an other idea for a new node!
Make debug nodes that have Thickness input.
For the moment you can adjust the thickness only to DebugLines.
Just just you did your circle, use your math magic powers :stuck_out_tongue:

Sometimes I wonder how much of the victory plugin would be converted back to blueprint and setup as a BP macro library and BP function libary. Could be useful in its own right and would help one make the move from BP’s to C++ easily since theres so few C++ beginner tuts out there for UE4.

I beleive only draw debug line 3d does that and isnt used in traces. But im just guessing.