MV [Resolved]Manually Preserve Assets

Turns out what you need to do is:
1) Go to the plugins folder. ([Game Project]/js/Plugins)
2) Make an empty document and name it anything you like so long as it ends with .js
3) Post the following code:
JavaScript:
/*:

@requiredAssets path/to/image

*/
You will need one line for each file, do include the file's name, do not include the file's extension. I am told it only works with images and audio.

Note 1: just in case you couldn't tell, these files will be specific to the game you are making. So you will likely need to do a new one for each project.

Note 2: File names are case sensitive in Linux/Mac systems, but not in Windows. Keep this in mind will you.

So first, not 100% sure this is the right place for this, if not, please move it.

But as for what I need... I got a few plugins that store their assets in strange places. I do not know why the devs put them there, I do not know why they didn't set the assets to remain when pruned. But I have been told there is a way to make a plugin to manually include them... Could someone please explain to me how to do that? Everyone who has said you can do this seemed to assume everyone knows JavaScript.
It sounds like you want to use the Exclude Unused Assets option when deploying, right? But some plugins aren't playing nice with that feature.

If it's a free plugin, provide more information (the plugin name, how the asset is specified; ideally also a link to the plugin), and I can probably help you work out what needs to be done.
It sounds like you want to use the Exclude Unused Assets option when deploying, right? But some plugins aren't playing nice with that feature.

If it's a free plugin, provide more information (the plugin name, how the asset is specified; ideally also a link to the plugin), and I can probably help you work out what needs to be done.
Payed ones. I am not apposed to having them fixed for me, but I would kind of like to learn to do it for myself... I tend to do strange things in RPG Maker.

But ya, these are the two that are acting up:


I don't think I ever came across a plugin that properly includes its assets when using "exclude unused files", so imho the best way to handle the situation is to just keep your project folder clean. It's a once off effort to clean it up and it's easy to just keep it clean instead of just dumping every possible free asset you find in there because "Maybe you'll need it later". This ain't no Skyrim!

Alternatively, you can also have each and every plugin edited so it includes its files of course.
I don't think I ever came across a plugin that properly includes its assets when using "exclude unused files", so imho the best way to handle the situation is to just keep your project folder clean. It's a once off effort to clean it up and it's easy to just keep it clean instead of just dumping every possible free asset you find in there because "Maybe you'll need it later". This ain't no Skyrim!

Alternatively, you can also have each and every plugin edited so it includes its files of course.
Can't do that yet mate, game is still a work in progress, I know for a fact that many things not being used yet will be used later, but I did find a work around... It think it's rather specific to me though.

Tried that, it didn't work.
Payed ones. I am not apposed to having them fixed for me, but I would kind of like to learn to do it for myself... I tend to do strange things in RPG Maker.

But ya, these are the two that are acting up:


That's not enough information to help you, at least in the case of the card game one. I need to know how you specify what images to use in your game – is it a note tag, or something in plugin parameters, or something else?

The credits one has its documentation on the itch page. If the issue is that images specified in their special text codes don't work, there's no simple way to fix that. I can think of at least two possible approaches.

  1. Create a patch that adds a layer of indirection – instead of /img[whatever.png] you'd write /img[whatever] where the actual image pointed to by whatever is defined in a plugin parameter. The downside is, this requires seeing at least a bit of the plugin's code to figure out how to patch it; and depending on how the plugin is coded, it might only be possible by editing the plugin itself… which means this is likely off the table, unless comments in the plugin file indicate you're allowed to edit it (nothing on the page indicates that).
  2. Create a file that literally just lists all the images you actually use, and add it as a plugin. This is fragile, because you'll need to remember to update it if you add a new image later, but it is pretty much foolproof and not that difficult. It could work for the card game plugin too if no other options are doable.

The basic outline for the plugin in point 2 is:

JavaScript:
/*:

@requiredAssets path/to/image.png

*/
Just add a line for each image or audio file between the opener and closer.
That's not enough information to help you, at least in the case of the card game one. I need to know how you specify what images to use in your game – is it a note tag, or something in plugin parameters, or something else?

The credits one has its documentation on the itch page. If the issue is that images specified in their special text codes don't work, there's no simple way to fix that. I can think of at least two possible approaches.

  1. Create a patch that adds a layer of indirection – instead of /img[whatever.png] you'd write /img[whatever] where the actual image pointed to by whatever is defined in a plugin parameter. The downside is, this requires seeing at least a bit of the plugin's code to figure out how to patch it; and depending on how the plugin is coded, it might only be possible by editing the plugin itself… which means this is likely off the table, unless comments in the plugin file indicate you're allowed to edit it (nothing on the page indicates that).
  2. Create a file that literally just lists all the images you actually use, and add it as a plugin. This is fragile, because you'll need to remember to update it if you add a new image later, but it is pretty much foolproof and not that difficult. It could work for the card game plugin too if no other options are doable.

The basic outline for the plugin in point 2 is:

JavaScript:
/*:

@requiredAssets path/to/image.png

*/
Just add a line for each image or audio file between the opener and closer.
Ya... That figures... I went in thinking that...

The code you gave me at the end is what I was asking after, but it doesn't seem to have worked... You have a typo?
1780105573477.png

Yes, I can see I only have the code for the one image, I'm only doing one right now to see if I got it working.
Ah, apparently you have to leave off the file extension – so it'll presumably only work for images and audio. But I don't think there are many plugins that have other kinds of assets, so that should be fine?
Ah, apparently you have to leave off the file extension – so it'll presumably only work for images and audio. But I don't think there are many plugins that have other kinds of assets, so that should be fine?
Yes, thank you. That works.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/resolved-manually-preserve-assets.183852/