Error Message Galv + Default 'Cache' script

● ARCHIVED · READ-ONLY
Started by Kes 20 posts View original ↗
  1. I am using Galv's Visibility Range script which can be found here  I used this script, with the exact same switches in my previous project, with no problems.

    Now, however, when I enter the map where this script is operative I get the following error message:

    Script 'Cache' line 88: NoMethodError occurred

    undefined method 'empty?' for nil:NilClass

    I am doing a 'clean run' play test, i.e. I started a New Game and am just playing straight through, without adding new resources.  This script has not been added since the play test started.

    I know that it is Galv's script which is causing the problem, because if I disable either the script, or the event relating to it, I don't get the error.  Here is the event - as you can see, it is pure vanilla.

    Galvevent_zpsdd2bba00.png

    As I don't understand the relationship between the default script 'Cache' and what this event and script are trying to do, I have no idea how to fix it.  Can anyone help?

    Thanks.
  2. Did you set the visimage("ImageName")? That's the only thing that calls the cache on this script. so not really certain what it would be if that's not the problem.

    Edit: Tested my theory and don't think it's the problem. (I get an unable to find file rather than an undefined method error if I don't have an image).

    However I did get it to work with switch 1 set to on and variable 1 set to 255.

    Tested under your settings too, works for me.
  3. 'Cache' deals with a lot of stuff graphic related. You can read the comment at the top of that script.

    Galv's Visibility Range script uses graphics as well, so some problems could relate back to the default scripts.

    Since you mentioned that you have not run into any problems with this script in another project, you may have to consider script conflicts.

    It could be just due to the same variable or switch being used with another script, or it could be due to other scripts manipulating graphics similar to Galv's script.

    You could try removing your other scripts individually to see if the issue still remains when Galv's script is active.
  4. @Sarlecc

    I'm using Galv's graphic, so I don't need to change the name of the image.

    @Susan

    Fortunately most of the scripts were also in the project where this worked.  I've been through disabling any new scripts, and nothing seems to affect it.  There is, however, a new quirk.

    I continued testing in that area for a few minutes and had an encounter.  I have set the game so that any tinting, weather effect, lighting, fog etc. are shown in the battle screen to maintain continuity.  In the battle in this area, the graphic showed up and worked perfectly, so it is not an obvious clash with something else that's causing this.  What further baffles me, though, is that I had disabled the event calling the script so that I could continue.  How then did the game know to use that graphic in that battle.  Weird.  I can't get my head round this.

    EDIT

    ah, I think I may have worked out that last bit.  I transferred into the map.  Parallel process turns on the switches.  

    Game crashes.  I disable the parallel process

    I use autosave to pick up in the same place - but of course the parallel process had run before the crash, so the autosave includes that feature.

    Therefore the game knows to use that graphic in battle.
  5. Line 88 is this:

    if filename.empty?That means something is calling load_bitmap and passing a null filename.
    Edit that script, and on the line before it, put this:

    p folder_nameThen play with the console turned on. When the error occurs, it SHOULD tell you what kind of image it's attempting/expecting to load (a character, a tileset, a picture ...) From there you might be able to figure out what's calling it.
    Or check for some of the backtrace scripts that are available. I've seen at least two that will give you a complete list of what's calling what that would let you track it down.
  6. Here is what the console shows

    consolemessage_zps582e4c0f.png

    There is no parallax for it to find, as it's a map made in the editor.  Galv's graphic (VisRange) is in the Systems folder where it is supposed to be.
  7. Yes, but did it crash? We're ONLY interested in the last line shown there AFTER the game crashes.


    In fact, change the line to this:

    p folder_name + filename.to_sThat will tell us what it IS finding okay, so when it does crash, you can see what folder it was looking in, and possibly eliminate those files that ARE being found correctly.
    I wouldn't spend much time on it though - I think it would be much easier to find the issue if you grabbed one of those backtracer scripts. Mithran's Crash Debugger (Global Graphic Object Reference) would do it. But I know there's another one as well. Hime might have written it, maybe?
  8. Yes it did crash.  

    Here is the console printout with a backtrace script in

    consolemessage02_zpsefdd9cfe.png
  9. So do you have the VisRange image in your system folder? It has to be the same case. Not visrange or Visrange.
  10. Yes, it is in the systems folder, with the same case.  I can be sure of this (apart from simply looking, which I did), because the game successfully calls it up for the battle scene.
  11. Can we see the event where you call the script? The documentation states you call it with

    Code:
    visimage("ImageName")
    Maybe that's where it's gone wrong.
  12. The event is shown in the opening post.  It doesn't call the image specifically.  It is identical to the event which called this script in The Tale of a Common Man which has now been played by literally hundreds of players without problem.  The script call is only if you want to change the default image to something else.

    However, just to be doubly sure, I put that script call in.  It resulted in no error crash, but the image didn't show up.
  13. Just a heads up, kjsp17.

    Did you see Sarlecc's edited post about adjusting you switch ID and variable ID?

    I don't know if it will work for you, but maybe you could try his suggestion if haven't already.
  14. @Susan

    Yes, and I increased the maximum of both switches and variables by 100 and then used switches from the newly created batch, so I could be sure that nothing else was using them.  It made no difference, I got exactly the same error message.
  15. Sorry about that, my internet's a bit flaky today.

    Maybe you could check out the things that are different in this project compared to your previous one. Three things I can think of at the moment are :

    - The image being used for the visibility range script, size, and its current format.

    - The VX Ace dll that you are using plus the 'required' scripts.

    - The resolution setting.
  16. If you're loading a save game made whithout Galv's scripts, "visimage" will be nil since "init_visvars" from Game_System won't be ever called, resulting in the same error message you reported.

    Add the following code below Galv's script and above Main. It may fix your problem:

    Code:
    module DataManager    class << self        alias_method(:fix_galvs_visimage_thing, :extract_save_contents)    def extract_save_contents(contents)      fix_galvs_visimage_thing(contents)      $game_system.init_visvars unless $game_system.visimage    end      end  end
  17. @Source

    As I mentioned, this is a 'clean' play through with no new resources added.  The script has actually been in the editor for some months.

    However, that snippet seems to have done the trick anyway, for which I am deeply, deeply, grateful.  Thank you very much.
  18. I'm glad to know it solved your problem, you're welcome. :)
  19. A "clean" play through means choosing New Game from the menu. There's no way that would not have been initialized on a new game.
  20. Exactly. This is why I stated in the OP that I had started a new game and was playing straight through with no resources added during play.