playMaker

Author Topic: Making a File browser[UPDATE: august 2017]  (Read 4123 times)

Resistance21

  • Playmaker Newbie
  • *
  • Posts: 7
Making a File browser[UPDATE: august 2017]
« on: April 12, 2014, 02:55:27 PM »
Hey guys,

I am working on a game that allows user to select music off their hard drive, so I need to make a file browser.

I have been trying to work out a way to do this for the last few hours and am getting no where.

Is it possible to do this with just play maker or am I going to need to find custom code as well?

Thanks for any help.
« Last Edit: August 21, 2017, 02:52:30 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Making a File browser
« Reply #1 on: April 14, 2014, 08:19:51 AM »
Hi,

 I would strongly recommand a third party plugin for that. typically:

http://www.starscenesoftware.com/unifilebrowser.html

bye,

 Jean

Resistance21

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Making a File browser
« Reply #2 on: April 14, 2014, 08:21:34 AM »
okay thanks ill give it a look.

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: Making a File browser
« Reply #3 on: November 19, 2014, 04:52:22 AM »
Has anyone got UniFileBrowser to work with Playmaker.

You select your file, click open, and the example script is displaying the path and filename. It's right there but I can't get it into Playmaker.

The Get Property action doesn't find any useful variables on the example script or on the main script.

I was hoping I could use my limited code knowledge and change "private var" to "public var" on something... Which usually works. But in this case I'm stuck.

Failing that, has anyone tried any other file browsing assets that make this process easier with Playmaker.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Making a File browser
« Reply #4 on: November 26, 2014, 02:27:51 AM »
Hi,

Ok, here is a custom action for this. Let me if it works for you, then you can see how it works under the hood. Also make sure you read the "UniFileBrowser Documentation.rtf" doc, it explaines how to work with this framework.


Bye,

 Jean
« Last Edit: September 14, 2017, 04:45:40 AM by jeanfabre »

strongarm27

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Making a File browser
« Reply #5 on: August 17, 2017, 08:20:52 PM »
Any chance we can get a save dialog open for unifilebrowser.  I need to both save and load files into my app and could really use a action that did the reverse of the open file action posted.  I don't write code so figuring out how to make this function is a little beyond me just looking at it in mono.

thank you for any help

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Making a File browser
« Reply #6 on: August 21, 2017, 02:52:05 AM »
Hi,

 ok, updated the package on the post above, it now has the action to save file.

 Let me know how it goes,

 Bye,

 Jean

strongarm27

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Making a File browser[UPDATE: august 2017]
« Reply #7 on: August 30, 2017, 12:15:37 AM »
 :D  Thank you so much that worked perfectly!!!!  Got it working with no issue.

Thank you again.  Your product made my products happen.  I would not be able to do anything without Playmaker.  ArtPose is a product because of the great work you do and the extremely good relationship you have with the community.  I would give the product six stars if I could.

thank you again.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Making a File browser[UPDATE: august 2017]
« Reply #8 on: September 01, 2017, 07:00:54 AM »
Hi,

 I am glad I could be of help :)

 as always, if you don't get a reply within few days, don't hesitate to ping the thread and pm me.

 Bye,

 Jean

strongarm27

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Making a File browser[UPDATE: august 2017]
« Reply #9 on: September 11, 2017, 01:37:50 PM »
 Seems I spoke to soon.  Both scripts work fine for the first loop. They seem to set a flag that the dialog has been closed and the second time I use the script it doesn't hold and wait for user to input the file they wish to load or save.  The script completes like a bool has been set that the dialog has been closed.  Both scripts test out the same way.  I tried to call a method to reset the dialog after the first time the script is used but it doesn't seem to help.  Is this a issue with the scripts or The file browser setup.  I need user to be able to save more then one time per session. Any help would be greatly appreciated since apple is holding up my app because I don't allow for choosing a location to save files.

I did a few more tests and it definitely is setting a bool that makes script see the dialog as closed on exit.  I made multiple copies of the action and ran one after another each one worked correctly one time then by passed waiting for close and used the close state every time after that immediately. hopefully that helps figure out whats going on.

shawn ogle
ArtPose created with Playmaker
« Last Edit: September 11, 2017, 11:13:02 PM by strongarm27 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Making a File browser[UPDATE: august 2017]
« Reply #10 on: September 12, 2017, 03:31:00 AM »
Hi,

 I am confused, maybe you could provide the Fsm in question? It seems there is something fish with the logic, not with the action itself ( maybe)

Bye,

 Jean

strongarm27

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Making a File browser[UPDATE: august 2017]
« Reply #11 on: September 12, 2017, 11:22:07 AM »
the fsm is dirt simple.  I use ngui so its a on click event that leads to the action(opens the dialog)  I have two events one that sets closed (the person canceled and one that sets saved) and then loops to a action that saves and back to wait for another click. The second time through a flag has been set so it doesn't wait for the persons input it just goes to window closed.  If i have multiple versions off the state each one will stop and wait for the persons input one time.  After that it won't and completes like the dialog has been closed. I can set up a int switch and make a horrible solution were each one of say a 100 saves is used once before the system fails but I thought maybe some flag was being set so the close event was being triggered after the first time it was used.  Seems the case since copies act correctly once then go directly to closed event after that.

   here is a screen of the fsm.  I just tested on a fresh project with only ngui unifilebrowser and the scripts and it still only works correctly once then moves directly to dialog closed after that.
« Last Edit: September 12, 2017, 12:08:42 PM by strongarm27 »

strongarm27

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Making a File browser[UPDATE: august 2017]
« Reply #12 on: September 12, 2017, 03:18:49 PM »
By testing and removing "windowClosed = true:" the issue is with this bit of code.  I removed it and it works correctly for saving a file as long as i actual save a file.  The state fails if i hit cancel.  It seems by setting the close window to true it then becomes true for every time the script is called after the first use.  I really need this to work.  Its holding up my submission of a 9month project to the apple store.  Any help would be greatly appreciated.

Shawn ogle
Artware studio

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Making a File browser[UPDATE: august 2017]
« Reply #13 on: September 14, 2017, 04:46:14 AM »
Hi,

 ok, I have fixed the actions, can you redownload them from the post above.

 let me know how it goes.

 Bye,

 Jean