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

    Get OS Platform

    Now you can perform different actions based on which OS is currently being used!

    Click image for larger version

Name:	OSGet.jpg
Views:	7
Size:	127.5 KB
ID:	1066574

    Platforms you can check for:

    Windows
    Mac
    Linux

    PS4
    XBoxOne

    iOS
    Android

    HTML5

    WIN RT
    WIN RT ARM


    Enjoy!

    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


      I have a problem with the "Get static mesh vertex locations" node.

      It doesn't work it a packed game.

      Blueprint:
      Click image for larger version

Name:	System.PNG
Views:	1
Size:	114.3 KB
ID:	1066577

      Editor:
      Click image for larger version

Name:	Editor.PNG
Views:	1
Size:	975.5 KB
ID:	1066578

      Packed:
      Click image for larger version

Name:	Packed.jpg
Views:	1
Size:	165.8 KB
ID:	1066582

      I've also tried to use this node from the game code and not as a plugin and it gave me the save results.

      The level builder system i'm making is really depended on this node, please help :|
      Attached Files
      Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

      Comment


        @Sahkan

        "It doesn't work it a packed game."

        I have had the same experience and reported this to epic a while back

        I've experienced this issue with getting vertex locations in packaged games since 4.3

        If you start a new Answerhub, link me and I can add more info to your report

        Please include your pictures and then I can add info, you could also add my code below to the initial post.

        ~~~

        For Epic Staff:

        Here's the code being used that works perfect in pre-packaged game and does not work in packaged game.

        It seems that using the Render Data / LOD info in packaged game does not work some reason?

        Code:
        Comp->StaticMesh->RenderData->LODResources[0].PositionVertexBuffer
        Is there an after-packaging better way to get the vertex position info?

        Please note the rotation/translation of each vertex is scaled by the FTransform to match actor scaling and rotation.

        Code:
        Comp->GetComponentLocation() + RV_Transform.TransformVector(VertexBuffer->VertexPosition(Itr))
        ~~~

        Entire C++ Code

        Code:
        bool UVictoryBPFunctionLibrary::GetStaticMeshVertexLocations(UStaticMeshComponent* Comp, TArray<FVector>& VertexPositions)
        {
        	if(!Comp) return false;
        	if(!Comp->IsValidLowLevel()) return false;
        	
        	//~~~~~~~~~~~~~~~~~~~~
        	//				Vertex Buffer
        	if(! Comp) 									return false;
        	if(! Comp->StaticMesh) 					return false;
        	if(! Comp->StaticMesh->RenderData) 	return false;
        	if( Comp->StaticMesh->RenderData->LODResources.Num() < 1) return false;
        	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        	
        	//~~~ End of Pointer Safety Checks ~~~
        	
        	//~~~~~~~~~~~~
        	VertexPositions.Empty();
        	//~~~~~~~~~~~~
        	
        	FPositionVertexBuffer* VertexBuffer = NULL;
        	VertexBuffer = & Comp->StaticMesh->RenderData->LODResources[0].PositionVertexBuffer;
        	if(!VertexBuffer) return false;
        	//~~~~~~~~~~~~~~~~
        	
        	int32 VertexCount = VertexBuffer->GetNumVertices();
        	 
        	FTransform RV_Transform = Comp->GetComponentTransform(); 
        	for(int32 Itr = 0; Itr < VertexCount; Itr++)
        	{
        		VertexPositions.Add(
        			Comp->GetComponentLocation() + RV_Transform.TransformVector(VertexBuffer->VertexPosition(Itr))
        		);
        	}
        	
        	return true;
        }
        Rama
        Last edited by Rama; 02-16-2015, 10:40 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


          This is the link to the AnswerHub page:
          https://answers.unrealengine.com/que...cked-game.html
          Thanks for the help rama, it was really frustrating to debug this thing, i really need it to work, i hope they fix it soon or at least find a workaround.
          Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

          Comment


            It seems like this is a known issue :
            https://wiki.unrealengine.com/Access...tions_in_build

            And this wiki page has a link to rama tutorial ( Integrating PhysX Code into Your Project )
            Maybe Rama can make some super node for us out of all this information ?
            Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

            Comment


              Originally posted by Sahkan View Post
              It seems like this is a known issue :
              https://wiki.unrealengine.com/Access...tions_in_build

              And this wiki page has a link to rama tutorial ( Integrating PhysX Code into Your Project )
              Maybe Rama can make some super node for us out of all this information ?
              Wow that's an awesome wiki by Vebski, thank you Vebski!

              I will try turning that into a BP node shortly.

              I also posted in your answerhub Sahkan!



              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


                Improved Get Vertex Locations of Static Mesh

                Now works in Packaged Games


                Click image for larger version

