I have noticed when I export my project and I check the remove unused files, some of the files used in the project disappear. I realized that the files some of the plugins use are the ones that gets remove. Now the only options I have to manually remove the unused files or add the files that gets deleted when I export my project. I'm asking if there is a way I can export my project with all my used files without having to go through this trouble. I hope I'm making sense.
A Better Way To Remove Unused Files During Deployment.
RPG Maker MV Support2 ways to do this.
1) do it manually so you know what is uses
2) use a simple plugin, with a struct to target files, audio, etc.
this "loads" the file while the plugin further does nothing, but it wont be
removed either.
I think one made this simple, but you have to select each file you use.
so unused files may be removed, but never the one you set in the plugin.
1) do it manually so you know what is uses
2) use a simple plugin, with a struct to target files, audio, etc.
this "loads" the file while the plugin further does nothing, but it wont be
removed either.
I think one made this simple, but you have to select each file you use.
so unused files may be removed, but never the one you set in the plugin.
I don't I understand the solution 2. If you could explain it further and providing the name of such plugin would be helpful.
looks like:
I need to get the right structure, but its just like a list you target,
there is no code, just a comment.
another ways is to use
and the filename, in a list, save as plugin and activate it.
while it does nothing, it preserve files from being removed.
JavaScript:
/*
@param pictures
@dir image
@type struct[]
@default []
*/
there is no code, just a comment.
another ways is to use
@require imageName_path which save this, you than target the pathand the filename, in a list, save as plugin and activate it.
while it does nothing, it preserve files from being removed.
I should paste this "@require imageName_path" with my file paths and save this as a plugin.
If you check "Exclude unused files" and files that are actually used get excluded, it's almost certainly a plugin's fault.
What you'll need to do is:
There's broadly 4 ways that you might need to patch plugins.
As long as the plugin isn't paid, I'd be willing to do the work for you if you can at least identify the plugin.
Certainly, making a simple plugin that just contains an extra list of required assets is a valid last resort if modifying the badly-behaving plugins is too difficult. It's more fragile though, so I wouldn't generally recommend it. That is to say, if those assets are actually referenced from note tags or plugin parameters, the list could easily become out of date as you change the parameters or note tags.
What you'll need to do is:
- Identify the plugin that's at fault.
- Patch the plugin so that the file gets included.
There's broadly 4 ways that you might need to patch plugins.
- If the file is referenced from a plugin parameter, you need to make sure the parameter is properly configured. Open up the plugin's source file and search for the parameter's name. You should find a block of code like this:
(There may beCode:
@param MyParameter @type file @dir img/titles1 @require 1*'s at the beginning of each line as well; you can ignore those.)
The@paramline is guaranteed to exist, but if any of the other 3 lines are missing, you'll need to add them. (You might be able to get away without the@dirline; or rather, if it's missing, adding it is going to break the plugin, so I hope you can do without it.)
There's also the possibility of@type animation. In this case, there won't be a@dir. - If the file is referenced from a standard note tag of the form
<myTag:filename>or<myTag:animationId>, you can simply add a block like the following to the plugin's header comment:Code:@noteParam myTag @noteType file or animation @noteDir img/titles1 @noteRequire 1 - If the file is referenced from a non-standard note tag, or from a standard note tag where the value is more than just the filename or the numeric animation ID, then you'll need to edit the code so that the above method can be used.
- If the file isn't referenced by a note tag or plugin parameter, but is a fixed file required by the plugin, you can simply add a line like the following to the plugin's header comment:
Code:
@requiredAssets img/titles1/whatever
As long as the plugin isn't paid, I'd be willing to do the work for you if you can at least identify the plugin.
No. That won't do anything. The information @ShadowDragon gave you is incorrect (though, it's almost correct).
- The comment must begin with
/*:– otherwise, RPGMaker won't recognize it. - The code to require a specific asset is
@requiredAssets, not@require.
Certainly, making a simple plugin that just contains an extra list of required assets is a valid last resort if modifying the badly-behaving plugins is too difficult. It's more fragile though, so I wouldn't generally recommend it. That is to say, if those assets are actually referenced from note tags or plugin parameters, the list could easily become out of date as you change the parameters or note tags.
a quick workaround to the problem is to make a map that is not connected in the game, and then have events on that map use the files that are needed by plugins but not registered by their plugins.
using files anywhere in the project makes them count as "used" and retained on export, even if that use happens on a map that is never entered.
using files anywhere in the project makes them count as "used" and retained on export, even if that use happens on a map that is never entered.
That has the exact same fragility problem as the custom plugin with a list of required assets, but yes, it is also a valid last resort approach.
Though, it really only works if the files are in standard asset directories that can be referenced from event commands. So, for example, it won't work if it's title images that need to be referenced.
Though, it really only works if the files are in standard asset directories that can be referenced from event commands. So, for example, it won't work if it's title images that need to be referenced.
I new it has something with @require and path as I use it, but didn't had time to correct
the struct as struct ad you many assets.
there was a guardplugin that does this on 4-5 locations to fill out.
Thank you all for the help. I will insert those comments in the plugins. Thanks again.
Original thread: https://forums.rpgmakerweb.com/threads/a-better-way-to-remove-unused-files-during-deployment.183325/