If a file is existent? (VX Ace theory)

Once i find a post on reddit that apparently it check if a file is existent or not, and all links are not working
anymore, so how can we check if a file is existent or not?

(Re-creating that event)


The first thing we need to remenber is:"Google is the anwser."
Like this we can know exactly were to start!

Objective

My main objective here is to re-create the event in that gif.


With this, a 3 minutes search, Google will lead us to to the right path.

File exist?

This is the code that will check the main folder for the text file "test"
Ruby:
File.exists?("test.txt")
(notice:use "/" to read from other folder, do the not "\"
Use this with the if command)
(Source:
https://www.rpgmakercentral.com/topic/35585-checking-if-save-file-is-present/ )


Write the file

We still missing the create file code, but this is the eaysthes thing here because i made a thread
That thread has the material that we need.
( https://forums.rpgmakerweb.com/inde...-read-write-a-file-to-a-variable-vxace.134798 )

Ruby:
obj=File.open('myfile.txt','w')

obj.write("Your string")

obj.close

(The hardest thing here is re-create the file content...)
(note: use "\r" to jump line)
Ok, so i made it,(after 1.2 hours...) and i put the file into the the script and here it is :

Ruby:
obj=File.open('myfile.txt','w')
obj.write("Beneath their manufactured perception - their artificial reality - is a
writhing, twisted mess of dread. Loathing. Judgment. Elitism. Self-doubt.\n")
obj.write("All thrahing to escape the feeble hold of their host, seeping through every
")
obj.write("Little crevice they can find. Into their willpower, starving them of all\n")
obj.write("motivation and desire. Into their stomach, forcing them to drown their guilt
in")
obj.write("comfort food. Or into a newly-open gash in their skin, hidden only by the
sleeves of a cute new shirt\n")
obj.write("Such a deplorable, tanglad mass is a already present in every single one of
them\n")
obj.write("That's why i choose not to blame myself for their actions\n\n")
obj.write("All i did was untie the knot.")
obj.close

This above will create the file.

Result
Apparenty the whole event is like this:
Spoiler: Event
message("Generating text file...")
message("Done.")

script("
obj=File.open('CAN YOU HEAR ME.txt','w')
obj.write("Beneath their manufactured perception - their artificial reality - is a
writhing, twisted mess of dread. Loathing. Judgment. Elitism. Self-doubt.\n")
obj.write("All thrahing to escape the feeble hold of their host, seeping through every
")
obj.write("Little crevice they can find. Into their willpower, starving them of all\n")
obj.write("motivation and desire. Into their stomach, forcing them to drown their guilt
in")
obj.write("comfort food. Or into a newly-open gash in their skin, hidden only by the
sleeves of a cute new shirt\n")
obj.write("Such a deplorable, tanglad mass is a already present in every single one of
them\n")
obj.write("That's why i choose not to blame myself for their actions\n\n")
obj.write("All i did was untie the knot.")
obj.close
")

label:1
message("Checking for monika.chr")
if script("File.exists?("Characters/monika.chr")")
{
message("monika.chr has been found!")
go to label:1
else
message("monika.chr can't be found.\nYou deleted her, didn't you?")
go to label:1
}


(the file password is ifas2323)
I didn't quite understand what you need, or if this is a tutorial posted in the wrong area.
But if you want to study more on the subject:
(See topics on the right)
That was a tutorial, if someone need, here it is!
I didn't quite understand what you need, or if this is a tutorial posted in the wrong area.
But if you want to study more on the subject:
(See topics on the right)
Ok...
Spoiler: Description of this board
Are you having event troubles? Encountering bugs in the base program even without plugins? How do I and How to? Questions are asked over here!

Even so, read the link I sent you, it is in an objective order for learning.
Good luck

Original thread: https://forums.rpgmakerweb.com/threads/if-a-file-is-existent-vx-ace-theory.135250/