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.

No Method Error on every script, even on blank lines!!!

Scuff

Member

I started up my project like i do every day, added a new script. But I did not like it, so i deleted it.
Then when i try to play my game again, I get a No Method Error. For some reasonm this error is happening on more than one script, even the RTP scripts. I also get a No Method Error on blank lines, such as this:

===============
"name here"
===============

I would get a No Method error on the "===========" lines.
I really need help, please :cry:
 

Scuff

Member

I think I do have those lines.... but anyway here Is whats going on now. Im getting this error for Main:
mainerror1.jpg

Here Is my Main,
mainerror.jpg
 
All right. I see no line number in that error message. Try putting the cursor at a different point at a different script, by doing something like deleting and restoring a comment. Then, start the debug test over and tell me if it leaves the cursor where you put it, or if it puts it back somewhere else.
 

Scuff

Member

Ok, after reading what you said, i tried it. I deleted a comment line In another script, then I put it back. I tested my game just by clicking on the "Play" button. Then I get the same error. When i open up the script window It takes my cursor and puts here:
error6g.jpg

Second, how to i do a De-Bug test?
 
A debug test is what you're doing every time you play the game from the editor instead of the Game.exe. (Try pressing F9, and you can edit the variables and switches for the game) Anyway, it looks like the program actually can't pinpoint the location of your error. That means we're going to have to dig through the code. First off, how far does it get before it gives the error message? Does it load anything, or is it pretty much immediate? If it's pretty much immediate, I'd guess that the issue is in your Splash Scene script, since that's the first thing loaded, aside from Main.
 

Scuff

Member