Name:	VertexPositions.jpg
Views:	15
Size:	176.5 KB
ID:	1066648

                I have re-written my Get Vertex Positions BP node so that it works in packaged games!

                Special thanks to Vebski for pointing out that using a PhysX method does work in packaged games!

                ~~~

                My C++ Code For You

                See my PhysX wiki for the basic build.cs setup:
                https://wiki.unrealengine.com/PhysX,...o_Your_Project

                Here is the code I wrote to get all of the transformed vertex positions using the Body Instance and PhysX code!

                I am doing many safety checks to ensure the Body Instance data is valid before utilizing it, and the result is that now you can get accurate vertex locations in packaged games!

                Code:
                //~~~ PhysX ~~~
                #include "PhysXIncludes.h"
                #include "PhysicsPublic.h"		//For the ptou conversions
                //~~~~~~~~~~~
                
                //Get Transformed Vertex positions of any static mesh! -Rama
                bool UVictoryBPFunctionLibrary::GetStaticMeshVertexLocations(UStaticMeshComponent* Comp, TArray<FVector>& VertexPositions)
                {
                	
                	if(!Comp || !Comp->IsValidLowLevel()) 
                	{
                		return false;
                	}
                	//~~~~~~~~~~~~~~~~~~~~~~~
                	
                	//Component Transform
                	FTransform RV_Transform = Comp->GetComponentTransform(); 
                	
                	//Body Setup valid?
                	UBodySetup* BodySetup = Comp->GetBodySetup();
                	
                	if(!BodySetup || !BodySetup->IsValidLowLevel())
                	{
                		return false;
                	}  
                	
                	//Get the Px Mesh!
                	PxTriangleMesh* TriMesh = BodySetup->TriMesh;
                	 
                	if(!TriMesh) 
                	{
                		return false;
                	}
                	//~~~~~~~~~~~~~~~~
                	
                	//Number of vertices
                	PxU32 VertexCount 			= TriMesh->getNbVertices();
                	
                	//Vertex array
                	const PxVec3* Vertices 	= TriMesh->getVertices();
                	
                	//For each vertex, transform the position to match the component Transform 
                	for(PxU32 v = 0; v < VertexCount; v++)
                	{ 
                		VertexPositions.Add(RV_Transform.TransformPosition(P2UVector(Vertices[v])));
                	}
                	
                	return true;
                }


                UE4 Wiki, Plugin Download Page
                https://wiki.unrealengine.com/File:VictoryPlugin.zip

                Enjoy!



                Rama
                Last edited by Rama; 02-17-2015, 08:59 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


                  This is awesome ! Funny how you used a tutorial that used yours, you guys are helping each other XD
                  Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

                  Comment


                    Hello Rama!

                    I have issues compiling for Android, I didnt try compiling for iOS yet!
                    I use Unreal Engine 4.6.1, your plugin is from today from the wikipage!
                    https://forums.unrealengine.com/show...oid#post122369

                    I have excactly this issue.

                    Comment


                      Originally posted by Eduard Gotwig View Post
                      Hello Rama!

                      I have issues compiling for Android, I didnt try compiling for iOS yet!
                      I use Unreal Engine 4.6.1, your plugin is from today from the wikipage!
                      https://forums.unrealengine.com/show...oid#post122369

                      I have excactly this issue.
                      Well I'm definitely using 4.6.1 for the plugin builds, if nothing else we can wait till 4.7 official release which should be quite soon, and try again then.

                      The person who posted the above post found this to be the reason for their error:

                      "Edit - I figured out the problem - stupid me used a wrong version of the plugin when I pasted it into my temp project directory. If you see this problem with others, I'm pretty sure that's what the problem was. Thanks for the great plugin."
                      Last edited by Rama; 02-18-2015, 09:58 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


                        Originally posted by Sahkan View Post
                        This is awesome ! Funny how you used a tutorial that used yours, you guys are helping each other XD
                        Hee hee yea!

                        Sharing makes us all stronger!



                        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


                          A couple of BP node questions and suggestions here with some background.

                          Background
                          Originally, I wanted to use an array of structs to manage data records. Each record could then have its own array of tags (defined in a BP enum). I could then add, remove, and check for tags whenever I want to affect gameplay and visuals.

                          However, there is a massive, completely ridiculous problem constantly plaguing all of my projects: arrays of structs are currently busted in BP as you can't set the member variables of individual structs in the array. Technically, you can replace the original struct in the array with a newly-built struct. However, that's only true when the array is the original. In my case, I'm using a function to search through my records and return a separate search results array. If I were to use the old make-and-replace hack, it would only affect the search results array; the original data would never be touched.

                          Therefore, in my current project, I'm saving data to an array of strings. Each of those strings is a list of tags separated by commas. Mockup:
                          Code:
                          {"road,built", "bridge", "bridge,built", "road", ""}
                          This gives me the freedom to add, remove, and check for as many arbitrary tags that I want. However, adding additional data complicates things. With existing string manipulation, something like this is possible but unwieldy:
                          Code:
                          {"position:north|tags:road,built", "position:east|tags:bridge,broken"}
                          I'd love to use TMaps or Objects, but neither of them can be replicated.


                          Questions
                          Can TMaps components be made replicable?

                          Currently, TMaps crash the editor when their key/value pair isn't found. Learned that when testing whether or not they replicated. Turns out, they don't :P Is it possible to implement some error handling and a PairFound boolean?


                          Suggestions
                          A string array to string (collapse/flatten) node (with deliminator string) would be nice.

                          Regular expressions are probably a can of worms you don't want to open, but they would be quite useful.

                          JSON, another can of worms, could replace the monstrosity that is Structs, assuming the output could be saved to a string for easy replication. Edit: found an existing JSON plugin. I'll test it out once it's updated to 4.6.1.

                          An in-memory (fileless) ini stored in a single string (so that it could be added to an array) could also fill the role quite nicely without becoming overcomplicated.


                          Finally, thanks for all the work you've put into these nodes. They're quite useful.
                          Last edited by OhiraKyou; 02-19-2015, 04:52 AM.
                          [VR Demo] Crystal Coaster (Oculus forums)

                          Comment


                            No it wasnt a wrong version, you simply dont ship the binaries (dll) for Android, or iOS, or linux or mac ;P
                            So i had to rebuild the solution, and compile to the targets (android, ios, etc.) in shipping mode.
                            Now it works.
                            Thanks.

                            Btw rama: why dont you include stuff like a node for remove playercontroller, or spawning actors from construction script? I can give you my bp library if you want.

                            Greetings, Ed

                            Comment


                              Originally posted by OhiraKyou View Post
                              Currently, TMaps crash the editor when their key/value pair isn't found... Is it possible to implement some error handling and a PairFound boolean?
                              I have reproduced and fixed this crash! See below!

                              ~~~

                              Victory BP TMap Component Update!

                              Each of the Get Nodes will now also return a bool to let you know if a valid pair was found!

                              If you were getting crashes when trying to access an invalid pair, make sure to get my latest version, which fixes this crash!

                              Click image for larger version

