[SOLVED]Galv's Custom Title; Plugin command request.

Discussion in 'JS Plugin Requests' started by cedr777, Mar 7, 2019.

Thread Status:
Not open for further replies.
  1. cedr777

    cedr777 Lead developer of "Charao Life" Veteran

    Messages:
    218
    Likes Received:
    51
    First Language:
    Not English
    Primarily Uses:
    RMMV
    Galv has made a nice plugin here, which allows you to make a unique title screen for your project.

    I would like to request an additional feature(s) for this plugin.

    A plugin command(s) that can (1)modify "fileName,xMove,yMove,opacity,z" during gameplay
    and (2)remove Layer Graphics.

    I want to be able to have a dynamic Layer Graphics as the game goes on (for plot reveals, etc.) similar to what Yanfly’s Dynamic Title Images does. I've tested the two and the two are compatible, YEP_DynamicTitleImages.js must be below GALV_CustomTitle.js

    Below is a video of the game I'm making and what I've managed to do and hope to further achieve using Galv's Custom Title plugins and Yanfly's Dynamic Title Images.

    As you can see at 0:51, Did you notice the Background Image change in the Title Screen?(That was done using Yanfly's DynamicTitleImages.js) However, for Character Carousel image which was achieved using GALV_CustomTitle.js, It would've been nice if I could change/turn off the Layer Graphics midway into the game for some plot reveal or to just fully show the new Landscape background image. But to do this I would need a plugin command for GALV_CustomTitle.js that can change/remove the Layer Graphics during gameplay.



    [​IMG]
     
    Last edited: Mar 7, 2019
    #1
  2. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    114
    Likes Received:
    106
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Here you go :) To remove the layer graphics just use the plugin command:
    Code:
    LayerGraphics
    or you can set the graphics layer just like normal:
    Code:
    LayerGraphics fileName xMove yMove opacity z
    
    even supports multiple layer graphics
    
    E.g. LayerGraphics Mountains5 0 0 255 1 | DarkSpace1 0 0 100 2
    Code:
    //=============================================================================
    // GALV Custom Title PlugIn Commands Extension
    // MRP_GALV_CustomTitle_PlugInCommands_Extension.js
    // By Magnus0808 || Magnus Rubin Peterson
    //=============================================================================
    
    /*:
     * @plugindesc Extension to GALV_CustomTitle. Add plugincommand for layer graphics.
     * @author Magnus0808
     *
     * @help Place this after GALV_CustomTitle.
     *
     * If Persistant Change is enabled then the layer graphics change will be persistant
     * trough restarts of the game.
     *
     * [PLUGIN COMMAND]
     * LayerGraphics fileName xMove yMove opacity z
     *
     * And just like with GALV_CustomTitle you can add multiple layers by adding a |
     * symbol after each layer graphic data set before adding the next layer graphic
     * set.
     *
     * E.g. LayerGraphics Mountains5 0 0 255 1 | DarkSpace1 0 0 100 2
     *
     * @param Persistant Change
     * @type Boolean
     * @desc If true then the layer graphics change will be persistant.
     * @default true
     */
    
    (function(){
        MRP_CustomTitle_PlugInCommands = {};
        MRP_CustomTitle_PlugInCommands.Parameters = PluginManager.parameters('MRP_GALV_CustomTitle_PlugInCommands_Extension');
        MRP_CustomTitle_PlugInCommands.persistant = (String(MRP_CustomTitle_PlugInCommands.Parameters['Persistant Change']) == 'true');
     
        var MRP_GALVCTPLUGINCOMMAND_GI_PLUGINCOMMAND_OLD = Game_Interpreter.prototype.pluginCommand;
        Game_Interpreter.prototype.pluginCommand = function(command, args) {
            MRP_GALVCTPLUGINCOMMAND_GI_PLUGINCOMMAND_OLD.call(this, command, args)
            if (command === 'LayerGraphics'){
                Galv.TITLE.layerData = [];
                Galv.TITLE.layerData.push([]);
                var k = 0;
                for(var i = 0; i < args.length; i++){
                    if(args[i] == "|"){
                        Galv.TITLE.layerData.push([]);
                        k++;
                    } else {
                        Galv.TITLE.layerData[k].push(args[i]);
                    }        
                }
                if(MRP_CustomTitle_PlugInCommands.persistant){
                    ConfigManager.layerGraphics = Galv.TITLE.layerData;
                    ConfigManager.save();
                }
            }
        };
     
        //=============================================================================
        // ConfigManager (Inspired by Yanfly Engine Plugins - Dynamic Title Images)
        //=============================================================================  
        ConfigManager.layerGraphics = [];  
        MRP_GALVCTPLUGINCOMMAND_CM_MAKEDATA = ConfigManager.makeData;
        ConfigManager.makeData = function() {
          var config = MRP_GALVCTPLUGINCOMMAND_CM_MAKEDATA.call(this);
          config.layerGraphics = this.layerGraphics;
          return config;
        };
     
        MRP_GALVCTPLUGINCOMMAND_CM_APPLYDATA = ConfigManager.applyData;
        ConfigManager.applyData = function(config) {
          MRP_GALVCTPLUGINCOMMAND_CM_APPLYDATA.call(this, config);
          this.layerGraphics = config.layerGraphics || [];
        };
     
        // Apply persistant layer graphics
        MRP_GALVCTPLUGINCOMMAND_ST_CREATELAYERS = Scene_Title.prototype.createLayers;
        Scene_Title.prototype.createLayers = function() {
            if(MRP_CustomTitle_PlugInCommands.persistant && ConfigManager.layerGraphics != []){
                Galv.TITLE.layerData = ConfigManager.layerGraphics;
            }
            MRP_GALVCTPLUGINCOMMAND_ST_CREATELAYERS.call(this);
        };
     
    })();
     

    Attached Files:

    Last edited: Mar 8, 2019
    #2
    cedr777 likes this.
  3. cedr777

    cedr777 Lead developer of "Charao Life" Veteran

    Messages:
    218
    Likes Received:
    51
    First Language:
    Not English
    Primarily Uses:
    RMMV
    Somehow I was kinda expecting you'd fill out this request to, haha.
    Well thanks again, and I've tried it and yes it's working as intended without a hitch.

    But if I may, can I ask a feature to be added for this? Can you make the change made by your add-on plugin persistent?

    What I mean is, only whenever the player restarts the game, the LayerGraphics will revert back to whatever you have set originally in Galv's GALV_CustomTitle.js.

    If it helps, I'm thinking it's very similar to what Yanfly's plugin; YEP_DynamicTitleImages.js that I mentioned earlier does. Any modifications done by this plugin to the title image using it's built in plugin command, persists even if the player; does not save, loads another savefile, closes the game.
     
    Last edited: Mar 8, 2019
    #3
  4. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    114
    Likes Received:
    106
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Done. I made a plugin parameter so you can choose if you want persistant layer graphic changes on or off.
    I have edited my original reply.
     
    #4
    cedr777 likes this.
  5. cedr777

    cedr777 Lead developer of "Charao Life" Veteran

    Messages:
    218
    Likes Received:
    51
    First Language:
    Not English
    Primarily Uses:
    RMMV
    Thanks for the quick reply, and for two threads in a row. :D
    I tried it however, I am getting this error:

    [​IMG]
    [​IMG]
    [​IMG]

    I have tried turning off all other plugins and only keeping these four on in this order. Still, the error occurs.
    If it helps, i'm using Olivia's Olivia_AntiPlayerStress.js plugin, that's why the error screen looks different from usual. What it does is just displays more details into the error screen.

    Edit: woops forgot to include the error screen itself, fixed.
     
    Last edited: Mar 8, 2019
    #5
  6. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    114
    Likes Received:
    106
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Sorry, that was a stupid mistake from me. No idea how I did not catch that. Should be fixed now. :)
     
    #6
    cedr777 likes this.
  7. cedr777

    cedr777 Lead developer of "Charao Life" Veteran

    Messages:
    218
    Likes Received:
    51
    First Language:
    Not English
    Primarily Uses:
    RMMV
    Thank you once again, I tested it and everything is perfect.
    That's two threads in one day you helped me in my request, you are a saint!
    Will also inform Galv about it.
     
    Last edited: Mar 8, 2019
    #7
  8. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,530
    Likes Received:
    4,118
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    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.

     
    #8
Thread Status:
Not open for further replies.

Share This Page