playMaker

Author Topic: WWW Object Relative  (Read 2995 times)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
WWW Object Relative
« on: May 13, 2014, 06:53:06 AM »
It's the WWWObject action with the addition of...

  • Able to store AudioClip objects from file
  • Able to choose a Relative Path option (local to the build's data folder) via bool

The exported build has a Data folder, "relative" is considered root inside that folder, so if you go to the folder with the exe, you'll see Data... inside that is where the path is looking.

This should work exactly the same as the original WWWObject action with the exception that you can store audio and define pathing as relative.

Example path would be (minus quotes)... "CustomStuff/BobsSpecialSound.wav"

code snippet:
...note that the first frontslash is included, so its not needed in the action's "url" spot.
Code: [Select]
urlPrefix = "file://"+Application.dataPath+"/";
...
...
if (pathIsRelative.Value = true)
{
wwwObject = new WWW(urlPrefix+url.Value);
}

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: WWW Object Relative
« Reply #1 on: May 27, 2014, 05:52:30 AM »
When I install this it doesn't show up in the action browser.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: WWW Object Relative
« Reply #2 on: May 27, 2014, 06:00:41 AM »
Do you have any compile errors?

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: WWW Object Relative
« Reply #3 on: May 27, 2014, 06:12:33 AM »
No, only deprecated playmaker stuff in console. Tried to install it from the Ecosystem first and it didn't show up in the action browser. Deleted it restarted Unity and then tried installing it from this download instead, but still no luck. I am running Unity 3d v4.3.4f1 and Playmaker 1.7.7F6

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: WWW Object Relative
« Reply #4 on: May 28, 2014, 10:55:55 PM »
Hi,

 Is the action green in the ecosystem listing? Are you sure Unity is not firing an error? Playmaker won't process anything if Unity has an error.

Bye,

 Jean

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: WWW Object Relative
« Reply #5 on: May 29, 2014, 04:55:36 AM »
No errors. It says that it compiles, Playmaker gets grey and then it reloads and still nothing. I am able to add other add-ons.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: WWW Object Relative
« Reply #6 on: May 29, 2014, 05:38:58 AM »
The WWW actions are excluded for mobile builds.

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: WWW Object Relative
« Reply #7 on: May 29, 2014, 06:31:30 AM »
Ohh, I was suggested to use this instead of WWW POST Mobile in order to make use of Audio. Hmm.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: WWW Object Relative
« Reply #8 on: May 29, 2014, 06:37:42 AM »
This was based on the WWW Object action (stock) which excludes mobile so I kept those exclusions in the Relative version. I'm not sure why they are actually in place, I don't have an iPhone to test on.