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
433
Reaction score
190
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,164
Reaction score
14,654
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
433
Reaction score
190
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
433
Reaction score
190
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
433
Reaction score
190
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
433
Reaction score
190
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 Profile Posts

Ami
This is the End of the Endurance,everyone are celebrating the end of their Endurance

I just wondering what Menu for Tomorrow
Two years into developing my game and I just scrolled through the BaseResource Pack that comes with MV for the first time xD I never knew how much awesome stuff was in there. Also so many names I know from the forum, like Shaz & Archeia ... and that's not the only resource pack I found in the depth of my hard drive :0 Right now I'm both confused and hyped about all the stuff I own.
Decided to start watching Naruto; and not only is it a genuinely good series, but it's also very inspiring.
I just wish Funimation got its act together and fix the missing dubbed episodes.
Decided to work on my game a little bit, made this Motel looking building. I am still on temporary hiatus though as getting Therapy is more difficult than I thought.

Forum statistics

Threads
111,289
Messages
1,059,974
Members
144,602
Latest member
sdzezzzs
Top