playMaker

Author Topic: Steam VR Playmaker Toolkit - Help Board [VIVE]  (Read 42510 times)

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #15 on: September 04, 2016, 02:38:53 PM »
Hello Sebas,

I put a post up in your Unity3d forum post, but I figured I'd ask here as well.

Is their a way to tie the controller events of like 'trigger pressed' bool In your addon to the unity input controls? Like Fire1 or what not?

Thanks!

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #16 on: September 04, 2016, 05:54:07 PM »
Hi John!

Currently there is no way that I know of to to mix the input manager with the controller. I believe that steam made a response to this for a future update. but to be clear, you would like a bool to trigger when an action is done?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #17 on: September 04, 2016, 07:24:01 PM »
First off, thank you for replying. It is much appreciated.

Here is my actual situation.

I've got some great RPG frameworks and inventory systems I'd like to use for a VR game. The only problem is a lot of them are dependent on the input from Unity. As of now, doesn't have anything to reference actions done on a controller.

With ORK Framework, Gil has it set up to allow custom controllers. But it requires I reference the behavior name/script name where  the controls come from .. then the class name and function name to add the custom button function as described here:


http://orkframework.com/tutorial/howto/custom-playercamera-controls/

and here




I've had no luck with this whatsoever. I've used the SteamVR_TrackedController as the behavior.. but beyond that I'm lost. The friendly/helpful people on the ORK forums don't really know much about VR controller implementation.

So I've also been using your addon for Playmaker. I thought about trying to reference your action script for each control. I don't need the touch pad, but the trigger, grips, menu, and steam button I do need. But again, Google mixed with trial and error has not been kind.

Then I was thinking of ujsing your actions in a state, which will give me the bool of each action the Vive controller can do. With Playmaker, I was hoping to use that or make references to the script for each button's action.

If there was a way to set this to communicate through Playmaker, that would be awesome. Then I could throw in conditions prior to allowing a bool to happen.

Example:

do I have an object with the tag "Item" childed to a controller
true -> send event ->

is trigger pulled?
true -> set bool in variable named "itemPullTrigger"

Then send that off to Unity's input controls.. but .. meh

My whole workflow has been stifled for a few days now. I typically can bang my head on a wall for a bit and then break it down. But this wall has been reinforced with concrete.

Any assistance would be appreciated.


sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #18 on: September 05, 2016, 08:45:46 AM »
Hey John,

This is a bit difficult without seeing how the controllers are being called on the ork framework but the main script that I constantly refer to for any commands is the SteamVR_Controller.cs script.

This is in the first line of the script itself
Code: [Select]
// Purpose: Wrapper for working with SteamVR controller input
//
// Example usage:
//
// var deviceIndex = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost);
// if (deviceIndex != -1 && SteamVR_Controller.Input(deviceIndex).GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
// SteamVR_Controller.Input(deviceIndex).TriggerHapticPulse(1000);

This may be the script you need to call instead of the SteamVR_trackedObject.cs. If this does work, the new difficulty would be explaining which controller is which. (That is what the SteamVR_TrackedObject.cs is for).

Also, if it helps, the class being called is "Device"
Code: [Select]
public class Device
{
public Device(uint i) { index = i; }
public uint index { get; private set; }

Can you try using this script and if there is no success, we can try adding bools to the scripts that trigger in the actions.

Please keep me posted. Thanks!
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #19 on: September 05, 2016, 12:26:16 PM »
Thank you sebas. I'll have a go at it now. I really appreciate the help.

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #20 on: September 05, 2016, 06:12:04 PM »
Ok, definitely need to get the bools for the specific actions for the specific buttons. I looked through the public bools for that script and it looks like its calling something else to identify it based on a buttonId.

Going off of the description in the Key Settings:

Custom Button Function
Calls a static function using reflection - the function must return a bool value. Below it is a spot for the name of the function that will be called.

I can also add parameters that will be used when calling the function. As little as none or as many as needed. It can take strings, bool, int, float, vector2, and vector3.

I feel like its alllmooosstt there. I wish I was more of a contributor with this than just giving you information. I will say, if this can be worked it, its something people would probably buy.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #21 on: September 05, 2016, 08:37:44 PM »
Hey John,

Can you try the action again? The store result that is in each of the actions is the Bool for them.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #22 on: September 05, 2016, 10:58:39 PM »
Ok, I think I can call your script "GetTrigger" for the custom script.

Which class would I need to call for and which method to get the trigger bool in your action script?

Or is there a name that I can use for the specific FSM I have the trigger action set up in as a script?

If so, what class and method would it be? It requiring me to have that info.

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #23 on: September 05, 2016, 11:18:38 PM »
Wait a minute. I found this:

https://hutonggames.fogbugz.com/?W329

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

public class MyBehaviour : MonoBehaviour
{
    public PlayMakerFSM fsm;

    void Update()
    {
        // getting fsm variables by name
        FsmFloat floatVariable = fsm.FsmVariables.GetFsmFloat("myFloat");
    }
}

Wouldn't this be an easier way to get the trigger bool from the FSM with your trigger action? Adding this script, then having ORK access this instead. Make it short and simple?

I'm guessing the

public PlayMakerFSM fsm;

would be the fsm name.. in this case I'd call it

public leftTriggerPulledFSM;

Then change the

FsmFloat floatVariable = fsm.FsmVariables.GetFsmFloat("myFloat");"

to something like

FsmBool boolVariable = leftTriggerPulled.FsmVariables.GetFsmBool("leftTriggerPulled")[/color]

I don't  know. Its late, lol.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #24 on: September 06, 2016, 10:18:50 AM »
This would require changing the scripts in the Ork Framework. The bool Variable is already set to public but the ork script would require that get component.

And the class being called would be the same as the script name.
Code: [Select]
public class GetTrigger : FsmStateAction
    {
The rest is sent through the enum which is the trigger type.


All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

j0hnbane

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #25 on: September 07, 2016, 05:44:30 PM »
Working on it now. I really hope this is it.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #26 on: September 23, 2016, 05:34:26 PM »
The only thing i did not like, was the fact that when you pull the string, you get constant heavy haptic feedback, instead of a slowly build up. but i'm guessing that's just not possible with the current actions.

Hey LordHorusNL,

There is a new update that is live which does just this. Not sure if you were able to control the feedback but another option is available as well in the latest update!
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 227
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #27 on: November 10, 2016, 04:22:44 PM »
Just tried the update, great work man. Are you planning on adding more example scenes in the future btw?

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #28 on: November 10, 2016, 04:25:17 PM »
Hi! I am working right now on the next update which will be based on the current example scene but adding new features into the scene involved with better object control.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

BDFgames

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
« Reply #29 on: November 15, 2016, 01:16:09 AM »
Hi there. I'm using your asset (which has been generally pretty great, I should mention) with a shooter game, but I'm having a challenge with raycasting out of the playspace. The ray seems to only want to be drawn from the floor-centre of the playspace, and I haven't yet figured out how to draw the ray from a point attached to a controller.

I assume I'm just missing something obvious?

Any help gratefully accepted. Thanks in advance.  :)