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:
(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)
本贴来自国际rpgmaker官方论坛作者:LezianD处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/if-a-file-is-existent-vx-ace-theory.135250/