Resource Checker - importing RM resources in RM

● ARCHIVED · READ-ONLY
Started by Tsukihime 16 posts View original ↗
  1. resourcechecker1.jpg


    This script goes through all of the data files in the data folder and displays a list of graphics and audio used.


    It performs a very simple resource check and copy: if it's defined in your database or in any event, it is assumed you are using it.


    I have not written anything sophisticated such as checking whether the particular resource is ever referenced.


    This script also does not support custom scripts that reference RTP resources; if you have custom scripts and you know they use RTP materials, you should consider copying everything related to that script over manually.


    Download


    Get it at Hime Works!


    Installation


    Place this script below Materials and above Main


    Usage


    Press F5 to run the resource checker. You can change this key in the configuration section.


    After the resource checker finishes, a file called "Resource_List.txt" will be created in your project folder.


    You can also choose to copy files over from the RTP folder directly. In the configuration section, type in the absolute path to the RTP, and enable file copying.
  2. Hm... I assumed Fonts wouldn't be included but I decided I should ask after skimming over your script..

    So does this import Fonts?
  3. I've hardcoded it to import the VL-Gothic-Regular.ttf font.

    I'm not sure if I need the other one.
  4. Can you make something like this that deletes the files that aren't used?
  5. So if I understand this correctly, if you put all your resources in the common files folder, this will tell you which resources from common files your game uses?
  6. Adon237 said:
    Can you make something like this that deletes the files that aren't used?
    Probably not because what if you go ahead and delete stuff, but then it deletes too much and you lose all your work? Could be personal art that you spent 3 months on and didn't have any backups.

    tpasmall said:
    So if I understand this correctly, if you put all your resources in the common files folder, this will tell you which resources from common files your game uses?
    It tells you which resources your game uses from your project and all of the data files. It doesn't know whether it's an RTP file or not until it tries to copy them over.
  7. I keep getting this error:

    Script 'Resource Checker- Tsukihime' line 265: NoMethodError occurred.

    undefined method 'tileset_names' for 0:Fixnum

    I've checked my directory path and everything is set correctly, not sure what I'm doing wrong.
  8. Well, you could just tell the player to back things up.
  9. tpasmall said:
    I keep getting this error:

    Script 'Resource Checker- Tsukihime' line 265: NoMethodError occurred.

    undefined method 'tileset_names' for 0:Fixnum

    I've checked my directory path and everything is set correctly, not sure what I'm doing wrong.


    Code:
    def parse_tilesets
        tilesets = load_data_file("Tilesets")
        tilesets.each {|tileset|
          next unless tileset
          tileset.tileset_names.each {|name| ## line 265
            add_resource(:Tilesets, name)
          }
        }
      end
    For some reason there is a list of numbers rather than a list of tileset objects. I am not sure what might be happening.
  10. The problem was in my tilesets.rvdata2 file. I made a new project, swapped my tileset info over to it and copied it over and it works great now!
  11. Why do you have so many empty methods? Also, there is an automatic way to get the RTP path. All you have to do is make a Win32 call with the library.



    Code:
    module RTP
        @rtp_id = Win32API.new("rgss104e.dll", 'RGSSGetRTPPath', 'L', 'L')
        @rtp_path = Win32API.new("rgss104e.dll", 'RGSSGetPathWithRTP', 'L', 'P')
        def self.get_path(rtp_number)
            return @rtp_path.call(@rtp_id.call(rtp_number))
        end
    end
    
    print RTP.get_path(1)
    
    exit
    Just make sure you replace "rgss104e.dll" with the one RMVX Ace uses. Then you call it like so.



    Code:
    RTP.get_path(rtp index)
    rtp index = 1, 2, or 3 # By default, you would normally use 1. Though if the user has any other RTP's set in Game.ini, you can also load the path from those
  12. The Data_Parser class is just there so if I want to write another data-related parser I can just look at what I need quickly.

    Btw, how can I look up what kinds of functions are available in the dll? PM if needed.

    I tried it just now. Getting an "F" in return. I'm guessing that means not found? Lol

    But F is the drive that my runtime is on...

    Ace only seems to support one RTP compared to XP (from the ini file), so maybe it's different.
  13. Let me install RMVX Ace real fast and test out the code. As far as what functions are in it, I'm completely clueless. A buddy of mine told me about it. Though I'm sure you could open the DLL in a hex editor and find the names of actual methods.

    EDIT:

    Alright, it looks like theres a glitch in the VX and VX Ace libraries. Either a glitch in the library or the Win32 module. But both VX and Ace return just the drive letter rather than the full path like it should. Which is kind of a bummer. :\
  14. Hi Tsuki,

    I just noticed that the checker doesn't check move routes for play sound effect, since those were pretty much the only things that weren't copied over when I tested it out.
  15. I've updated the script to parse a couple more commands including move routes and change battleback.
  16. tsuki the master builder, the lifeshaper, awesome stuff!