Line723 TypeError occurred

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
I get this funny error that only pops up when I load a saved game. It is an error from the Game_BattlerBase script.

line 723: TypeError occurred.
no implicit conversion from nil to integer.

So it's this thing:

#--------------------------------------------------------------------------
  # * Determine Usability of Normal Attack
  #--------------------------------------------------------------------------
  def attack_usable?
  usable?($data_skills[attack_skill_id])     <---  Line 723
  end

I do have one script that deals with attack skill id's. It is the Yanfly WeaponAttackreplace. In it, I can give weapons specific normal attack id's. This only happens when I load up a saved game though. The script works fine from new game.

But just in case for whatever reason it isn't that script despite the evidence. Here are all my scripts:

YanflyWeaponAttackreplace

Tsukihime EffectManager

Tsukihime Autostate

Tsukihime Instance items and the fix for it

Equipmentbase script and the equipmentlevel script from Selchar and Tsukihime.

Just me trying to learn a little bit when it says no implicit conversion from nil to integer. Is it trying to tell me that there is no automatic change from attack skill id 1 to whatever the id is for any equipped weapon?
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
It means you're trying to access an array using nil, which is not supported. It requires an integer, as the message indicates.


So for whatever reason, attack_skill_id points to nil.


If you added the script recently and tried to test on a saved file, it may not be initialized properly.
 
Last edited by a moderator:

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
If you added the script recently and tried to test on a saved file, it may not be initialized properly.
Nope. I always completely exit the editor then restart it after installing a script.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
No I mean if you try to load a save file, the save file may not have the required data initialized.


Yanfly's scripts generally do not provide support for save files.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Scripts that modify properties in the data ($game) classes will almost ALWAYS have issues if you add the script and then try to resume a game that was saved before the script was added. It does not surprise me that you are getting this error when trying to load an older save file.


Start a new game, save it, then try to reload it. I suspect the error will not happen.
 
Last edited by a moderator:

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
Scripts that modify properties in the data ($game) classes will almost ALWAYS have issues if you add the script and then try to resume a game that was saved before the script was added. It does not surprise me that you are getting this error when trying to load an older save file.

Start a new game, save it, then try to reload it. I suspect the error will not happen.
Actually, I've done this too. This was how I figured out that it was the save causing the error. It wouldn't show up when I played from new game but once I loaded after making non script related edits to basic parameters of a weapon and testing it, the error appeared.

So I take it I should look for another cool script like that one? Because it's a really good one but if I can't load a file without it crashing.. :(
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
Are you loading from a saved game that was created before adding the script?


If so, then Hime's Instance Weapons that have been created before that point have no @attack_skill, so it returns nil. And because Yanfly's notetag loads on data initialize (at the game start), it is not re-reading the additional created instance items' notetag.


Just start a new game and try saving from there. I bet it won't throw any error.
 
Last edited by a moderator:

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
Are you loading from a saved game that was created before adding the script?
No. I started a new game after both adding the script and restarting RPGMaker. I Played from this new game, then saved. Then loaded that save file. And it began to crash.

But I think I found a very similar script that helps me overcome this problem.

Kread EX states that he took this script idea and used it to use Custom Weapon formulas. Works just the same as the Yanfly script only with

the formula in the weapon tag. And it works without crashes =D.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You started a new game, but then you DID go in and edit things in the database.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top