Jump to content
lavei-dev

Txt. or DLL

Recommended Posts

It kinda depends on what exactly you're trying to do.

 

For example, you can create a .txt file with stuff written inside by using this script call:

File.open("filename.txt", "a") {|f| f.write(
       "Some text\nThis will be displayed in the second line.") }

LBDwCFs.png

 

This will make a .txt file in the game directory:

BCOWBQy.png

 

Note1: That \n in the string makes it go to the next line. You can put variables and such as well if needed.

 

Note2: Put:


File.open("System/filename.txt", "a")


 

To create the file in the game "System" folder.

 

Note3: You can put exactly the same code directly in scripts (Script Editor, that is), if you're working on something there.

 

Note4: Of course, replace ".txt" with ".dll" in the filename to create a .dll file.

 

For some detailed information, perhaps take a look at these?

https://ruby-doc.org/core-2.2.0/File.html#method-c-new

https://ruby-doc.org/core-2.2.0/IO.html#method-c-new-- mainly:

Quote

"r"  Read-only, starts at beginning of file  (default mode).

"r+" Read-write, starts at beginning of file.

"w"  Write-only, truncates existing file
     to zero length or creates a new file for writing.

"w+" Read-write, truncates existing file to zero length
     or creates a new file for reading and writing.

"a"  Write-only, each write call appends data at end of file.
     Creates a new file for writing if file does not exist.

"a+" Read-write, each write call appends data at end of file.
     Creates a new file for reading and writing if file does
     not exist.

 

 

Personally I haven't used it that much, so all I know are some basics.

 

Hope that helps at least a little bit! :) 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×