Generic and decoupled code is the way
I use an info container system where code keeps up with items its storing only when its part of it.
The next level up the chain has no record that the items below it exists until it has to store them.
So the mag acquires bullets that hold data that the gun collects from as many mags as it holds to make Projectiles. But doesn’t need the inventory to do it. Nor do attachments affect it if they aren’t present.
And mags do there own calculation without the gun for add & remove.
The struct arrays get a bit big and sort of a pain. but they really keep it organized
I think every item should stand on its own and call events to interacting items. In my personal guncode i have rewritten it so deeply and isolated from the plugin and character, that i could rip it out of the vr plugin and use it anywhere there is a way to pick it up. I could even ditch mags and spawn and attach it to be like a tank cannon. Interface commands are a beautiful thing.
How can i find your patron. I dont normally donate regularly. But your plugin and template was the ground floor that i learned to code off of.
I was actually getting ready to give up because in my first month i wasnt even able to accomplish anything with the standard templates.
But i have vastly improved and even widened the scope of my first game because i have caught on since then, and gotten a bit of a foothold.
I definitely didnt have the skill at the time to write a pawn from scratch to get started, or grip code, or polish it. Or evenaa gun for that matter. and now that i do its has saved me several months to a year to keep using it, beings i work entirely on weekends and on my own.
Not to mention youve answered almost all of my questions and all has all been free.
Id gladly donate to plugin
Edit i found it. Extremely small text on my phone
Listing recent commits in an update post, keep in mind that some of these are a week or two old but weren’t worth making a post about just for them alone.
I am re-compiling the 4.20 binaries and will upload when done.
**4.19 and 4.20 changes (got back ported to 4.19)**
Simplified and improved the HybridWithSweep grip type.
It should now performs less operations while also being of a higher quality.
Allow gripping static mobility objects if the grip type is custom..why not
Corrected a bad commit on the dial component that was causing some incorrect rotations.
Moved SetHeld being called when an object is dropped to before OnGripReleased
is called.
Also moved it before OnSecondaryRelease is called
Also moved the call to the objects own OnRelease to before its parent
OnChildGripReleased as it makes sense that the object performs actions on
itself first.
brings the flow of execution for dropping to parity with how it is done on grip.
**4.20 only**
Added GripStruct input Add/Remove Secondary Attachment point functions
Many many optimizations and clean ups regarding the gripping and dropping functions, lowering code bloat.
Added GripID as an input to DropObject and DropObjectByInterface, if the passed in object is
empty it will attempt to use the grip ID to drop instead.
I also added INVALID_VRGRIP_ID = 0 define for code use and locked out index 0 from being
used as a grip id, lowers the total number of possible simultanious grips per hand from 127 to 126.
Exposed the GripMotionControllers DefaultGripScript pointer to blueprints so
that people can access it and set variables on it (if it is a blueprint base script that is).
Also Changed the default and gun tools grip scripts so that the pivot point is attained
from the ParentTransform instead of getting the controller location again. is not
only slightly faster, but it also allows people to override the parent transform with something
else (say a remote component) so that the grip doesn't have to be based on the controller
itself.
(force/remote grips for instance could provide a proxy components transform instead)
Took a byte out of the positional replication for controllers and camera
by making the logical assumption that 419.43 meters is a size big enough for any
current roomscale technology.
THEN Took back 1 of the 8 bits that I saved everyone in order to add a
flag for quantization of the rotation on controllers / cameras.
You can now set it from its default Short quantization to a 10 bit per axis
quantization method, effectivly saving 2.5 bytes per rep and with 4x the granularity
of the engine BYTE rotator quantization.
makes up for the lack of precision on the BYTE method but still allows for some
decent savings.
Also dropped a byte out of the CustomVRInputVector and RequestedVelocityVector.
41,943.04 UU's should be MORE than enough leg room for these values.
Also am now rounding MoveAction_Custom vector values to 2 digit precision. I was
already doing for all built in movement actions but the custom ones should
also be restricted like .
Thanks for the update !
Is there any sample where i could see “Closest Grip Slot in Range” in action? trying to make a hose, but i can only pick it from one of the ends instead of any of its bones…
The hose skeletal mesh is already setup for behaving like a chain, had already working on the epic vr template, but is not working on yours, dont know why.
Thanks in advance!
Francisco
I assume that by “working in epic template” you meant that you added a physics handle to it or a constraint?
You need to specify the bone to grip it at because otherwise the plugin doesn’t know, the template by default ignores the bone that is hit assuming that you don’t want to grip there. There is a gameplay tag in the template that can be set on an object “AllowPerBoneGripping” that will pick up the hit bone when using a physx grip type.
https://i.imgur.com/XpCZNkx.png
If you don’t want every bone to be grippable then you will need to change the blueprint logic a bit to return the set one that you DO want.
If you aren’t using the template, passing in the bone name and transform instead of the objects will have the same result.
Edit
You could also skip all of setup if you really wanted to and just constraint a grippable to the bone that you want held and pick that up instead.
Thanks for the answer ! works like a charm! now i´m dealing trying to attach to different blueprints, and trying to figure out how to use the DropAndSocketObject.
If you have any directions for that would be awesome! thanks again!
Francisco
Below is a gif, of what im trying to redo using your tools:
hey Is guide complete? I need bad, because I had started the project in VRE and then bought the weapons master. I tried to drag and drop but it didnt work, had to start all over
maybe make a video to show us, it would help us alot.
Anyone tried to translate the origin of The LaserBeam
inside the BP_Teleport Controller because I had no success on finding a solution.
I’m trying to change the location of the straight Laser but it seems not movable from the Owning Motion Controller.
I want to attach to a socket the origin of the LaserBeam to my skeleton hand mesh child of the grip motion controller of my VRCharacter pawn.
any help will be welcomed.
Thanks
The straight laser is just a mesh…move it. I don’t think I am setting relative loc on it, only relative scale, if I am then modify that logic in the TeleportController actor.
Hi mordental I want to map my oculus MotionController (R) FaceButton1 to select my widget button.
For that I replaced the key Left Mouse Button inside the Press/Release Pointer Key with my MotionController (R) FaceButton1.
All is inside your BP_Teleport_Controller with the function ifOverWidget_Use ].
When I press my Oculus Face button there is no action on my widget Button.
I remarked that the function ifOverWidget_Use ] is called by [Trigger Grip or Drop] from the Vive_PawnCharacter and the only action that is working with my widget button is when I leave
the key Left Mouse Button inside the Press/Release Pointer Key and I keep my action mapping to the motion controller grip.
Is it possible to change to the MotionController (R) FaceButton1 to select my widget button ?
Thank you.
You are mistaking how Widget Interactors work, that node is sending an input in to the widget, mouse 1 is akin to clicking on it, widgets don’t know what to do with a motion controller button. You don’t want to change the input there, you want to change where it calls that node to use a different button.
Ok I made an Action Mapping with my MotionController (R) FaceButton1, I created a new GameTag (UI) on the DefaultGameplayTags and inside the VRCharacter a called my event InputAction UI_Select which is related to [Trigger Grip or Drop].
inside [Trigger Grip or Drop] bolean was over widget —>true I branch to a new Grip Drop or Use Object Clean with only the relevant GameplayTag UI.
It works without errors !!!
Is it the most efficient way to do that ?
**[SOLVED]
I just added to your custom event [Trigger Grip Or Drop] my UI.Widget to the Relevant Gameplay Tags and everything is OK.
Thanks for pointing me out the solution : “You don’t want to change the input there, you want to change where it calls that node to use a different button.”**
Can you use grip scrips on grippable skeletal meshes?
My “Gun_Base” uses a skeletal mesh instead of a static mesh for the root component so I’m using grippable skeletal mesh, but it doesn’t seem to have a grip script option.
Edit: I see grip scripts in the C++ class. Trying to find out why they aren’t showing in editor now.
Edit 2: Ahh it’s edit defaults only. Was trying to edit it in the world. My bad.