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

    #16
    This is what really has me excited for UE4 are the function libraries (via plugins especially). I could see these type of things doing well in the marketplace. I'll need to start designing more of my functions like this, very modular, and beneficial for all.


    Thanks rama
    Last edited by KRushin; 05-01-2014, 12:58 AM.
    Twitter - @TheKRushin

    Feel free to ask questions and come learn to be an #UnrealDev

    How to report a Bug

    Comment


      #17
      Originally posted by Jacky View Post
      Good to see your plugins back Rama! Are you going to recompile and reupload them for every new engine version in the future?
      Thanks again for sharing!
      Yup I will be keeping the Victory Blueprint Library updated, though remember I am including the entire source code, so anyone can rebuild my plugin if they feel I am not fast enough

      Great to hear from you Jacky!

      ~~~

      Ragdoll + Animation Blend

      Wow lot of interest in this! I will check it out.

      For those who want to poke about, check out primitivecomponent.h, there are these functions:

      Code:
      /**
      	 *	'Wake' physics simulation for a single body.
      	 *	@param	BoneName	If a SkeletalMeshComponent, name of body to wake. 'None' indicates root body.
      	 */
      	UFUNCTION(BlueprintCallable, Category="Physics")
      	void WakeRigidBody(FName BoneName = NAME_None);
      Code:
      	/** 
      	 *	Force a single body back to sleep. 
      	 *	@param	BoneName	If a SkeletalMeshComponent, name of body to put to sleep. 'None' indicates root body.
      	 */
      	UFUNCTION(BlueprintCallable, Category="Physics")
      	void PutRigidBodyToSleep(FName BoneName = NAME_None);
      Code:
      /**
      	 *	Force all bodies in this component to sleep.
      	 */
      	virtual void PutAllRigidBodiesToSleep();
      Code:
      	/**
      	 *	Returns if a single body is currently awake and simulating.
      	 *	@param	BoneName	If a SkeletalMeshComponent, name of body to return wakeful state from. 'None' indicates root body.
      	 */
      	bool RigidBodyIsAwake(FName BoneName = NAME_None);
      Code:
      	/**
      	 *	Returns if any body in this component is currently awake and simulating.
      	 */
      	virtual bool IsAnyRigidBodyAwake();
      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


        #18
        Originally posted by Mark Rein View Post
        This is so cool! Thanks so much for supporting the UE4 community!

        If we're ever in the same city I'd love to buy you lunch!

        Please feel free to private message me with your contact details.
        Great to hear from you Mark Rein!

        I did PM you

        Thank you for your life's work / UE4!

        UE4 is so much fun!



        Rama
        Last edited by Rama; 05-01-2014, 01:50 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


          #19
          Hey Rama,

          Thanks for so many great contributions so far!

          I've tried to adapt your BP Ragdoll functions for use on character death, but the location/rotation are tripping me up - instead of respawning at a spawn point, the character is brought to the location of their ragdoll/death. Any ideas on how to circumvent that?

          Comment


            #20
            Originally posted by Havoc View Post
            Hey Rama,

            Thanks for so many great contributions so far!

            I've tried to adapt your BP Ragdoll functions for use on character death, but the location/rotation are tripping me up - instead of respawning at a spawn point, the character is brought to the location of their ragdoll/death. Any ideas on how to circumvent that?
            I am making a node for this, in a general purpose way.

            For those wanting to do this immediately on their own:

            ~~~

            If you have a reference to the player start you want to use, you can

            1. end ragdoll
            2. set actor location to the location of the player start
            3. set actor rotation to the rotation of the player start

            I could design a node to do this, but you'd still have to Get the Location and Rotation of the player start, so its really not that much of a shortcut



            Rama

            PS: click on the playerstart in the world, then open the graph and you can add reference
            Attached Files
            Last edited by Rama; 05-01-2014, 02:11 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


              #21
              Teleport Actor To Actor

              This can be used after ending ragdoll, to send the player to a player start, or a trigger, a check point, or any actor really

              My node causes the player to face the exact rotation of the playerstart/trigger/checkpoint/ other actor

              Returns false if one of the inputs was not valid.

              Enjoy!

              Click image for larger version

