Resource Checker - importing RM resources in RM

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English



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.
 
Last edited by a moderator:

Acetonide

Event Coordinator
Veteran
Joined
Apr 16, 2012
Messages
660
Reaction score
31
First Language
English
Primarily Uses
N/A
Hm... I assumed Fonts wouldn't be included but I decided I should ask after skimming over your script..

So does this import Fonts?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I've hardcoded it to import the VL-Gothic-Regular.ttf font.

I'm not sure if I need the other one.
 

Adon

ADONKADONK
Veteran
Joined
Mar 24, 2012
Messages
93
Reaction score
15
First Language
English
Primarily Uses
Can you make something like this that deletes the files that aren't used?
 

tpasmall

The Mauve Avenger
Veteran
Joined
Mar 13, 2012
Messages
857
Reaction score
117
First Language
English
Primarily Uses
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?
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.

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.
 
Last edited by a moderator:

tpasmall

The Mauve Avenger
Veteran
Joined
Mar 13, 2012
Messages
857
Reaction score
117
First Language
English
Primarily Uses
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.
 

Adon

ADONKADONK
Veteran
Joined
Mar 24, 2012
Messages
93
Reaction score
15
First Language
English
Primarily Uses
Well, you could just tell the player to back things up.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.
 
Last edited by a moderator:

tpasmall

The Mauve Avenger
Veteran
Joined
Mar 13, 2012
Messages
857
Reaction score
117
First Language
English
Primarily Uses
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!
 

Drislen

Villager
Member
Joined
Mar 18, 2012
Messages
8
Reaction score
0
First Language
English
Primarily Uses
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
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.
 
Last edited by a moderator:

Drislen

Villager
Member
Joined
Mar 18, 2012
Messages
8
Reaction score
0
First Language
English
Primarily Uses
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. :\
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I've updated the script to parse a couple more commands including move routes and change battleback.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
tsuki the master builder, the lifeshaper, awesome stuff!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top