RPG Maker VX Ace Script Error

● ARCHIVED · READ-ONLY
Started by Roxen010 9 posts View original ↗
  1. Hello,Im in game a error getting..What is the problem? Thank You!

    Error Message:
    Script `*Galv`s Character Animation' line 175: NoMethodError occurred.

    undefined method `name' for nil:NilClass


    EDIT: Im RPG Maker VX Ace using..

    https://galvs-scripts.com/category/rmvxa-scripts/audiovisual-effects/#post-23

    Adsız.png
    -CODE:
    Code:
    #------------------------------------------------------------------------------#
    #  Galv's Character Animations
    #  Edit by KK20, Chaucher and Ally for Fleshforward
    #------------------------------------------------------------------------------#
    # KK20's Notes:
    #   The script has been modified to allow map events to have the various
    #   animations like the Player and Followers did in the original script.
    #
    #   For an event to have idle and move sprites, simply put the following:
    #          [idle]
    #   anywhere in the event's name.
    #------------------------------------------------------------------------------#
    #  For: RPGMAKER VX ACE
    #  Version 2.0
    #------------------------------------------------------------------------------#
    #  2013-01-07 - Version 1.7 - Slight tweaks
    #  2012-10-06 - Version 1.6 - Updated alias names for compatibility
    #  2012-10-06 - Version 1.5 - Added dash speed option. Fixed some code
    #  2012-09-21 - Version 1.4 - Optimised the code significantly (to my ability)
    #                           - Some bug fixes
    #  2012-09-21 - Version 1.3 - Added ability to repeat common event
    #                           - Added follower animations
    #  2012-09-20 - Version 1.2 - fixed compatibility with Galv's Region Effects
    #  2012-09-20 - Version 1.1 - added idle common event, removed unnecessary code
    #  2012-09-20 - Version 1.0 - release
    #------------------------------------------------------------------------------#
    #  Designed to give actors additional animations such as:
    #  - Idle
    #  - Walking
    #  - Dashing
    #  - Custom (run a common event if you've been idle for a period of time)
    #
    #  INSTRUCTIONS:
    #  1. Copy this script below materials and above main
    #  2. Create your charsets to use one characterset per actor. (This is where
    #     version 2 differs from version 1 greatly.
    #     The first character in the charset is the Idle animation
    #     The second character in the charset is the Walk animation
    #     The third character in the charset is the Dash animation
    #
    #  (See demo if you don't understand) This change was done to reduce processing
    #  significantly and prevent lag when doing too much at once)
    #
    #------------------------------------------------------------------------------#
    #  KNOWN ISSUES:
    #  - Move Route Change graphic commands only work when the switch is on.
    #    Then if you turn it off again, the graphic changes back to the original.
    #    Use "Set Actor Graphic" event command to change instead.
    #------------------------------------------------------------------------------#
    ($imported ||= {})["Chara_Anims"] = true
    module Chara_Anims
    
    #------------------------------------------------------------------------------#
    #  SETUP OPTIONS
    #------------------------------------------------------------------------------#
    
      ANIM_SWITCH = 9             # ID of a switch to disable this effect.
                                  # Turn switch ON in order to use change graphic
                                  # move route commands. Turn off to restore anims.
    
      DASH_SPEED = 1.2            # 1 is RMVX default dash speed.
    
      COMMON_EVENT = 1            # Common event ID that plays after a certain time
      COMMON_EVENT_TIME = 300     # Frames idle before common event called.
      REPEAT_EVENT = false        # Repeat this common event if player remains idle?
                                  # (restarts the common event time) true or false.
    #------------------------------------------------------------------------------#
    #  END SETUP OPTIONS
    #------------------------------------------------------------------------------#
    
    end # Chara_Anims
    
    
    class Sprite_Character < Sprite_Base
    
      alias galv_charanim_initialize initialize
      def initialize(viewport, character = nil)
        @idletime = 0
        galv_charanim_initialize(viewport, character)
      end
    
      alias galv_charanim_update update
      def update
        galv_charanim_update
        #CHAUCER : only execute below code if file has more 3 frames.
        if @character_name && @character_name.include?("%")
        #CHAUCER : end of changes.
          return if !is_player? && !@character.allow_idle_sprites
          return if $game_switches[Chara_Anims::ANIM_SWITCH]
          return move_anim if @character.moving?
          @idletime += 1
          idle_anim if @idletime == 5
          idle_event if @idletime == Chara_Anims::COMMON_EVENT_TIME
        end
      end
    
      def idle_anim
        return if !$game_party.leader && is_player?
        @character.step_anime = true
        if is_player? && $game_party.leader.character_index != 0
          $game_party.battle_members.each { |m| m.set_g(0) }
        else
          @character.set_g(0)
        end
        $game_player.refresh if is_player?
        @idletime += 1
      end
    
      def move_anim
        return if !$game_party.leader
        if is_player?
          #CHAUCER : added "and $game_player.stamina"
          if $game_player.dash? and !$game_player.stamina_wasted
          #CHAUCER : end of changes.
            if $game_party.leader.character_index != 2
              $game_party.battle_members.each { |m| m.set_g(2) }
              $game_player.refresh
            end
          else
            if $game_party.leader.character_index != 1
              $game_party.battle_members.each { |m| m.set_g(1) }
              $game_player.refresh
            end
          end
        else
          @character.set_g(1)
        end
        @idletime = 0
      end
    
      def idle_event
        return unless is_player?
        # Chaucer : taken from v2.1
        @idletime = 0 if $game_map.interpreter.running?
        # end of changes.
        $game_temp.reserve_common_event(Chara_Anims::COMMON_EVENT)
        @idletime = 0 if Chara_Anims::REPEAT_EVENT
      end
    
      def is_player?
        @character == $game_player
      end
    end # Sprite_Character < Sprite_Base
    
    
    class Game_CharacterBase
      alias galv_charanim_init_public_members init_public_members
      def init_public_members
        galv_charanim_init_public_members
        @step_anime = true
      end
    
      # OVERWRITE FOR PERFORMANCE PURPOSES
      def real_move_speed
        @move_speed + (dash? ? Chara_Anims::DASH_SPEED : 0)
      end
    end # Game_CharacterBase
    
    class Game_Actor < Game_Battler
      def set_g(i)
        @character_index = i
      end
    end # Game_Actor < Game_Battler
    
    class Game_CharacterBase#class Game_Actor < Game_Battler
      attr_accessor :step_anime, :allow_idle_sprites
      def set_g(i)
        @character_index = i
      end
    end # Game_Actor < Game_Battler
    
    class Game_Event < Game_Character
      alias prep_sprite_for_idle_move_animations initialize
      def initialize(map_id, event)
        @allow_idle_sprites = ((event.name =~ /[idle]/) != nil)
        prep_sprite_for_idle_move_animations(map_id, event)
    
        # Chaucer : added this to prevent enemies from animating on the map.
        enemy = event.pages.index{ |a| a.list[0].code == 108 &&
        a.list[0].parameters[0].include?( "enemy_id" ) }
        if !enemy.nil? && enemy != event.pages.index( @page )
          org_pattern = character_name.split("%")[1].match( /\d+/ )
          @original_pattern = @pattern = org_pattern.to_s.to_i - 1
          @allow_idle_sprites = false
          if !$game_map.memorize_pos[@map_id].nil?
            print $game_map.memorize_pos[$game_map.map_id][@id]
            @direction = $game_map.memorize_pos[$game_map.map_id][@id][2]
          end
        end
        # End of changes.
      end
    end
  2. I've moved this thread to Script Support. Thank you.


    Can you please link to Galv's script so that others can easily look at it in order to help you?
  3. How so?
  4. Go to the page on Galv's website where you got the script.
    Copy the url.
    Then use the Edit button on your first post.
    Select the 'Link' icon on the menu bar of your post - it looks like a link in a chain.
    Past the copied url in there.
    Click insert.
    Click Save changes button on your post.
  5. It`s like this?
  6. The script you posted was an old version, maybe you took it from the demo?
    Here: https://galvs-scripts.com/galvs-character-animations/ is the recent one
    The total line is only up to 140 while your error notification shows line 175.
    Try to update / use the recent version, see if it solves it.
  7. The script you posted was modified for a specific game, and chances are, it will not work in other projects.

    More importantly...
    That game is the one you linked, but unless you are part of the development team, you have no permission to decrypt the files of that game.
    I can't see your name on the dev team of Fleshforward, so it's kinda fishy. But I will let those in charge here decide about this.
  8. [mod]@Roxen010 We do not allow ripped resources on this site. The evidence suggests that the script you want help with was ripped from another game, rather than being Galv's unmodified script referred to in post #6, and so no help will be given to make it work.

    I am, therefore, closing this thread. If you can provide evidence that you have a right to use that script, please pm me or any other mod with that evidence. This thread can than be re-opened.[/mod]