playMaker

Author Topic: LoadFromFile  (Read 1443 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
LoadFromFile
« on: September 11, 2013, 02:27:38 AM »
Hi,

 Following a request, please find an action to load a file into a Fsm string variable.


Bye,

 Jean

LogLady

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: LoadFromFile
« Reply #1 on: May 18, 2019, 12:10:17 PM »
Unity 2019.1.2.f1
I know this is an old thread but I think that there is something important to add. This action only works when testing on editor. On build it cannot load a file into a FSM string variable. Maybe I'm missing something so this is why I think this is the best thread to ask.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
Re: LoadFromFile
« Reply #2 on: May 20, 2019, 01:12:13 AM »
Hi,

 have you tried the ecosystem version of it:


you can get the ecosystem here

Bye,

 Jean


LogLady

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: LoadFromFile
« Reply #3 on: May 20, 2019, 05:50:25 AM »
Yes. That is the version I have (unless there is a newest from today). If I use "build and run" to make a build, this action works as intended (like inside the editor) but if I just use "build" and run the .exe the file (a text file) is not loaded. I'm using a workaround: I created a "Resources" folder and put the .txt file I need to load inside it and call the action "Resources Load" and it works inside the editor and on the built version.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
Re: LoadFromFile
« Reply #4 on: May 20, 2019, 11:25:52 PM »
Hi,

 What is the path you are trying to load from?

anyway, if your goal is to load assets and not user's file, then yes, you should use Resources, this is much better. LoadFromFile is for accessing the user HD and files that are not present in the project assets or bundles.

Bye,

 Jean

LogLady

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: LoadFromFile
« Reply #5 on: May 21, 2019, 06:44:36 PM »
Yep! I was trying to load a .txt file and everything was fine inside the editor but the compiled build never loaded the .txt. I will stick to "Resources.Load" from now on. Thanks for your help!