08-23-2024, 09:25 PM
My endeavor to scour through the actual Script database in RPGMaker XP... WHILE running in RPGMaker XP... ran into an odd snag.
If someone wished to set up custom sub-folders within their project's Graphics folder, they would likely add their folder paths to the RPG::Cache module. And in doing so, they would undoubtedly create a new method* to retrieve the graphics from that folder. So my work to scour through the RPG::Cache module requires that my code find any viable methods. Viable methods would provide folder-paths such as:
Graphics\KyoQuestIcons or Graphics\RemiAnims.
If ya like the name of the subfolder, kyonides... go for it.
This way, I could find the self.kyo_q_icon method and acquire its matching Graphics\KyoQuestIcons sub-folder.
But, what if a method discovered was not one that retrieved a viable bitmap for use? What if it was an already existing method that someone wished to tamper with, or one that was added that performed a new or unique function? Therein was the problem... It would find a method, but had no folder-paths to use.
Until I decided to create an array to test against:
This code has a FORBID constant array, an array that listing methods that exist within the RPG::Cache module that are not to be examined. While the first two are part of the RPG::Cache's innate system, the other two are custom methods I wrote that allow for testing of cached graphics existence. So indeed, this can be expanded.
And now, it will skip any method that is within the RPG::Cache module that shouldn't be tested... and not give me any stupid errors.
But the next phase is going to be the headache phase...
In the event that the folder-path (ex: Graphics\Goofball) isn't fixed, but is instead something the game developer can configure, I have to search for the SOURCE of the path... the configuration page, section, variable.
For this, I have to determine what kind of search I am even doing? If the variable used to define the folder path begins with "$", that is a global variable and can be ANYWHERE in the entire run of the script database. If it has '::' within the name, it is likely a constant within some separate configuration module... and may be in pairs. And I have to test for both instance and local variable usage too.
Much to do.
If someone wished to set up custom sub-folders within their project's Graphics folder, they would likely add their folder paths to the RPG::Cache module. And in doing so, they would undoubtedly create a new method* to retrieve the graphics from that folder. So my work to scour through the RPG::Cache module requires that my code find any viable methods. Viable methods would provide folder-paths such as:
Graphics\KyoQuestIcons or Graphics\RemiAnims.
If ya like the name of the subfolder, kyonides... go for it.
This way, I could find the self.kyo_q_icon method and acquire its matching Graphics\KyoQuestIcons sub-folder.
But, what if a method discovered was not one that retrieved a viable bitmap for use? What if it was an already existing method that someone wished to tamper with, or one that was added that performed a new or unique function? Therein was the problem... It would find a method, but had no folder-paths to use.
Until I decided to create an array to test against:
Quote:module Script_list
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
SL_IGNORE = "Cache_list.main"
# Names of all default cache method names
DEFAULTS = ['animation', 'autotile', 'battleback', 'battler', 'character',
'fog', 'gameover', 'icon', 'panorama', 'picture', 'tileset',
'title', 'windowskin', 'tile']
# Methods within RPG::Cache that are not to be checked
FORBID = ["def self.clear", "def self.load_bitmap", "def self.test_1",
"def self.test_2" ]
# Search test phrases
PHRASE = [ "module RPG::Cache", "module RPG", "module Cache", "def self.",
"self.load_bitmap", "begin", "if ", "end" ]
PATH_BROKE = "INVALID"
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def self.main
#
This code has a FORBID constant array, an array that listing methods that exist within the RPG::Cache module that are not to be examined. While the first two are part of the RPG::Cache's innate system, the other two are custom methods I wrote that allow for testing of cached graphics existence. So indeed, this can be expanded.
And now, it will skip any method that is within the RPG::Cache module that shouldn't be tested... and not give me any stupid errors.
But the next phase is going to be the headache phase...
In the event that the folder-path (ex: Graphics\Goofball) isn't fixed, but is instead something the game developer can configure, I have to search for the SOURCE of the path... the configuration page, section, variable.
For this, I have to determine what kind of search I am even doing? If the variable used to define the folder path begins with "$", that is a global variable and can be ANYWHERE in the entire run of the script database. If it has '::' within the name, it is likely a constant within some separate configuration module... and may be in pairs. And I have to test for both instance and local variable usage too.
Much to do.