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

Could you post a fix here? I’m currently stuck on .

IsValidIndex fix:



    DECLARE_FUNCTION(execArray_IsValidIndex)
    {
        Stack.MostRecentProperty = nullptr;
        Stack.StepCompiledIn<UArrayProperty>(NULL);
        void* ArrayAddr = Stack.MostRecentPropertyAddress;
        UArrayProperty* ArrayProperty = Cast<UArrayProperty>(Stack.MostRecentProperty);
        if (!ArrayProperty)
        {
            Stack.bArrayContextFailed = true;
            return;
        }
        P_GET_PROPERTY(UIntProperty, Index);
        P_FINISH;

        bool WasValid = GenericArray_IsValidIndex(ArrayAddr, ArrayProperty, Index);
        *(bool*)RESULT_PARAM = WasValid;
    }




bool UVictoryBPFunctionLibrary::GenericArray_IsValidIndex(void* TargetArray, const UArrayProperty* ArrayProp, int32 Index)
{
    bool bResult = false;

    if (TargetArray)
    {
        FScriptArrayHelper ArrayHelper(ArrayProp, TargetArray);
        bResult = ArrayHelper.IsValidIndex(Index);
    }

    return bResult;
}

I’m still getting crashes.

Hey , your LoadTexture2D_FromFileByExtension node isn’t working correctly for me any more in 4.9, I’m getting a sort of hue shifted effect:

RIAK4bK.png

How the colours should look:

G2k8WOa.png

edit:
Changing
Texture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);

to

Texture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_R8G8B8A8;

fixes it

I have a problem with a linux build. I tried a version of the plugin from June and also a version from 08-26-15. The both had error. Any ideas?

Thanks for your awesome plugin!

Edit: Fixed, see below

Funny, that’s what my version already has.
I must have updated it a while back without sending it to .
My bad :frowning:

fixed my problem as well. Thanks Stormwind!

I’m getting an error saying “VictoryPlugin could not be loaded because the module VictoryBPLibrary could not be found.” I’ve looked in the plugin’s Source folder and… well… it’s right there. Not sure what the plugin is not seeing that I can.

Dear ,

I just checked and the current version of the function has source code, which includes your fix, nice to hear from you!

is the most recent Victory Plugin on mediafire and the wiki



UTexture2D* UVictoryBPFunctionLibrary::LoadTexture2D_FromFileByExtension(const FString& ImagePath, bool& IsValid, int32& OutWidth, int32& OutHeight)
{
	UTexture2D* Texture = nullptr;
	IsValid = false;

	// To avoid log spam, make sure it exists before doing anything else.
	if (!FPlatformFileManager::Get().GetPlatformFile().FileExists(*ImagePath))
	{
		return nullptr;
	}

	TArray<uint8> CompressedData;
	if (!FFileHelper::LoadFileToArray(CompressedData, *ImagePath))
	{
		return nullptr;
	}
	
	IImageWrapperPtr ImageWrapper = GetImageWrapperByExtention(ImagePath);

	if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(CompressedData.GetData(), CompressedData.Num()))
	{ 
		const TArray<uint8>* UncompressedRGBA = nullptr;
		
		if (ImageWrapper->GetRaw(ERGBFormat::RGBA, 8, UncompressedRGBA))
		{
			Texture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_R8G8B8A8);
			
			if (Texture != nullptr)
			{
				IsValid = true;
				
				OutWidth = ImageWrapper->GetWidth();
				OutHeight = ImageWrapper->GetHeight();

				void* TextureData = Texture->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
				FMemory::Memcpy(TextureData, UncompressedRGBA->GetData(), UncompressedRGBA->Num());
				Texture->PlatformData->Mips[0].BulkData.Unlock();
				Texture->UpdateResource();
			}
		}
	}

	return Texture;
}


:slight_smile:

You’re welcome, and I am glad Stormwind’s Linux packaging fix worked for you!

:slight_smile:

