How can i Read/write a file to a variable? (VXAce)

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Out of curiosity, what did you do that didn't work before?

The example I sent is exactly the same as this:
#13
I don't know as well...
By moring am going to a windows tool called psr so we can know.
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
I don't know what happened, but #13 had the same result from #20 ...
No errors..
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Also, can i write a variable in a file?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
448
Reaction score
197
First Language
PT-BR
Primarily Uses
RM2k3
I don't know what happened, but #13 had the same result from #20 ...
No errors..
I don't understand you well, could you explain it better?
I posted just one example on "13".
The "20" just redirect it back to the "13"

Also, can i write a variable in a file?
Yes, just remove the text and put the command for the variable that is already in the example "Read File".
 
Last edited:

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Working fine!
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
I guess i tryed to make a frank-dead-and-alive dude and mixed alot of codes by mistake..
(Sorry)

NOTE: Jump line
<
obj.write("\r") go yes
obj.write(\r) go no
#===================
#(Write fiile)
#===================
<
$game_variables[1]=file.readlines[2]
#===================
#(Write on variable third
#Line of file)
#===================
>
>
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,203
Reaction score
14,681
First Language
English
Primarily Uses
RMMV

@LezianD, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.



Please edit your post instead of posting immediately after yourself.
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Can i read\create files in the desktop?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
448
Reaction score
197
First Language
PT-BR
Primarily Uses
RM2k3
I didn't understand your question, do you mean the "Desktop" folder?
Example:
C:\users\myuser\Desktop
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Like i open a bat file that creates a file?
 

Attachments

  • file.zip
    273 bytes · Views: 2

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
448
Reaction score
197
First Language
PT-BR
Primarily Uses
RM2k3
Out of curiosity, why did you do a Batch Script?
I just said that you could study the "environment variables" to use in the RmVXA Script.

Good luck
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Out of curiosity, why did you do a Batch Script?
I just said that you could study the "environment variables" to use in the RmVXA Script.

Good luck
Sorry... i really didn't understood anything at you meant, can you make some exemples please?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
448
Reaction score
197
First Language
PT-BR
Primarily Uses
RM2k3
Path to save directly to the users desktop.
You don't need to create anything to know the drive letter (C:, D:, etc).
So instead of giving a complete path like:
C:\Users\myuser\Desktop

Just:
Code:
%userprofile%\Desktop

I don't want to look boring, but you posted a tutorial teaching you a few things about it.
So I understood that at least I understood the basics on the subject.
Do not misunderstand me.
 

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Sorry.. but i still didn't understand... sorry
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
448
Reaction score
197
First Language
PT-BR
Primarily Uses
RM2k3
I'm going to have to apologize, I tested it and really Windows environment variables don't work in RGSS or Ruby.
I'm going to study more, but I'm out of time, I'm going to leave some links here:

Complete:
 
Last edited:

LezianD

Veteran
Veteran
Joined
Feb 28, 2021
Messages
34
Reaction score
1
First Language
English
Primarily Uses
RMMV
Let's say that i get the player PC username (on legal ways) to a file, and from the file to the variable
any way that i can haunt the player a bit creating a a diretory with the user name (from the variable) to name the folder ? and maybe write some thing there?
 

Latest Threads

Latest Posts

Latest Profile Posts

Hey everyone! No Studio Blue RPG Maker Critiques Stream today! But you can always check the playlist for old streams you've missed!

I ran out of paper sheets to draw, so I guess I'm forced to do digital for a while now...
x778xt8.jpg

Still haven0t found a colouring style that I like :kaoswt:
woods.pngshop.jpgboss.jpgRoom.png

Mapping is becoming so much easier!
FirestormNeos wrote on Neikoku's profile.
the cat in your profile picture is adorable
Are the default-size "chibi" sprites really a bad thing for a project? I'm not planning to sell my game anyway but I was wondering if they were as hated as some videos seem to claim...

Forum statistics

Threads
111,430
Messages
1,061,071
Members
144,791
Latest member
soda102
Top