playMaker

Author Topic: www object read images from a folder [SOLVED THANK YOU LANE AND JEAN YOU ROCK]  (Read 3211 times)

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Greetings ,

i need your kind help once more.

In wwwobject , were we put the url link , i need to do this

--> I have a folder with random named images in there , so i wont be able to know exactly their name when i call them with wwwobject. (random users will upload them)

Is there a command that will read random from this folder.

Extremely urgent , hoping for help.

Thank you very much.

Michael.
« Last Edit: July 10, 2014, 07:19:45 PM by Michaelb »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: www object read images from a folder
« Reply #1 on: July 10, 2014, 09:31:40 AM »
Hi,

 what's your platform target?

typically, you can use "file://" appended to the url:

http://answers.unity3d.com/questions/517414/how-to-use-www-to-load-local-files.html

 Bye,

 Jean

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: www object read images from a folder
« Reply #2 on: July 10, 2014, 10:57:50 AM »
Greetings Jean ,

first of all thank you for replying back.

What i need is to use the images on a www folder (server) as textures.

Lets say path is www.test.com/thisfolder

well , in this folder there are images with random names.

Usually with wwwobject we call

-->http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg

file name is Turkish_Van_Cat.jpg.

My problem now is that in the same path and folder , there are images with random names , and i want to use them but i dont know their names to call them.

How file:// is going to help , i will put only file:// this showing to the folder?

Thank you very very much in advance.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: www object read images from a folder
« Reply #3 on: July 10, 2014, 11:03:12 AM »
You need to compile a string with the url prefix to the folder and the file/image name on the end, then use the result in the WWW path.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: www object read images from a folder
« Reply #4 on: July 10, 2014, 11:07:22 AM »
Greetings Lane , and thank you for helping out.

I really dont know how to do what you just said...... :-[

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: www object read images from a folder
« Reply #5 on: July 10, 2014, 11:28:28 AM »
For example

"http://www.mywebsite/myfolder/" is stringA.
"adorablecat.jpg" is stringB.

You can use the Format String action to put them together, then the result is your url target for the WWW action.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: www object read images from a folder
« Reply #6 on: July 10, 2014, 11:40:35 AM »
Aahhhh , i understand now , the string part got me confused.

Yes , correct , this  is what i am trying to do , problem is i dont know the name of the images (they will be created from users).

Is there any way to read / look into the folder , take the names one by one and store them , so i can finally get them into strings??

P.S

Thank you for helping out , you really cant imagine how this helps.

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: www object read images from a folder
« Reply #7 on: July 10, 2014, 06:24:00 PM »
My friend Lane ,

one last question , since i managed to do it with strings and guilayouttext (input from the user as one string).

On the format string , what do we put on the format* field???

Much appreciated for all your help.

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: www object read images from a folder
« Reply #8 on: July 10, 2014, 07:18:11 PM »
Found this awesome tutorial

-->
and it solved all my questions.

GO GO PLAYMAKER

P.S

I love the guy that does those tutorials , sooooo easy to understand everything.