playMaker

Author Topic: need action for zSpace  (Read 4010 times)

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
need action for zSpace
« on: March 02, 2013, 02:12:56 AM »
Hi,
I do not know how many people will be interested in it but I am working on zSpace and want to have action for it. I tried to access different functions of its core script using send message (followed tutorial done by Chris) but no success. Sp it will be good if some one can help me for this.
Quote
https://support.zspace.com/entries/22016541-zSpace-Unity-Plug-in-Releases
You can find more info from the link above.

Just to explain where i struck in using send message-
I have attached a screen where I am using send message to access the function from the script.

Hush


Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need action for zSpace
« Reply #1 on: March 04, 2013, 02:59:03 AM »
I tried to make one my self but having some error ifsome one can help.
Here is what I have as action script-
Quote
using UnityEngine;
using HutongGames.PlayMaker;

namespace HutongGames.PlayMaker.Actions
{
   [ActionCategory(ActionCategory.ScriptControl)]
   [Tooltip("SetStereoLEvel in zSpace core.")]
   public class ZSCoreAction : FsmStateAction
   {
      public ZSCore myBehavior;
      [UIHint(UIHint.Variable)]
      public FsmFloat getSetStereoLevel;
      
      public override void OnUpdate()
      {
      getSetStereoLevel.Value=myBehavior.SetStereoLevel;
      }
   }
}

Here is the error-
Quote
Assets/PlayMaker/Actions/ZSCoreAction.cs(18,35): error CS0428: Cannot convert method group `SetStereoLevel' to non-delegate type `float'. Consider using parentheses to invoke the method

I am not a programmer and that is why I am trying to use playmaker. So please if there is any stupid mistake let me know how to solve the code.

hush

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need action for zSpace
« Reply #2 on: March 05, 2013, 07:24:43 AM »
NO one to help?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: need action for zSpace
« Reply #3 on: March 05, 2013, 12:22:42 PM »
I'm not sure I can help but it's worth a try.
The first honest mistake you made in your action is actually
Code: [Select]
public ZSCore myBehavior;
PlayMaker cannot display custom object variables. Instead use a setup like :
Code: [Select]
[ObjectType(typeof(ZSCore))]
public FsmObject myBehavior;

and then use an object variable which you set to the type of ZSCore . This setup only accepts FsmObject variables of the type ZSCore.

Then as for your compiler error, can you send a link to where you've found the code?
Code: [Select]
setStereoLevel(float) is a function, not an attribute. As it kinda states in its' name, it can only set the StereoLevel.
Instead try a setup like:
Code: [Select]
getSetStereoLevel.Value = (myBehavior.Value as ZSCore ).GetStereoLevel(); or, if you actually wanted to set the stereo type, use :
Code: [Select]
(myBehavior.Value as ZSCore ).SetStereoLevel(getSetStereoLevel.Value);
I hope that works, I didn't find any API.
« Last Edit: March 05, 2013, 12:26:24 PM by kiriri »
Best,
Sven

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need action for zSpace
« Reply #4 on: March 06, 2013, 01:46:49 AM »
Hi Kiri (sven),

Unfortunately I am not a coder/programmer and that is why I am using playmaker. :-)
I have already added the link for the actual zSpace plugin in my first post. I am currently trying to do some modification in my action script as per your suggestion but not sure if I will be able to solve it or not. So it will be great help if you can do download the code from the site and can make at least one action for it. I can then try and modify it for more actions if possible for me.

thanks for your help
Hush

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need action for zSpace
« Reply #5 on: March 06, 2013, 01:59:08 AM »
Little updated version as per the guidance by sven-
Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.

using UnityEngine;
using HutongGames.PlayMaker;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.zSpace)]
[Tooltip("SetStereoLEvel in zSpace core.")]
public class ZSCoreAction : FsmStateAction
{
        [ObjectType(typeof(ZSCore))]
        public FsmObject myBehavior;
        [UIHint(UIHint.Variable)]
public FsmFloat SetStereoLevel;

public override void OnUpdate()
{
    stestereoLevel(float);
            getSetStereoLevel.value=(myBehavior.Value as ZSCore).GetSetStereoLevel();
            (myBehavior.Value as ZSCore).SetStereoLevel(getSetStereoLevel.value);
}
}
}

Is it OK now?
« Last Edit: March 06, 2013, 06:11:52 AM by Hushonik »