Plugin to manipulate the "exclude unused files" option

Discussion in 'JS Plugin Requests' started by EthanFox, Jul 16, 2019.

  1. EthanFox

    EthanFox Veteran Veteran

    Messages:
    225
    Likes Received:
    154
    First Language:
    English
    Primarily Uses:
    RMMV
    Just wanted to find out if anyone's ever done this, as part of me feels someone may have.

    When I deploy, I tend to use the "exclude unused files" option, because it removes a bunch of stuff I'm not using.

    However, as we all know I'm sure, this option is a bit "over-zealous" and removes, for example, assets that are only referenced by plugins.

    To combat this, I have a common event which I never call in-game, which just has a load of "play SE" and "show picture" calls, to "reserve" these files so they don't get stripped out during deployment.

    Unfortunately this results in a slight problem; the game strips out the images in my titles1, and overlays folders (and a couple of others), and I have no way to reference those in that common event.

    Has anyone ever written a plugin where I can somehow specify a list of files that would be excluded, but I want the deployment to include them anyway?
     
    #1
  2. Poryg

    Poryg Pixie of the Emvee kingdom, Ham of a Hamster Veteran

    Messages:
    3,785
    Likes Received:
    9,463
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
  3. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,051
    Likes Received:
    657
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,358
    Likes Received:
    11,148
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    All you've got to do is add your own .js file to the plugins folder and insert it in the plugin manager, and list your resources in the header comments in the correct format. The format is in the help file.
     
    #4
  5. Andar

    Andar Veteran Veteran

    Messages:
    28,153
    Likes Received:
    6,375
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    The editor can't be modified, so the only way is to have a different program handle the sorting if you want that - or make that list in a map of the editor.

    However from the way you've written your explanation I think that there are a few facts that you've missed about the entire complex, especially point 2 below:

    1) the exclude unused works perfectly for everything in the regular engine. If a file is used somewhere in events or in maps or in the database, then it will be detected as used and included - if it is not there it goes to point 2 for further checks.
    2) If the resource is not used in the default engine, it checks if the resourse is registered by a plugin.
    YES, the engine specifically has functions with which the plugins can tell it what pictures they use and include them into the deployment.
    If a resource is used only by a plugin and is then stripped of, it means that the plugin writer failed to tell the editor to not strip that resource.
    3) a resource is only removed if it is neither used in default nor registered by the plugin.

    Unfortunately a lot of plugin writers never bothered with the correct handling of their pictures after that option and its javascript commands were added to the engine. It would have been a lot better if they had added the registration for their resources.
    So one other option aroud this is to create a map that is unused and unconnected to the rest of the game and use the pictures and sounds and whatever in events there to have them be detected as "used".
     
    #5
  6. EthanFox

    EthanFox Veteran Veteran

    Messages:
    225
    Likes Received:
    154
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah, this is what I do for most of the stuff - I actually do it as a single "common event" which is never called, that contains all the "Play SE" and "Show Picture" calls; I've found that works. Unfortunately "Show Picture" can't access pictures in the /titlesX and /overlays etc. folders, so it's not a perfect solution.

    Thanks for your points about plugins and the other suggestions though - and thanks everyone else! I'm sure I'll find something here.
     
    #6

Share This Page