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
446
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,197
Reaction score
14,665
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
446
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
446
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
446
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
446
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

hAx6iQ3.gif

Writes that the characters have to climb a mountain.

Realized that I have to draw six sets of models where characters are climbing.

At least I know how to draw something. :)
I'm currently scratching my head on how to design plains. What do I even put in plains? Some trees (but not too many or it turns into a forest)? Grass? A few bushes? That's a bit dull.
I'm looking for tutorials but Google didn't seem to find much (or maybe I have the wrong keywords). I don't know how to map plains and I don't know how to learn.
I should probably be dragged kicking and screaming away from Daz3D... I was playing with 8.1 models and came up with this. Thoughts?
and_remember_tomorrow_miranda_8_1.jpg
If you're an artist of illustrations, you're doing fine.
If you're an artist of writing, you're doing fine.
If you're an artist of programming, you're doing fine.
But if you are all three above (and more) you cannot allow any distractions in your life.

Forum statistics

Threads
111,401
Messages
1,060,844
Members
144,749
Latest member
hyrrozz
Top