[XP] Environment Path

Started by Griver03, April 10, 2012, 06:37:58 pm

Previous topic - Next topic

Griver03

hi there again, i want to save my savvegames in the My Games folder like real games do that.
i tryed %PATH% and [PATH] allready but it doesnt work...
how can i use an environment path in rmxp ? (some games can that)
and if it works how can i check if the folder exists and if it not exists make rmxp to create it ?
because it crashes when a folder not exists...

thx alot in advance
My most wanted games...



ForeverZer0

There is a constant called "ENV" in Ruby, which has the environment variables in it. It is a hash, with the names of the variables as the keys. You can see all the keys by using this in Ruby:

p ENV.keys.sort


You can check if a file exists by using:

File.exist?('FILENAME')
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Griver03

My most wanted games...