Original Source
- Original title: ozu_File – Create and manipulate files from within the game itself!
- Original author: ozubon
- Original date: April 11, 2020
- Source thread: https://forums.rpgmakerweb.com/threads/ozu_file-create-and-manipulate-files-from-within-the-game-itself.120076/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugin Releases (RMMV)
Summary
ozu_File 1.2 by ozubon Introduction Using Node.js' file system module can be a hassle. Getting it to work both in playtest and after deployment seems to be something people are having trouble it. This aims to give some easy to use functions as tools for manipulating the game folder's files using Node.js – both for people who've tried implementing the .fs module and failed and for anyone with basic script call knowledge who wants to play with files.
Archived First Post
by ozubon
Introduction
Using Node.js' file system module can be a hassle. Getting it to work both in playtest and after deployment seems to be something people are having trouble it. This aims to give some easy to use functions as tools for manipulating the game folder's files using Node.js – both for people who've tried implementing the .fs module and failed and for anyone with basic script call knowledge who wants to play with files.
Does not work on mobile!
Features
This plugin allows you to do things with your game files and folders from within the game itself.
- file.exist will check whether a file exists or not
- file.write will write or overwrite a file with the text you enter
- file.append will add text to an already existing file
- file.read will read a file and output its contents as text
- file.rename will rename a file to the filename you enter
- file.erase will permanently delete a file
Checks if a file in your game folder exists or not.
Intended for the conditional branch script box.
file.exist("path", "file.type")
These all return TRUE:
file.exist("", "index.html")
file.exist("data", "")
file.exist("img/system", "Window.png")
This returns FALSE unless it exists:
file.exist("asdf/gh", "jkl.txt")
Screenshot example:
Writes a new file with the desired data.
Intended for script calls.
file.write("path", "file.type", "stuff")
Some examples:
file.write("", "tanoshindekudasai.txt", "Arigato gozaimasu")
file.write("data", "test.json", "Can it write to JSON?")
Screenshot example:
Same as file.write but writes to the end of an existing file instead of overwriting it.
Intended for script calls.
file.append("path", "file.type", "new stuff")
Some examples:
file.append("", "tanoshindekudasai.txt", "!!!")
file.append("data", "test.json", " Yes.")
Screenshot example:
Reads a file and outputs a string of what's in it.
Intended for conditional branches and setting variables.
file.read("path", "file.type")
This will return TRUE in a conditional branch (if tanoshindekudasai.txt is exactly "Arigato gozaimasu!!!"):
file.read("", "tanoshindekudasai.txt") === "Arigato gozaimasu!!!"
Using Control Variables, set a variable to
file.read("", "tanoshindekudasai.txt")
Screenshot example:
Renames a file, careful not to rename important files.
Intended for script calls.
file.rename("path", "file.type" "new name.type")
Some examples:
file.rename("", "tanoshindekudasai.txt", "ieie.txt")
file.rename("data", "test.json", "johnromero.json")
Screenshot example:
Do not use this one unless you know what you're doing!
Permanently deletes a file, be VERY careful not to erase important files.
Intended for script calls.
file.erase("path", "file.type")
Some examples:
file.erase("", "ieie.txt")
file.erase("data", "johnromero.json")
Screenshot example:
Terms of use
You don't have to credit me but I'd appreciate it!
For commercial use, you gotta credit me!
Plugin
Credit
ozubon
Kino for this guide
Features Mentioned
- This plugin allows you to do things with your game files and folders from within the game itself.
- file.exist will check whether a file exists or not
- file.write will write or overwrite a file with the text you enter
- file.append will add text to an already existing file
- file.read will read a file and output its contents as text
- file.rename will rename a file to the filename you enter
- file.erase will permanently delete a file
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
Terms of use You don't have to credit me but I'd appreciate it! For commercial use, you gotta credit me! Plugin
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...