Yes, sorry about that guys, I’ve just realized I’d coppied in an older version that I had broken myself, not the latest :eek:

good, hee hee!

:slight_smile:

In regard to IsValidIndex

I can confirm I was still getting crashes too, I looked into the code and fixed it, here is the correct .h file for 4.9.0



/* 
 *See if index is a valid index for  array
 *    
 *@param    TargetArray        The array to perform the operation on
 *@param    Index            The index to check.
 *@return    Bool if integer is valid index for  array
*/
UFUNCTION(Category="VictoryBPLibrary|Utilities|Array", BlueprintPure, CustomThunk, meta=(DisplayName = "Valid Index", CompactNodeTitle = "VALID INDEX", ArrayParm = "TargetArray"))
static bool Array_IsValidIndex(const TArray<int32>& TargetArray, int32 Index);

static bool GenericArray_IsValidIndex(void* TargetArray, const UArrayProperty* ArrayProp, int32 Index);
  
DECLARE_FUNCTION(execArray_IsValidIndex)
{
	Stack.MostRecentProperty = nullptr;
	Stack.StepCompiledIn<UArrayProperty>(NULL);
	void* ArrayAddr = Stack.MostRecentPropertyAddress;
	UArrayProperty* ArrayProperty = Cast<UArrayProperty>(Stack.MostRecentProperty);
	if (!ArrayProperty)
	{
		Stack.bArrayContextFailed = true;
		return;
	}
	P_GET_PROPERTY(UIntProperty, Index);
	P_FINISH;

	bool WasValid = GenericArray_IsValidIndex(ArrayAddr, ArrayProperty, Index);
	*(bool*)RESULT_PARAM = WasValid;
}


Uploading new plugin version shortly.

:slight_smile:

My plugin is now on 4.9.0, please use prior versions if you are using a prior engine version :slight_smile:

Unfortunately I have no easy way to notate on the wiki which version corresponds to which date.

:slight_smile:

New Plugin Version, IsValidIndex crashfix

Dear Community,

I’ve posted a new version of my Victory BP Library where IsValidIndex no longer crashes.

Again please note the plugin is now on UE4 version 4.9.0**
**


**Latest plugin download on the UE4 Wiki: (15.22 mb) **
https://wiki.unrealengine.com/File:VictoryPlugin.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 link will not start a download instantly, it will just take you to the Media Fire file description.


**Note on Packaging Victory Plugin**

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

Enjoy!

:)

Thing is, I was using Unreal 4.9.0 already.

I just downloaded your newest version, the one from today, and now I get the following error message:

Rebuilding them as the engine suggests does not work. It crashes on build/cannot be built.

Perhaps it’s important I mention I’m on Mac OSX. Are these Mac OSX compatible?

I’ve been using the BP library for a while and recently tried your engine plugin since I noticed it was updated for 4.9. Been playing around with the instanced mesh creation to test the limits and so far it is working great =D; Wish I had it installed sooner!

In the original instances I was using the node, everything was fine with the first fix.
Further usage caused crash :frowning:
Found the and fixed it, but before I get the to send it to, he’s already sorted it and contacted me!

http://i0.kym-cdn.com/photos/images/original/000/168/578/3ONqv.gif

I guess I also fixed once before for Linux dedicated server build and I completely forgot. Too much on the mind. I’m posting in case it is useful for someone else.

I’d appreciate it if someone who has Mac OS can build the plugin from source code, and post it to me by PM. I can’t help folks with Mac OS otherwise :slight_smile:


@Parvan

Thank you for sharing your Linux research / confirmation of Stormwind's fixes!

Thank you again for your contributions !

:slight_smile:



[QUOTE=Aesais;372221]
I've been using the BP library for a while and recently tried your engine plugin since I noticed it was updated for 4.9. Been playing around with the instanced mesh creation to test the limits and so far it is working great =D; Wish I had it installed sooner!
[/QUOTE]


Very nice to hear from you Aesais!

**Welcome to the UE4 Forums!**

:)