Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Enu SBS Tanketai XP migration error

Hello,

I'm thinking of using the Enu SBS Tanketai CBS, and it looks like I have most of it moved over from the demo to my current project, but it seems to be having a problem with part of it. When I try and open the menu I get: "Sideview 2 line 2956: TypeError occurred. cannot convert nil into String". Here's the lines before and after 2956. I bolded line 2956 to help see where the error is coming from.

def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = "ATK"
parameter_value = actor.atk
when 1
parameter_name = "PDEF"
parameter_value = actor.pdef
when 2
parameter_name = "MDEF"
parameter_value = actor.mdef
when 3
parameter_name = "STR"
parameter_value = actor.str
when 4
parameter_name = "DEX"
parameter_value = actor.dex
when 5
parameter_name = "SPD"
parameter_value = actor.spd
when 6
parameter_name = "INT"
parameter_value = actor.int
when 7
parameter_name = "MND"
parameter_value = actor.mnd
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end

Any ideas?

Thanks for your time!
 
parameter_name is probably nil,
draw_actor_parameter(actor, x, y, type) So the type argument here must be different from 1...7


Try this:

self.contents.draw_text(x, y, 120, 32, parameter_name)
change to this:
Code:
 

if (parameter_name != nil)

   self.contents.draw_text(x, y, 120, 32, parameter_name)

end

 
also try this after, tell me what it prints.
Code:
 

if (parameter_name != nil)

   self.contents.draw_text(x, y, 120, 32, parameter_name)

else

   print type

end

 

This wont fix it for sure, because the error is cause when that method is called, I think. But It should let open the menu, and then we can try and see which text is missing and find out why.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top