Well, here Is whats going on. I just added a new script the game, but I did not like it. So i took it out, after i took it out the game started giving me those errors. When i add the script back, it works.
The errors are immediate.
EDIT: Here Is the script.
Code:
#==============================================================================

 #==============================================================================

 #Light Circle Script updated(19-7-2009)

 #==============================================================================

 #==============================================================================

 # ** Spriteset_Map

 #------------------------------------------------------------------------------

 #   This class brings together map screen sprites, tilemaps, etc.

 #   It's used within the Scene_Map class.

 #==============================================================================

  class Scene_Save < Scene_File

     

      alias t_write_save_data write_save_data

     

      def write_save_data(file)

      t_write_save_data(file)

      Marshal.dump($sensitivity,file)

      Marshal.dump($sensitivity_2,file)

      Marshal.dump($light_switch,file)

      Marshal.dump($flick,file)

   end

   end

 #==============================================================================

  class Scene_Load < Scene_File

      alias t_read_save_data read_save_data

      def read_save_data(file)

         t_read_save_data(file)

        $sensitivity = Marshal.load(file)

        $sensitivity_2 = Marshal.load(file)

        $light_switch = Marshal.load(file)

        $flick = Marshal.load(file)

      end

      end

  #==============================================================================

 class Game_Player< Game_Character

   def change_sensitivity(value,type)

      case type

      when "sensitivity"

         $sensitivity=value

         when "sensitivity_2"

            $sensitivity_2[0]=value

      end

      end

   end

 #==============================================================================

  

 class Scene_Title

  #------------------------------------------------------------------------#change initial sensitivity

  alias t_main main

   def main

     $light_switch=1

      $sensitivity=1

      $sensitivity_2=[]

      $sensitivity_2[0]=1

      $flick=0

      t_main

      end

   end

  

  

  #==============================================================================

 class Spriteset_Map

   #--------------------------------------------------------------------------

   # * Object Initialization

   #--------------------------------------------------------------------------

   def initialize

      #-------------------------------------------------------------------change initial setting

      @tone=75

      @limit=0.2

      @light_limit=7

      @x_limit=640

      @y_limit=480

      #---------------------------------------------------------------------------

      @random=[]

      @r_value=[]

     @black=[]

      @x_x=[]

      @y_y=[]

      @xx=[]

      @yy=[]

      black_once

      i=0

      loop do

         @black[i]=-@tone

         break if i=10

         i+=1

      end

      @viewport1 = Viewport.new(0, 0, 640, 480)

      @viewport2 = Viewport.new(0, 0, 640, 480)

      @viewport3 = Viewport.new(0, 0, 640, 480)

      @viewport4=[]

      @viewport5=[]

      @viewport8=[]

      #------------------------------------

        @y=0

      loop do

         @x=0

      loop do

      @viewport4[@y*21+@x] = Viewport.new(@x*32-16, @y*32-16, 32, 32)

      @viewport4[@y*21+@x].tone = Tone.new(-255, -255, -255, 0)

      @viewport4[@y*21+@x].z = 199

      @viewport5[@y*21+@x] = Viewport.new(@x*32-27, @y*32-27, 32, 32)

      @viewport5[@y*21+@x].tone = Tone.new(-255, -255, -255, 0)

      @viewport5[@y*21+@x].z = 199

      @viewport8[@y*21+@x] = Viewport.new(@x*32-5, @y*32-5, 32, 32)

      @viewport8[@y*21+@x].tone = Tone.new(-255, -255, -255, 0)

      @viewport8[@y*21+@x].z = 199

      break if @x==20

      @x+=1

   end

   break if @y==15

   @y+=1

 end

  

      #------------------------------------

      @viewport2.z = 200

      @viewport3.z = 5000

      # Make tilemap

      @tilemap = Tilemap.new(@viewport1)

      @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

      for i in 0..6

         autotile_name = $game_map.autotile_names[i]

         @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)

      end

      @tilemap.map_data = $game_map.data

      @tilemap.priorities = $game_map.priorities

      # Make panorama plane

      @panorama = Plane.new(@viewport1)

      @panorama.z = -1000

      # Make fog plane

      @fog = Plane.new(@viewport1)

      @fog.z = 3000

      # Make character sprites

      @character_sprites = []

      for i in $game_map.events.keys.sort

         sprite = Sprite_Character.new(@viewport1, $game_map.events[i])

         @character_sprites.push(sprite)

      end

      @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

      # Make weather

      @weather = RPG::Weather.new(@viewport1)

      # Make picture sprites

      @picture_sprites = []

      for i in 1..100

         @picture_sprites.push(Sprite_Picture.new(@viewport2,

            $game_screen.pictures[i]))

         end

        

      # Make timer sprite

      @timer_sprite = Sprite_Timer.new

      # Frame update

      update

   end

   #--------------------------------------------------------------------------

   # * Dispose

   #--------------------------------------------------------------------------

   def dispose

      # Dispose of tilemap

      @tilemap.tileset.dispose

      for i in 0..6

         @tilemap.autotiles[i].dispose

      end

      @tilemap.dispose

      # Dispose of panorama plane

      @panorama.dispose

      # Dispose of fog plane

      @fog.dispose

      # Dispose of character sprites

      for sprite in @character_sprites

         sprite.dispose

      end

      # Dispose of weather

      @weather.dispose

      # Dispose of picture sprites

      for sprite in @picture_sprites

         sprite.dispose

      end

      # Dispose of timer sprite

      @timer_sprite.dispose

      # Dispose of viewports

      @viewport1.dispose

      @viewport2.dispose

      @viewport3.dispose

      @y=0

      loop do

         @x=0

      loop do

      @viewport4[@y*21+@x].dispose

      @viewport5[@y*21+@x].dispose

      @viewport8[@y*21+@x].dispose

      break if @x==20

      @x+=1

   end

   break if @y==15

   @y+=1

   end

   end

      #--------------------------------------------------------------------------

   # * call character sprite

   #--------------------------------------------------------------------------

   def character_sprites(id)

      return @character_sprites[id]

   end

   #--------------------------------------------------------------------------

   # * Frame Update

   #--------------------------------------------------------------------------

   def black_once

      for event in $game_map.events.values

           if event.list && event.list[0].code == 108

              i=1

              loop do

         if event.list[0].parameters.to_s == i.to_s

               @xx[i]=event.x*32

               @yy[i]=event.y*32

$sensitivity_2[i]=event.list[1].parameters.to_s .to_i

@r_value[i]=event.list[2].parameters.to_s .to_i

            end

            break if i== @light_limit

            i+=1

          end

          

         end

        end

   end

  

   #-------------------------------------------------------------------------

   def find_black

  

      @x_x[0] = (@x)*32-($game_player.x*32-$game_map.display_x/4)-16

         @y_y[0] = (@y)*32-($game_player.y*32-$game_map.display_y/4) -16

         x2=(@x_x[0])*(@x_x[0])

         y2=(@y_y[0])*(@y_y[0])

@black[0] =(($sensitivity+$sensitivity_2[0]+@random[0])*60)/((x2+y2)*0.0005+5)#($sensitivity+$sensitivity_2[0])/(Math.sqrt(x2+y2))

      i=1

      loop do

         if @xx[i]==nil

            break

           end

         @x_x[i]=@x*32-(@xx[i]-$game_map.display_x/4)-16

      @y_y[i]=@y*32-(@yy[i]-$game_map.display_y/4)-16