Name:	teleportactortoactor.jpg
Views:	1
Size:	64.1 KB
ID:	1050345

              ~~~

              C++ Source Code

              Remember I always include the entire C++ source code for all of the Victory BP Library Nodes in the actual plugin download!

              Here's the .cpp for this new node

              Code:
              bool UVictoryBPFunctionLibrary::Actor__TeleportToActor(AActor* ActorToTeleport, AActor* DestinationActor)
              {
              	if(!ActorToTeleport) return false;
              	if(!ActorToTeleport->IsValidLowLevel()) return false;
              	if(!DestinationActor) return false;
              	if(!DestinationActor->IsValidLowLevel()) return false;
              	
              	//Set Loc
              	ActorToTeleport->SetActorLocation(DestinationActor->GetActorLocation());
              	
              	//Set Rot
              	ActorToTeleport->SetActorRotation(DestinationActor->GetActorRotation());
              	
              	return true;
              }
              Last edited by Rama; 05-01-2014, 02:45 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


                #22
                More Pics

                Here's some more pics of nodes I am giving you in this plugin, no C++ compile required!

                Find out if game is the foreground window, and freeze/unfreeze Render Thread
                Click image for larger version

Name:	gamewindowforeground.jpg
Views:	1
Size:	157.3 KB
ID:	1050375

                Distance from point to Surface of Mesh
                Click image for larger version

Name:	pointtosurface.jpg
Views:	2
Size:	44.2 KB
ID:	1050376

                Save Text to Hard Disk
                Click image for larger version

Name:	SaveTextToHardDisk.jpg
Views:	2
Size:	65.2 KB
ID:	1050377

                Viewport Functions
                Click image for larger version

Name:	ViewportFunctionsBP.jpg
Views:	1
Size:	287.6 KB
ID:	1050378

                Determine if current world is Editor or PIE or Game Instance
                Click image for larger version

Name:	EditorPIEOrGameWorld.jpg
Views:	1
Size:	89.8 KB
ID:	1050379

                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


                  #23
                  Installation

                  1. put the .zip contents in a folder in your main directory where your .uproject is, called "Plugins" (name most be precise)

                  2. open editor and go to window->plugins

                  3. make sure my Victory Plugin is checked off as being active...
                  I did that, but I don't see any Victory Plugin.

                  But if I put it inside the engine plugin folder instead, it shows.
                  Last edited by Alex3d; 05-01-2014, 07:24 PM.
                  BASIC version can also be bought on Marketplace.
                  PRO version can be bought on my site only.
                  www.3dalex.com

                  Comment


                    #24
                    Originally posted by Alex3d View Post
                    I did that, but I don't see any Victory Plugin.
                    Make sure it looks something like: Unreal Projects->YourProjectName->Plugins->PLUGIN_VictoryBPLibrary

                    Comment


                      #25
                      Originally posted by HJPL View Post
                      Make sure it looks something like: Unreal Projects->YourProjectName->Plugins->PLUGIN_VictoryBPLibrary
                      I tried that, but the plugin didn't appear on the plugins list. But if I put it inside the engine plugin folder( UnrealEngine-4.1\Engine\Plugins ) instead, it shows.
                      BASIC version can also be bought on Marketplace.
                      PRO version can be bought on my site only.
                      www.3dalex.com

                      Comment


                        #26
                        Originally posted by Alex3d View Post
                        I tried that, but the plugin didn't appear on the plugins list. But if I put it inside the engine plugin folder( UnrealEngine-4.1\Engine\Plugins ) instead, it shows.
                        Hmm, I've got it working fine from the project folder. It doesn't appear in the default list of plugins on the right, it's in a category at the bottom of the list on the left. I almost overlooked it.

                        Comment


                          #27
                          Originally posted by Xodroc View Post
                          Hmm, I've got it working fine from the project folder. It doesn't appear in the default list of plugins on the right, it's in a category at the bottom of the list on the left. I almost overlooked it.
                          Yes all the engine plugins are at the top, and the bottom is for project context, I believe

                          Alex3d let us know if this info helps at all!

                          Here's a pic



                          Rama
                          Last edited by Rama; 05-01-2014, 10: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


                            #28
                            New BP Node

                            Clone Static Mesh Actor

                            Clones the mesh, materials, rotation, location, and physics state of a Static Mesh Actor.

                            You can set an optional offset of location and rotation from the original!

                            This is done during game-time!

                            You can clone the output of this node, to creating a series of actors rotated / translated from the original (like an array in 3ds max)

                            Or, you can numerically increment the location and rotation offsets and keep using the original in a for loop !



                            ~~~

                            Picture

                            Click image for larger version

