Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on September 11, 2013, 05:27:38 AM

Title: LoadFromFile
Post by: jeanfabre on September 11, 2013, 05:27:38 AM
Hi,

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


Bye,

 Jean
Title: Re: LoadFromFile
Post by: LogLady on May 18, 2019, 03: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.
Title: Re: LoadFromFile
Post by: jeanfabre on May 20, 2019, 04:12:13 AM
Hi,

 have you tried the ecosystem version (https://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Files/LoadFromFile.cs) of it:


you can get the ecosystem here (https://hutonggames.fogbugz.com/f/page?W1181)

Bye,

 Jean

Title: Re: LoadFromFile
Post by: LogLady on May 20, 2019, 08: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.
Title: Re: LoadFromFile
Post by: jeanfabre on May 21, 2019, 02:25:52 AM
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
Title: Re: LoadFromFile
Post by: LogLady on May 21, 2019, 09: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!