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.

[Resolved] cannot convert nil into String - Darned it.

Status
Not open for further replies.
Sorry if this is a really easy problem - but I'm crap at scripting.  I'm using Netplay, and when I try to change Global Variables I get this error:

Script '[NET] Network' line 866: TypeError occurred.
cannot convert nil into String

And it takes me to this portion of script:

Code:
  #--------------------------------------------------------------------------
  # * Update System Protocol Parts -> ver, mod, 1, 2, 3, 10
  #-------------------------------------------------------------------------- 
  def self.update_system(line)
    case line
     # Version Recieval
     when /<ver>(.*)<\/ver>/ 
      $game_temp.msg = User_Edits::VER_ERROR if $1.to_s == nil 
      @version = $1.to_s if $1.to_s != nil 
      return true
     # Message Of the Day Recieval
     when /<mod>(.*)<\/mod>/
      $game_temp.motd = $1.to_s
      return true
     # User ID Recieval (Session Based)
     when /<1>(.*)<\/1>/
      @id = $1.to_s
      return true
     # User Name Recieval
     when /<2>(.*)<\/2>/
      @name = $1.to_s
      return true
     # Group Recieval
     when /<3>(.*)<\/3>/
      @group = $1.to_s
      return true
     when /<check>(.*)<\/check>/
      @group = $1.to_s
      return true
     # System Update
     when /<10>(.*)<\/10>/
      return true if $1 == nil 
      return true if $1.match(/File|system|`/)
      eval($1) 
      $game_map.need_refresh = true
      return true
     when /<23>(.*)<\/23>/
      eval($1)
      key = []
      key.push(@self_key1)
      key.push(@self_key2)
      key.push(@self_key3)
      $game_self_switches[key] = @self_value
      @self_key1 = nil
      @self_key2 = nil
      @self_key3 = nil
      @self_value = nil
      $game_map.need_refresh = true
      key = []
      return true
     # Attacked!
     when /<attack_effect>dam=(.*) ani=(.*) id=(.*)<\/attack_effect>/
      $game_party.actors[0].hp -= $1.to_i
      #$game_party.actors[0].attack_effect($1)
      $game_player.animation_id = $2.to_i
      #for mplayer in $scene.spriteset.network_sprites.values
      #  mplayer.show_text("Attacks",16,0) if mplayer.netid.to_i == $3.to_i
      #end  
      $scene.spriteset.charsprite.damage($1.to_i,false) if $scene.is_a?(Scene_Map)
      $scene.spriteset.charsprite.whiten if $scene.is_a?(Scene_Map)
      self.send_newhp
      if $game_party.actors[0].hp <= 0 or $game_party.actors[0].dead?
        $game_party.actors[0].hp = $game_party.actors[0].maxhp
        self.send_result($3.to_i)
        if $scene.is_a?(Scene_Map)
          $scene.spriteset.charsprite.collapse 
          while $scene.spriteset.charsprite.effect?
            Graphics.update
            $scene.spriteset.update
          end
        end
        self.send_dead
        $scene = Scene_Gameover.new 
      end
      return true
      # Killed
     when /<result_effect>(.*)<\/result_effect>/ 
       $scene.spriteset.charsprite.show_text("Killed",16,3)
       for mplayer in $scene.spriteset.network_sprites.values
          mplayer.collapse if mplayer.netid.to_i == $1.to_i
       end  
       return true
    end
    return false
  end

Any help would be greatly appreciated.
 
Status
Not open for further replies.

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