playMaker

Author Topic: WWW Object Relative  (Read 7664 times)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
WWW Object Relative
« on: May 13, 2014, 09: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);
}
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Slater

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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: WWW Object Relative
« Reply #2 on: May 27, 2014, 09:00:41 AM »
Do you have any compile errors?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Slater

  • Full Member
  • ***
  • Posts: 123
Re: WWW Object Relative
« Reply #3 on: May 27, 2014, 09: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: 15500
  • Official Playmaker Support
Re: WWW Object Relative
« Reply #4 on: May 29, 2014, 01:55:55 AM »
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
Re: WWW Object Relative
« Reply #5 on: May 29, 2014, 07: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: 2511
  • Mender of the past
    • Cleverous
Re: WWW Object Relative
« Reply #6 on: May 29, 2014, 08:38:58 AM »
The WWW actions are excluded for mobile builds.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Slater

  • Full Member
  • ***
  • Posts: 123
Re: WWW Object Relative
« Reply #7 on: May 29, 2014, 09: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: 2511
  • Mender of the past
    • Cleverous
Re: WWW Object Relative
« Reply #8 on: May 29, 2014, 09: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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: WWW Object Relative
« Reply #9 on: November 21, 2022, 01:05:44 PM »
Hello Lane,

Thank you for the action, I'm using it to get Audio Clip files.

Every now and then I get an error in Editor from this action, the original WWW action don't have this:

Code: [Select]
UnityException: get_dataPath can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

Unity 2019.4, I got the action from Ecosystem.

Any ideas? Thanks!
« Last Edit: November 21, 2022, 01:09:58 PM by 600 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: WWW Object Relative
« Reply #10 on: November 24, 2022, 09:38:55 AM »
Hi.
I fixed the issue (attachment below)

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: WWW Object Relative
« Reply #11 on: November 25, 2022, 06:02:59 AM »
Hi.
I fixed the issue (attachment below)
Thank you!