How create, write and read a .rvdata2 file in game?

● ARCHIVED · READ-ONLY
Started by Thefirelion 3 posts View original ↗
  1. Hi people.

    You will see, I want to create a file type ".rvdata2" with RPG Game Maker VX Ace (it has been said that for security reasons that type of file is better) in which you can write and save data in that file by order of events in the game so that later this information can be requested and read when I go it is required through a Script call.

    Through the forums I researched and was manipulating the File Class: I know how to create the file but the question is how to know if something printed on the file to be consulted at any point of the game, for example: a variable. how to write a variable (and its value) in that file and then consult it.

    I tried to do something for me and I ended up getting confused on how to configure the script correctly.

    I appreciate your help advice, thanks.

    this is my code.
    Code:
    module CreateFile
      File.open("MyNumber.rvdata2", "w+") do |file|
        Marshal.dump("Test", file)
      end
    end
    
    module MyVariable
            Variables = [1]
    end
    
    class Game_Variables
        alias initialize_defvars initialize
            def initialize(*a,&bl)
                initialize_defvars(*a,&bl)
                    File.foreach("MyNumber.rvdata2") do |vardata|
                    MyVariable::Variables.each do |id| @data[id] = vardata.to_i
                end
            end
        end
    end
  2. you will not get anyone here on the forum to explain to you how to create an encrypted file, because the same info could then be used to break the encryption.

    however, you don't need to know how to do that in order to get your files into the existing encrypted archive.
    I suggest you search for a script named "SES external text". If I remember correctly that script uses the engine function to rewrite its textfiles to work with the encryption everytime the playtest is launched.
    You only need to make sure that your final version is playtested at least once before creating the encrypted archive if you follow the same principle.
  3. Andar said:
    you will not get anyone here on the forum to explain to you how to create an encrypted file, because the same info could then be used to break the encryption.

    however, you don't need to know how to do that in order to get your files into the existing encrypted archive.
    I suggest you search for a script named "SES external text". If I remember correctly that script uses the engine function to rewrite its textfiles to work with the encryption everytime the playtest is launched.
    You only need to make sure that your final version is playtested at least once before creating the encrypted archive if you follow the same principle.
    Thanks, this script has more things than I need, but it will help me, thanks again.