Name:	CloneStaticMesh.jpg
Views:	1
Size:	124.9 KB
ID:	1050391

                            ~~~

                            C++ Code

                            Code:
                            AStaticMeshActor* UVictoryBPFunctionLibrary::Clone__StaticMeshActor(UObject* WorldContextObject, bool&IsValid, AStaticMeshActor* ToClone, FVector LocationOffset,FRotator RotationOffset)
                            {
                            	IsValid = NULL;
                            	if(!ToClone) return NULL;
                            	if(!ToClone->IsValidLowLevel()) return NULL;
                            	//~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            	
                            	if(!WorldContextObject) return NULL;
                            	
                            	//using a context object to get the world!
                                UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
                            	if(!World) return NULL;
                            	//~~~~~~~~~~~
                            	
                            	//For BPS
                            	UClass* SpawnClass = ToClone->GetClass();
                            	
                            	FActorSpawnParameters SpawnInfo;
                            	SpawnInfo.bNoCollisionFail 		= true;
                            	SpawnInfo.Owner 				= ToClone;
                            	SpawnInfo.Instigator				= NULL;
                            	SpawnInfo.bDeferConstruction 	= NULL;
                            	
                            	AStaticMeshActor* NewSMA = World->SpawnActor<AStaticMeshActor>(SpawnClass, ToClone->GetActorLocation() + FVector(0,0,512) ,ToClone->GetActorRotation(), SpawnInfo );
                            	
                            	if(!NewSMA) return NULL;
                            	
                            	//Copy Transform
                            	NewSMA->SetActorTransform(ToClone->GetTransform());
                            	
                            	//Mobility
                            	NewSMA->StaticMeshComponent->SetMobility(EComponentMobility::Movable	);
                            	
                            	//copy static mesh
                            	NewSMA->StaticMeshComponent->SetStaticMesh(ToClone->StaticMeshComponent->StaticMesh);
                            	
                            	//~~~
                            	
                            	//copy materials
                            	TArray<UMaterialInterface*> Mats;
                            	ToClone->StaticMeshComponent->GetUsedMaterials(Mats);
                            	
                            	const int32 Total = Mats.Num();
                            	for(int32 v = 0; v < Total; v++ )
                            	{
                            		NewSMA->StaticMeshComponent->SetMaterial(v,Mats[v]);
                            	}
                            	
                            	//~~~
                            	
                            	//copy physics state
                            	if(ToClone->StaticMeshComponent->IsSimulatingPhysics())
                            	{
                            		NewSMA->StaticMeshComponent->SetSimulatePhysics(true);
                            	}
                            	
                            	//~~~
                            	
                            	//Add Location Offset
                            	const FVector SpawnLoc = ToClone->GetActorLocation() + LocationOffset;
                            	NewSMA->SetActorLocation(SpawnLoc);
                            	
                            	//Add Rotation offset
                            	FTransform TheTransform = NewSMA->GetTransform();
                            	TheTransform.ConcatenateRotation(RotationOffset.Quaternion());
                            	TheTransform.NormalizeRotation();
                            	
                            	//Set Transform
                            	NewSMA->SetActorTransform(TheTransform);
                            	
                            	IsValid = true;
                            	return NewSMA;
                            }
                            Last edited by Rama; 05-01-2014, 11:16 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


                              #29
                              Originally posted by Rama View Post
                              Yes all the engine plugins are at the top, and the bottom is for project context, I believe

                              Alex3d let us know if this info helps at all!

                              Here's a pic



                              Rama
                              Thanks. I probably overlooked it, because it is there.

                              Looking at your wiki...
                              10. You should now see the Victory Editor HotKeys button in the top left
                              I don't see this at all. Only the V snap to vertice feature is working. U and Y does nothing.
                              Last edited by Alex3d; 05-02-2014, 12:57 AM.
                              BASIC version can also be bought on Marketplace.
                              PRO version can be bought on my site only.
                              www.3dalex.com

                              Comment


                                #30
                                Originally posted by Alex3d View Post
                                Thanks. I probably overlooked it, because it is there.

                                Looking at your wiki...
                                I don't see this at all. Only the V snap to vertice feature is working. U and Y does nothing.
                                I've noticed it doesn't seem to work with meshes that are in a blueprint(Did I miss something?), Y doesn't work if the object is over a brush/CSG geometry, works fine when over another static mesh or landscape.

                                Comment

                                Working...
                                X