Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: V--R on July 24, 2018, 11:37:16 AM

Title: Saving Screenshots Folder
Post by: V--R on July 24, 2018, 11:37:16 AM
I'm having trouble specifying where pictures are saved to. I'd love to save it to a local "Screenshots" folder but I don't know how to properly set the "File Path". I'm using the Take Camera Screenshot action from the Ecosystem if that makes any difference as well.
Title: Re: Saving Screenshots Folder
Post by: Plancksize on July 24, 2018, 01:19:31 PM
Hi, not long ago I crossed a similar issue and I kinda put together an action to help me with that (attached).
Note that I have barely any clue about coding. This seems to be working for me. No idea if the action's code is "ideal".

It will return the application path as a string (OnEnter).
You can then use something like Build String action to add the Screenshots folder to it.

Ofc this would only be valid if I understood right and "local folder" is a folder inside the "install" folder. :)
Title: Re: Saving Screenshots Folder
Post by: jeanfabre on July 25, 2018, 04:08:52 AM
Hi,

 yes that works, but you are aware this is not working when you build right? this is only during editing time.

 Bye,

 Jean
Title: Re: Saving Screenshots Folder
Post by: Plancksize on July 25, 2018, 08:36:11 AM
Hi,

 yes that works, but you are aware this is not working when you build right? this is only during editing time.

 Bye,

 Jean

I had no idea. :(
I went back to that half-project and tried to build it and, oh boy...

Not only that wouldn't work (I trust it wouldn't) but I also couldn't build due to a build error on WriteToFile action that outputs a:
Code: [Select]
Assets/PlayMaker Custom Actions/Files/WriteToFile.cs(56,17): error CS0103: The name `AssetDatabase' does not exist in the current contexthttps://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Files/WriteToFile.cs

I'm a bit loss with this, I recon.

EDIT 1: So, I removed the WriteToFile action from my project, created a new scene and added nothing but a gui text (actually, a gui textmeshpro) that would update it's text with that "application path" action I posted above.
the result (after Build and Run) was (unexpectedly) correct (scrnsht added). Is that weird?
(note: the build was indeed built to that path minus the "*_Data\" ofc)

EDIT 2: So, the ecosystem WriteToFile.cs seems to be all good, with exception that it does not create new files. Because of that I was/am using a modification of that action that I got here (bottom of thread): https://hutonggames.com/playmakerforum/index.php?topic=18245.0
Well, that action seems to be working fine in editor but can't build it (due to the error pointed above).


So... I'm even more lost now.
Should I start another thread for this WriteToFile issue?
Title: Re: Saving Screenshots Folder
Post by: Plancksize on July 25, 2018, 09:27:27 AM
Well, darn. I'll just add another reply since the above one was getting confused.

I thing I solved my issue with the use of well located "#if UNITY_EDITOR" in that modified SaveToFile action.
I'll just go ahead and post "the fix" on that thread.