N.A.S.T.Y. Extra Stats + Equipment screen = error

Good day, gentlemen.

Today, I stumbled upon something I can neither understand nor fix.

After implementing the script called N.A.S.T.Y. Extra Stats (http://forums.rpgmakerweb.com/index.php?/topic/998-nasty-extra-stats/ ), I tried experimenting a little by calling the extra stats into the equipment screen.

However! A line like



Code:
draw_text(71, line_height * 8, 36, line_height, @actor.xstat.str, 2)
Gave me a NoMethodError (undefined method 'xstat' for nil:Nilclass).

While trying in both the Status and Equipment screen to find out '@actor', they were identical, so I don't really see why it's not working...

A way around this would be for a way to check the ID of the character you're changing the equipment from, as $game_actors[actor_id].xstat.STAT, where STAT is the name of the stat, does seem to work. '@actor_id' for actor_id doesn't seem to work, and @actor gives off a strange string like #<Game_Actor:0x930e11c>. This string changes every time I start the game, so it wouldn't work to check if this string is equal to a certain actor's.

Somebody, save me, I beg of thee!
The error message pretty much makes it clear what the issue is: @actor refers to nil.

You need to make sure that @actor actually contains a reference to a Game_Actor object, and if you print out what @actor is, it should be #<Game_Actor: ... >

The numbers are not important it is just a memory address where the object is stored.

So just print out what @actor is right before the draw_text call and verify that it's not nil.

That's why some of the windows always have things like



Code:
if @actor
  do this ...
=o it works! Thank you very much!

(To think I spent about 2 hours trying useless things...)

Original thread: https://forums.rpgmakerweb.com/threads/n-a-s-t-y-extra-stats-equipment-screen-error.3001/