Name:	IsValidCheckOnGet.jpg
Views:	3
Size:	186.2 KB
ID:	1066774

                              UE4 Wiki, Plugin Download Page
                              https://wiki.unrealengine.com/File:VictoryPlugin.zip

                              Enjoy!



                              Rama
                              Last edited by Rama; 02-19-2015, 06:58 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


                                HTML5 Emscripten export fails:

                                Code:
                                 LogPlayLevel:Display: UnrealBuildTool: C:/Program Files/Emscripten/clang/e1.25.0_64bit\llvm-link: link error in 'C:\Users\xxx\Desktop\game\Plugins\VictoryPlugin\Binaries\HTML5\CarCarCar-VictoryBPLibrary-Static.bc': Linking globals named '_ZN5physx28gUnifiedHeightfieldCollisionE': symbol multiply defined!
                                LogPlayLevel:Display: UnrealBuildTool: Traceback (most recent call last):
                                LogPlayLevel:Display: UnrealBuildTool:   File "C:\Program Files\Emscripten\emscripten\1.25.0\emcc", line 1167, in <module>
                                LogPlayLevel:Display: UnrealBuildTool:     shared.Building.link(linker_inputs, in_temp(target_basename + '.bc'), force_archive_contents=len([temp for i, temp in temp_files if not temp.endswith(STATICLIB_ENDINGS)]) == 0)
                                LogPlayLevel:Display: UnrealBuildTool:   File "C:\Program Files\Emscripten\emscripten\1.25.0\tools\shared.py", line 1330, in link
                                LogPlayLevel:Display: UnrealBuildTool:     assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output
                                LogPlayLevel:Display: UnrealBuildTool: AssertionError: Linking error:
                                LogPlayLevel:Display: UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
                                LogPlayLevel:Display: UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Users\xxx\Desktop\game\Binaries\HTML5\CarCarCar.js
                                
                                s

                                Comment

                                Working...
                                X