if !((@xx[i] -   $game_player.x*32) > @x_limit || (@xx[i] -   $game_player.x*32) <-@x_limit || (@yy[i] -   $game_player.y*32) > @y_limit || (@yy[i] -   $game_player.y*32) <-@y_limit )

@black[i] =(($sensitivity+$sensitivity_2[i]+@random[i])*60)/((@x_x[i]*@x_x[i]+@y_y[i]*@y_y[i])*0.0005+5)#($sensitivity+$sensitivity_2[i])/(Math.sqrt(@x_x[i]*@x_x[i]+@y_y[i]*@y_y[i]))

@black[0]+=@black[i]

end

  

break if i==@light_limit

 i+=1

end

@black[0]=@black[0]-@tone

end

 

 

 #------------------------------------------------------------------------------

   def update

      # If panorama is different from current one

      if @panorama_name != $game_map.panorama_name or

           @panorama_hue != $game_map.panorama_hue

         @panorama_name = $game_map.panorama_name

         @panorama_hue = $game_map.panorama_hue

         if @panorama.bitmap != nil

            @panorama.bitmap.dispose

            @panorama.bitmap = nil

         end

         if @panorama_name != ""

            @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

         end

         Graphics.frame_reset

      end

      # If fog is different than current fog

      if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue

         @fog_name = $game_map.fog_name

         @fog_hue = $game_map.fog_hue

         if @fog.bitmap != nil

            @fog.bitmap.dispose

            @fog.bitmap = nil

         end

         if @fog_name != ""

            @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)

         end

         Graphics.frame_reset

      end

      # Update tilemap

      @tilemap.ox = $game_map.display_x / 4

      @tilemap.oy = $game_map.display_y / 4

      @tilemap.update

      # Update panorama plane

      @panorama.ox = $game_map.display_x / 8

      @panorama.oy = $game_map.display_y / 8

      # Update fog plane

      @fog.zoom_x = $game_map.fog_zoom / 100.0

      @fog.zoom_y = $game_map.fog_zoom / 100.0

      @fog.opacity = $game_map.fog_opacity

      @fog.blend_type = $game_map.fog_blend_type

      @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox

      @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

      @fog.tone = $game_map.fog_tone

      # Update character sprites

      for sprite in @character_sprites

         sprite.update

      end

      # Update weather graphic

      @weather.type = $game_screen.weather_type

      @weather.max = $game_screen.weather_max

      @weather.ox = $game_map.display_x / 4

      @weather.oy = $game_map.display_y / 4

      @weather.update

      # Update picture sprites

      for sprite in @picture_sprites

         sprite.update

      end

      # Update timer sprite

      @timer_sprite.update

      # Set screen color tone and shake position

      @viewport1.tone = $game_screen.tone

      @viewport1.ox = $game_screen.shake

      # Set screen flash color

      @viewport3.color = $game_screen.flash_color

      # Update viewports

         @viewport1.update

      @viewport3.update

  

      if Graphics.frame_count % (6) == 0

        if $light_switch==1

          @random[0]=rand($flick+1)

      i=1

          loop do

            @r_value[i]=0 if @r_value[i]==nil

          @random[i]=rand(@r_value[i]+1)

          break if i==@light_limit

          i+=1

          end     

      @y=0

      loop do

         @x=0

      loop do

 find_black

 @black[0]=0 if @black[0]>0

  @black[0]=-@tone if @black[0]<-@tone

      @viewport4[@y*21+@x].tone =Tone.new(@black[0], @black[0], @black[0], 0)

@viewport5[@y*21+@x].tone=@viewport4[[@y-1,0].max*21+[@x-1,0].max].tone

            @viewport8[@y*21+@x].tone=@viewport4[[@y+1,15].min*21+[@x+1,20].min].tone

      break if @x==20

      @x+=1

   end

   break if @y==15

   @y+=1

 end

 @on=nil

else

  if @on==nil

    @y=0

      loop do

         @x=0

      loop do

 

  

      @viewport4[@y*21+@x].tone =Tone.new(0,0,0, 0)

            @viewport5[@y*21+@x].tone=Tone.new(0,0,0, 0)

            @viewport8[@y*21+@x].tone=Tone.new(0,0,0, 0)

      break if @x==20

      @x+=1

   end

   break if @y==15

   @y+=1

 end

    @on=true

    end

 end

 end

  

 #---------------------------------------------------------------------

  

#  

   end

 end
 

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