playMaker

Author Topic: Questions in relation to the action "Delete File"  (Read 5121 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Questions in relation to the action "Delete File"
« on: October 18, 2024, 06:51:30 PM »
My question is about this old topic https://hutonggames.com/playmakerforum/index.php?topic=12475.0

What does the Secure Delete do? What if you do not use it?

How many times is enough within the looping option?

Will this action work on all platforms?

I have been having a lot of issues with very random IO exceptions, such as "The process cannot access the file" Concerning Deleting a JSON file, I did quite a bit of searching around to find what seems to be the answer.

The files are saved into the persistent data path with the filename.

The recommended approach is to delete the old files and create new ones for each NewGame.

It seems that Unity during runtime can miss these exceptions and will only show in my scenario on a Windows, Mac & Linux platform within the built apps player log files.

I was using a custom action to "Delete" the files within the persistent data path that seems to have no issue within the Web GL environment.

It is also worth noting that I am using the Json actions within this project.

I very much seek professional advice on this subject, please.

Kind regards

colpolstudios














colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Re: Questions in relation to the action "Delete File"
« Reply #1 on: October 20, 2024, 06:51:58 AM »
I created a proof-of-concept Windows build that you can try out if you are interested in my small little project:https://www.dropbox.com/scl/fi/1vm3jr97ax8tabsuid8jk/Enemy-save-example-windows-build.zip?rlkey=4lab3iof6allisa5y507blt1x&st=mcn462kq&dl=0

This project does not use "Easy Save", but uses the Json save and load actions.

Unzip to an easy-to-find location on your PC and launch the build.

Note: The player is never saved.


colpolstudios

  • Sr. Member
  • ****
  • Posts: 365
Re: Questions in relation to the action "Delete File"
« Reply #2 on: October 27, 2024, 08:42:45 AM »
I have updated my project: https://app.box.com/s/46u7k8e88s258lohbgc9biv8dabpfdha

Short video: https://streamable.com/59nb6t

I fixed some outstanding issues. This new upload includes the player's health which is also saved and added pickups into the saving and loading system. I stopped using the "Delete File" action and used my custom action instead.

Each time that you start a "NewGame" a new filename is generated and the old files are deleted.

There is a "Developer Reset" for the developer to reset all of the files and also player prefs that are used. This is simply unchecked when you build.

The enemy within the scene is saved, spawned enemies of spawned enemies are saved. That sounds odd I know.

I also included a system to spawn a different type of individual enemy, called "spawn enemy variation" that will spawn the number of those enemies. Each has its own unique spawn point. So the red enemy will go to the red spot and so on for the yellow and black—all with saving and loading.
Remember that the saving is linked to the build index, so each new scene is independent.