Save file 05 conditional branch

Hello guys!
I would like to know if it's possible to do a conditional branch to check if the save file number 5 exist.

I already found "DataManager.isAnySavefileExists()",
but this script only verifies the savefile in general.
I would like to check for the savefile 5.


Thank you very much in advance.
Thales.
Try this function instead:

https://kinoar.github.io/rmmv-doc-web/classes/datamanager.html#isthisgamefile
@Aloe Guvner hello!! Thank you for your help!

Sorry I'm very useless with code. I coudn't understand well what I have to do.

I put "ThisGameFile(savefileId: 5): boolean" in the conditional branch and a error return:

missing ) after argument list

I tried just put this in a script call to see what happens, but the same error happened.
Reading documentation can be confusing, it's difficult at first but once you learn a few things it will make sense.

You can skip to the bottom for the answer, but it will help you in the long run to understand some how it works to read this whole post.

The first thing is noticing the function is inside the DataManager class. This is a static class, which means everything is accessed by using DataManager itself. In fact, all the manager classes in MV are static.

For a sample property named "someProperty" and a sample method name "someMethod" on the DataManager static class, it would be accessed like this:
Code:
DataManager.someProperty;

DataManager.someMethod();

You might wonder what is the difference between a method and a function. Most people would say in JS that a method is a type of function, it is a function that is owned by a class, it doesn't stand by itself.

You might also wonder what is the difference between a static class and a regular (not-static) class. An example of a regular class is Game_Actor. We have Harold, Therese, Marsha, etc. all are instances of Game_Actor, there can be as many Game_Actor instances as you want. But there's only one DataManager.

Now back to this method. You might know in JS (and many languages actually) that to execute a function you have to use "()". If you want to pass any arguments you put them inside the "()". You might know this one:
Code:
$gameSwitches.value(5)
Notice it has something inside the "()". The argument name is switchId and the type is number. Also this method will give you a value that is either true or false, that is a boolean value.

The documentation for that looks like:
Code:
value(switchId: number): boolean
It means you call the method and pass a number between the "()". That number refers to the switchId to check and then it returns a boolean as the answer.

Code:
isThisGameFile(savefileId: number): boolean
Returns a boolean value given a savefileId. If the savefileId exists; the value will be true.
It's similar for this method, you pass the savefileId which is a number, and it returns true or false.

So the final answer is in the conditional branch, you would write this, which will return true or false.
Code:
DataManager.isThisGameFile(5)
@Aloe Guvner thank you sooooo much!!!! It works perfectly!!

Thank you very much for the explanation. I could understand better what means those codes!

I took another look at the Methods from that site and I could see them differently! 😀

I could find the
DataManager.isAnySavefileExists()
that I saw in another thread haha.

Code:
isAnySavefileExists(): boolean

Now I will give a better look at those codes and maybe see something awesome to add to my game. More knowledge brings new options.

Thank you very much! 👍👍👍👍

Original thread: https://forums.rpgmakerweb.com/threads/save-file-05-conditional-branch.107238/