SRD Retry Cost Plugin Help

Discussion in 'Javascript/Plugin Support' started by Yawgmoth, Aug 30, 2019.

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

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi all,

    I just picked up sumrndmdde's Retry Cost Plugin from http://sumrndm.site/page/3/ this plugin works with the SRD Game Over Core plugin which is located above the Retry Cost Plugin and required for Retry Cost Plugin to work. I also picked up the SRD Retry Upgrade which is located beneath the Retry Cost Plugin (Retry Cost Plugin has been tested both On and Off and I still have the same problem, so I think it's safe to eliminate this as the issue.)

    The Game Over Core Plugin and Retry Upgrade Plugin can also both be found at the link above.

    ISSUE: So I posted some images below, I am attempting to use the Retry Cost Plugin's Item function to require one Diamond to retry battles after the Game Over screen. I typed everything into the plugin's parameters as stated in the SRD video also found at the link above. The strange thing is the diamond does not show up but three other items do and I have no idea why these items are being shown by the plugin, especially since I am using the Diamond's item ID which is 26.

    I am also having problems with the Retry Upgrade Plugin but they may be related to the Retry Cost Plugin, I will create a new thread with inquiries about it if and when this first issue is solved.

    Any help or advice would be great, thank you all in advance.

    In the meantime I will be turning off plugins and testing to see if any other plugins are conflicting with this one.
     

    Attached Files:

    #1
  2. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Are you using the plugin command to change the retry cost items anywhere?
    Otherwise your plugin parameters looks correct per the instructions video.

    Does it work on a blank project with only SRD_GameOverCore and SRD_RetryCosts added?
     
    #2
  3. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Thanks for your reply.

    No, I am not using any plugin commands that effect the retry costs. I would create a test project but I have only ever been able to create the one project using RPG Maker MV. I believe it is because my laptop is low on memory.

    I have disabled all other plugins except for Game Over Core and Retry Cost. I am still having the same issue. I have played with the item ID parameter within the plugin's setting and it seems it does not recognize the quantity of items and does not recognize double digits and instead uses the ID of each digit as if they were singular.

    (EX. If I am using [26, 1] the plugin gives me one ID 2, one ID 6, and one ID 1 item as retry costs.) I've also posted an image below.

    It also says the quantities are undefined. At least that's my interpretation. I have re-downloaded the plugin and still have the same issue. The plugin allows infinite retrys after a game over and say's each item is xundefined.

    If anyone else wants to create a test project with these two plugins and run a test with a double digit item ID I would appreciate it. At this point I would say there is something wrong with the Retry Plugin or something wrong with my MV files.
     

    Attached Files:

    #3
    Aloe Guvner likes this.
  4. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for the detailed test!

    I think you identified the bug precisely. The plugin isn't reading its own parameters correctly.

    I can probably fix it for you, I'll comment back here and tag you.
     
    #4
  5. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Thanks! If you need anymore information just let me know. I can't wait to have this issue solved.
     
    #5
  6. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @Yawgmoth This should work, paste the code below into a new .js file (you can name it whatever you want like "Bugfix_SRD_RetryCosts.js") and install it in the Plugin Manager directly below SRD_RetryCosts.js

    Code:
    /* Fixes issues in SRD_RetryCosts in drawing the required items */
    
    Sprite_RetryCosts.prototype.calculateLinesItems = function() {
        if($gameSystem.itemRetryCost) {
            const items = JSON.parse('[' + $gameSystem.itemRetryCost + ']');
            for(let i = 0; i < items.length; i++) {
                const info = items[i];
                const item = $dataItems[info[0]];
                if(item) {
                    this._numOfLines++;
                    const length = this.bitmap.measureTextWidth(item.name + " x" + info[1]) + 24;
                    if(length > this._maxWidth) this._maxWidth = length;
                }
            }
        }
    };
    
    Sprite_RetryCosts.prototype.createItemLabel = function(line) {
        if($gameSystem.itemRetryCost) {
            const items = JSON.parse('[' + $gameSystem.itemRetryCost + ']')
            for(let i = 0; i < items.length; i++) {
                const info = items[i];
                const item = $dataItems[info[0]];
                if(item) {
                    const y = (line * this._lineHeight) + 6;
                    this.drawIcon(item.iconIndex, 0, y);
                    this.bitmap.drawText(item.name, 26, y, this._maxWidth, this._lineHeight, "left");
                    this.bitmap.drawText("x" + info[1], 0, y, this._maxWidth, this._lineHeight, "right");
                    line++;
                }
            }
        }
        return line;
    };
     
    #6
  7. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Thank you so much! It works perfectly.

    Now the other problem I have had is the SRD Retry Upgrade, its failing to call an image and I believe everything is set up correctly. This may be the plugin not working how is should again, I'm basing this off of our history with the last plugin and it's issues. I could start a new thread but I think these issues are similar enough. Aloe Guvner you have been a big help would you mind looking at the images below and let me know what you think?

    EDIT: I also can't use the background music. If I disable the BGM and BG Image the Plugin works correctly, including the additional item scene I added.
     

    Attached Files:

    Last edited: Aug 31, 2019
    #7
  8. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    These issues I don't think are bugs, it looks like the plugin is looking for the image in:
    Code:
    img/SumRndmDde/gameover/Crystal.png
    And the instruction video has the folder as "gameover". But the image is in:
    Code:
    img/SumRndmDde/GameOver/Crystal.png
    Those are two different paths, so renaming your folder from "GameOver" to "gameover" should fix it.

    I suspect the BGM issue is because the file name has spaces, which are generally not allowed. Try renaming the BGM file to use underscores instead of spaces and change the plugin parameters to match it.
     
    #8
  9. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Thanks for everything so far!

    I have the background image working properly now, case sensitivity is such a small detail. I'm glad you noticed it.

    The audio still produces an error even with the underscores and and even with no underscores and no spaces. I took a couple of screen shots and posted them below. I'm hoping you will see something we are missing.
     

    Attached Files:

    #9
  10. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    What's the name of the audio file?
     
    #10
  11. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner The audio file's name is Poem_for_the_Different_Future.oog
     
    #11
  12. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    That would be it then, the audio format is .ogg but the file is named .oog

    How did you convert the audio file?

    At this point it's probably not a plugin issue, try setting that as the title theme and see if it loads.
     
    #12
  13. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Sorry for the confusion but that was just a typo within this thread. The file is named with the .ogg format and I didn't convert it myself. It was a free downloadable resource. I wish the issue was that simple.
     
    #13
  14. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Can you show a screenshot of the file name with the full folder path like you did with the image? So we can make sure there aren't any typos.

    ^ how about this?
     
    #14
  15. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner I have tried the audio file on the title screen and it does work. It also works when I event the same audio file. I posted a screen shot below, I tried to zoom in so it's easier to read This was the largest I could go and still have the folder path and file name on the same screen. If you need them larger I can do two separate screen shots. Let me know if this works for you.

    Also Thanks for helping me out with this issue.
     

    Attached Files:

    #15
  16. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Wait so you earlier said the file name is
    "Poem_for_the_Different_Future.ogg"

    And that's what you configured in the plugin.

    But your screenshot shows something different:
    "2-10 Poem_for_the_Different_Future.ogg"

    So configure the plugin to what the file is actually called and it should work. What is the "2-10 " and why wasn't it put in the filename?
     
    #16
  17. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Thank you and you are correct I configured Poem_for_the_Different_Future.ogg into the plugin's parameter. I am so embarrassed at the moment. I thought the numbers were not part of the name. I suppose they are suppose to be tracks? I downloaded them a few months back and did not alter the names. I actually thought all my audio files had the numbers, but after looking I can see that the basic RPG Maker MV audio files do not. I want to thank you for helping me out with this, but feel I wasted your time with this audio stuff. Everything now works great.
     
    #17
  18. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,045
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    No problem. Those numbers are probably referring to a track # or album #, but from the perspective of a computer trying to load a file, it doesn't care about that, it only cares about what file it was told to load vs. what file is available to load. The computer is quite dumb in that regard, while a person could understand the intent, the computer can only match exactly by filename.

    A feature since MV v1.5.0 is that plugins can be written so that in the plugin parameters you actually select the audio/image file using a dropdown, which reduces these kinds of confusions. Unfortunately, it looks like this SRD plugin was written before that feature was available, and it was never updated to use that feature. If it utilized this feature, all this would've been avoided.
     
    #18
    Wavelength likes this.
  19. Yawgmoth

    Yawgmoth Veteran Veteran

    Messages:
    104
    Likes Received:
    8
    Location:
    Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aloe Guvner Thank you so much for everything. I just wish I would of realized the number was part of the name. I really appreciate everything you did to help. I'll be closing this thread because everything has been solved. I wish you the best and great RPG Making!
     
    #19
  20. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,434
    Likes Received:
    3,714
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA

    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.

     
    #20
Thread Status:
Not open for further replies.

Share This Page