Main Menu
  • Welcome to The RPG Maker Resource Kit.

Type error in Cache

Started by DoctorTodd, December 18, 2011, 12:45:46 AM

0 Members and 1 Guest are viewing this topic.

DoctorTodd

Upon entering battle (I'm using Tankentia 2.6, ya I know the older version.) I get error in Cache saying Type error, can not convert nil to string. Does any one have an idea what may have caused this?

LoganF

Not without seeing the project and looking around what code is what. Something is trying to turn a nil object into a string, which you can't do because there's nothing to make a string.

Is that the only script(s) you're using or are there others? Sometimes it's another script trying to use a resource that hasn't been brought into existence yet or was maybe released before it got chance to convert it. Could be other things to.

I'd suggest the usual method of identifying the problem: make a new project and add in scripts one at a time, testing between each new script, and try to recreate the error. If you get that error again this way, you can figure which script may be the problem. Then if you can't figure what might be wrong, upload that project and I'm sure someone can take a look at it.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

DoctorTodd

#2
Dang it that's rather unfortunate, I uploaded the project . May be some one can figure it out right away. If how ever that's not the case then I will create a new project and copy the scripts. So yes I'm using several others.

LoganF

You're link is telling me the download is "temporarily unavailable". It also told me this 6 hours ago when I last checked so I don't know how long "temporary" is.

If possible, can you re-upload that?
(Why do I always feel like it's the end of the world and I'm the last man standing?)

DoctorTodd

#4
Alright here it is

LoganF

#5
The problem is, no filename has been given for the picture being loaded. A 'caller' call points to the culprit being something to do with trying to create a battleback.

I'll take a better look through the relevant code, but maybe that gives you n idea what might be up.

Edit: The offending script is Battle Backgrounds by Synthesize.

It takes the battle background associated with the map you are currently on. I've been making use of Battle Test to test battles specifically, and that would probably cause issues in itself since there is no map to start with.

It looks like a lot of work does that script to set up, since you need to specify a battle background for every map that has battles on it. If you don't set one up for a particular map, you will get a nil object name being passed into the Cache to load a picture which doesn't exist.

If you want to use this script, but not have issues when you don't have a map specified, you can use this fix to load up a default:

Replace line 37 of the script:

image = SynBattleB::Battle_background[$game_map.map_id]


with this:

    if SynBattleB::Battle_background.include?($game_map.map_id)
      image = SynBattleB::Battle_background[$game_map.map_id]
    else
      image = SynBattleB::Battle_background[0]
    end


Then make sure that the hash Battle_background has a key 0 with the filename of the default to use background.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

DoctorTodd