[VX Ace] Incompatibility between Galv's Character Effects & Two of Victor's Scripts

● ARCHIVED · READ-ONLY
Started by Robert-Developer_of_Bis 17 posts View original ↗
  1. Hello! I'm about to go to bed, but I thought I'd get this ball rolling while I'm up. I'm attempting to implement the titular script, Galv's Character Effects, which adds, among other things, dynamic shadows for events based on specified light sources. It works, but is encountering some visual issues due to two of Victor's scripts that affect sprites: Diagonal Movement and Multi Frames. The former adds the obvious, as well as accompanying sprites, and the latter extends the number of frames in an animation through the animation sprite's file name. When used together, they create some interesting bugs.

    Game_Bug_025.png

    As you can see in this image, the player's shadow is bizarre-looking. This is due to Character Effects using the spritesheet without breaking it up as Multi-Frames does, leading to 'multiple' player shadows appearing.

    The other incompatibility, which is not so simple, is that, if the player attempts to walk diagonally while Character Effects is installed, the game will crash.

    Game_Bug_026.png

    Included with this post is my current sprite sheet. Might be useful. It'll look odd in-game, because it's normally used with Victor's Character Control, but it shouldn't be necessary here. All of Victor's scripts, by the way, require this script to function.

    Any help, as always, is appreciated.
  2. Bump!
  3. Bump.
  4. Bump?
  5. Bump~
  6. B U M P.
  7. B̵̫̯̝̘̗̰̩̙̀͆ů̵͓̝͒ͩ́͘m̶̏̀̋̽ͩ̈́҉͎̗̺̭̯̻̯͓p̢̹ͮ̐̇̎͋ͧ͟.̌ͪ͌̎̉ͭ̾̚͏̞͇̻̜͜
  8. Hey there,

    Haven't tested it yet (at all), but you could try using this:
    Spoiler
    Code:
    #=============================================================================
    #
    #  Compatibility Patch for Galv's Character Effects and
    #    Victor Sant's Multiframes and Diagonal Movement
    #  Version 0.1 (28th June, 2018)
    #  By Another Fen <forums.rpgmakerweb.com>
    #
    #  (Consists in large parts of code copied from the aforementioned scripts)
    #
    # Contents: ------------------------------------------------------------------
    #  This Script modifies the Sprite part of Galv's Character Effects to make
    #  them compatible to Victor Sant's Multiframes and Diagonal Movement.
    #
    # Usage: ---------------------------------------------------------------------
    #  Requires Victor Sant's Multiframes (1.03) and Diagonal Movement (1.09)
    #  Should be placed below Galv's Character Effects (2.1).
    #  
    #=============================================================================
    
    #=============================================================================
    #  Sprite_Character
    #=============================================================================
    class Sprite_Character
     
      #---------------------------------------------------------------------------
      # Sprite_Character#update_src_rect  (Modified)
      #   Extracted character index. Includes Multiframes / Diagonal Movement.
      #---------------------------------------------------------------------------
      def update_src_rect
        if @tile_id == 0
          index = character_index
          sx = (index % 4 * horizontal_frames + pattern_index) * @cw
          sy = (index / 4 * vertical_frames + direction_index) * @ch
          self.src_rect.set(sx, sy, @cw, @ch)
        end
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#character_index
      #   Displayed character set index.
      #---------------------------------------------------------------------------
      def character_index
        @character.character_index
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#horizontal_frames
      #   Number of horizontal frames per character set
      #---------------------------------------------------------------------------
      def horizontal_frames
        @character_name[/\[F(\d+)\]/i] ? @character.frames : 3
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#vertical_frames
      #   Number of vertical frames per character set
      #---------------------------------------------------------------------------
      def vertical_frames
        4
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#pattern_index
      #   Displayed character pattern index
      #---------------------------------------------------------------------------
      def pattern_index
        pattern = @character.pattern
        return (pattern < 3 || @character_name[/\[F(\d+)\]/i]) ? pattern : 1
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#direction_index
      #   Displayed character direction index
      #---------------------------------------------------------------------------
      def direction_index
        if @character.diagonal?
          return { 1 => 0, 7 => 1, 3 => 2, 9 => 3 }[@diagonal]
        else
          return (@character.direction - 2) / 2
        end
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#extended_bitmap_name
      #   Extended alternate bitmap names for subclasses (see Diagonal Movement)
      #---------------------------------------------------------------------------
      def extended_bitmap_name(name)
        extended_name = name + ($imported[:ve_visual_equip] ? "" : diagonal_sufix)
        return character_exist?(extended_name) ? extended_name : name
      end
    end
    
    
    #=============================================================================
    #  Sprite_Reflect
    #=============================================================================
    class Sprite_Reflect
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#set_character_bitmap  (Modified)
      #   Moved changes to other methods designated by the VE Basic Module.
      #---------------------------------------------------------------------------
      def set_character_bitmap
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#set_bitmap_name  (Overridden)
      #   See Sprite_Reflect#set_character_bitmap
      #---------------------------------------------------------------------------
        def set_bitmap_name
        reflect = @character.reflect_sprite
        return (reflect) ? extended_bitmap_name(reflect[0]) : super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#set_bitmap_position  (Overridden)
      #   See Sprite_Reflect#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_position
        self.mirror = true
        self.angle = 180
        self.opacity = 220
        self.z = Galv_CEffects::REFLECT_Z
        self.wave_amp = $game_map.reflect_options[0]
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#character_index  (Overridden)
      #   Specify reflection character index
      #---------------------------------------------------------------------------
      def character_index
        @character.reflect_sprite ? @character.reflect_sprite[1] : super
      end
    end
    
    
    #=============================================================================
    #  Sprite_Mirror
    #=============================================================================
    class Sprite_Mirror
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#set_character_bitmap  (Modified)
      #   Move changes to methods designated by the VE basic module
      #---------------------------------------------------------------------------
      def set_character_bitmap
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#set_bitmap_name  (Overridden)
      #   See Sprite_Mirror#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_name
        reflect = @character.reflect_sprite
        return (reflect) ? extended_bitmap_name(reflect[0]) : super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#set_bitmap_position  (Overridden)
      #   See Sprite_Mirror#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_position
        self.mirror = true
        self.opacity = 255
        self.z = Galv_CEffects::REFLECT_Z
        super
      end
    
      #---------------------------------------------------------------------------
      # Sprite_Mirror#character_index  (Overridden)
      #   Specify reflection character index
      #---------------------------------------------------------------------------
      def character_index
        @character.reflect_sprite ? @character.reflect_sprite[1] : super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#direction_index  (Overridden)
      #   Mirror direction
      #---------------------------------------------------------------------------
      def direction_index
        return vertical_frames - 1 - super
      end
    end
    
    
    #=============================================================================
    #  Sprite_Shadow
    #=============================================================================
    class Sprite_Shadow < Sprite_Character
    
      #---------------------------------------------------------------------------
      # Sprite_Shadow#set_character_bitmap  (Modified)
      #   Move changes to methods designated by the VE basic module
      #---------------------------------------------------------------------------
      def set_character_bitmap
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Shadow#set_bitmap_position  (Overridden)
      #   See Sprite_Mirror#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_position
        self.color = Color.new(0, 0, 0, 255)
        self.z = Galv_CEffects::SHADOW_Z
        self.wave_amp = 1 if $game_map.shadow_options[2]
        self.wave_speed = 1000
        super
      end
    end
  9. Wow, thank you! I'll test it out as soon as I can. I'm also glad you replied- because I was running out of "Bump." variations!

    Edit: Okay, so I've tested it. Not only did your patch fix the crash, but it also cleaned up the shadow issue as well! However, it did create another issue, where the shadow, instead of being... shadowy... is a ghostly image of the player. I can't really explain this well; here, just look at this screenshot.

    Game_Bug_033.png

    Any idea what's making this occur?
  10. Bump? @Another Fen , are you still around?
  11. Sorry for the late response.

    It's most likely that a part of Victors Basic Module clashes with one of the scripts currently placed below it.
    Some script probably replaces the "set_character_bitmap" method of Sprite_Character, nullifying the changes made by the Basic Module to it.

    You could try to find possible culprits by searching your scripts for
    def set_character_bitmap
    (by pressing CTRL+SHIFT+F in the script editor). Not every result is automatically problematic and it is not guaranteed you find every spot where that method is redefined (even though it should in like 99% of the cases), but it is usually a good starting point.
  12. Alright. I'm really sick today, but I'll check now, since I caught your message early.

    ...

    Okay, I followed your instructions, and 'set_character_bitmap' appears twice in Sprite_Character of course, three times in Galv's Character Effects, three times in Victor Engine Basic Module, once in Victor's Multi-Frame Sprites, and eleven times in your patch.

    Order might be important too; where am I meant to place your patch: above or below the relevant scripts?
  13. Sorry for the late response, again^^

    Ah, okay then, was worth the try. =)
    The shadow effect should come from taking the player character and giving it a black tone. The black tone seems to be missing for some reason, and another script replacing Sprite_Characters "set_character_bitmap" method after Victors Basic Module has done the same would have been a possible explanation, considering that the tone was not missing before the fix (when Galv's script defined its own "set_character_bitmap" for its shadow sprites, circumventing parts of Victors addons).

    Anyways, as for the ordering: You should place the script below Galv's Character Effects, otherwise it would probably not fix the diagonal movement issue. It should not really matter whether you place it below Victors scripts though.

    You could try to use the script in a test project with all unrelated scripts turned off and see if the problem persists. In case it doesn't, you could then try adding more scripts until you have found the issue.
    Can't really point out an obvious problem here I fear, I didn't have this issue in my project.
  14. I found the issue! The culprit is Vlue's Event Fine Tuning script! It's never had any conflicts before, so I had never suspected it. Unfortunately, it causes the issue no matter its placement, and it's invaluable to part of my map setup, so it looks like I'll need a patch for it, as well. I'm really sorry for the trouble! I completely understand if you're busy, so please, take all the time you need.

    On the bright side, I had recognized your name when you first posted on this thread, and I realized it's because I had used your self-variables script! It worked perfectly for the time that I had used it, so thank you!
  15. Naa, I hope future answers will not take me one week again... :]
    Anyways, the problem seems to be that the script competes with Galv's Character effects for setting the color tone of the shadow sprite. The reason it originally worked is because the issue with Victor's diagonal movement caused the shadow tone to be set more often than otherwise necessary.

    You could try to add this to remove the blend color from the shadow sprite (placement should not matter, as long as it is above main):
    Code:
    class Sprite_Shadow
     
      #---------------------------------------------------------------------------
      # Sprite_Shadow#blend_update  (Overridden)
      #   Remove the color change introduced by Vlue's Eventing Fine Tuning
      #---------------------------------------------------------------------------
      def blend_update
      end
    end


    I'm glad you found the self-variables script helpful. :)
    Unfortunately the original place has been taken down apparently. If you ever need a similar option again I would recommend looking for PK8's Self Data Suite, which is far more comprehensive. The original source seems to be down as well unfortunately, but there should be people out here who still have it.
  16. That fixed the issue! Placement did end up mattering; I had to place it below Galv's script, otherwise it would crash with a "Superclass mismatch" or something similar.

    I actually only stopped using your script because a friend sent me a copy of the Self Data Suite. The only important thing yours was missing was the ability to have multiple self-variables on one event, so I'm keeping a back-up of yours in case it'll be handy later.

    I was also going to report that the player's shadow is off several pixels, but after some testing, I've figured out that this is due to how my sprite-sheet is set-up, and I can fix it on my end! Thank you so much for your help in this; it's one of the harder bugs I wanted fixed before I launch my game's demo.
  17. Another Fen said:
    Hey there,

    Haven't tested it yet (at all), but you could try using this:
    Spoiler
    Code:
    #=============================================================================
    #
    #  Compatibility Patch for Galv's Character Effects and
    #    Victor Sant's Multiframes and Diagonal Movement
    #  Version 0.1 (28th June, 2018)
    #  By Another Fen <forums.rpgmakerweb.com>
    #
    #  (Consists in large parts of code copied from the aforementioned scripts)
    #
    # Contents: ------------------------------------------------------------------
    #  This Script modifies the Sprite part of Galv's Character Effects to make
    #  them compatible to Victor Sant's Multiframes and Diagonal Movement.
    #
    # Usage: ---------------------------------------------------------------------
    #  Requires Victor Sant's Multiframes (1.03) and Diagonal Movement (1.09)
    #  Should be placed below Galv's Character Effects (2.1).
    # 
    #=============================================================================
    
    #=============================================================================
    #  Sprite_Character
    #=============================================================================
    class Sprite_Character
     
      #---------------------------------------------------------------------------
      # Sprite_Character#update_src_rect  (Modified)
      #   Extracted character index. Includes Multiframes / Diagonal Movement.
      #---------------------------------------------------------------------------
      def update_src_rect
        if @tile_id == 0
          index = character_index
          sx = (index % 4 * horizontal_frames + pattern_index) * @cw
          sy = (index / 4 * vertical_frames + direction_index) * @ch
          self.src_rect.set(sx, sy, @cw, @ch)
        end
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#character_index
      #   Displayed character set index.
      #---------------------------------------------------------------------------
      def character_index
        @character.character_index
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#horizontal_frames
      #   Number of horizontal frames per character set
      #---------------------------------------------------------------------------
      def horizontal_frames
        @character_name[/\[F(\d+)\]/i] ? @character.frames : 3
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#vertical_frames
      #   Number of vertical frames per character set
      #---------------------------------------------------------------------------
      def vertical_frames
        4
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#pattern_index
      #   Displayed character pattern index
      #---------------------------------------------------------------------------
      def pattern_index
        pattern = @character.pattern
        return (pattern < 3 || @character_name[/\[F(\d+)\]/i]) ? pattern : 1
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#direction_index
      #   Displayed character direction index
      #---------------------------------------------------------------------------
      def direction_index
        if @character.diagonal?
          return { 1 => 0, 7 => 1, 3 => 2, 9 => 3 }[@diagonal]
        else
          return (@character.direction - 2) / 2
        end
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Character#extended_bitmap_name
      #   Extended alternate bitmap names for subclasses (see Diagonal Movement)
      #---------------------------------------------------------------------------
      def extended_bitmap_name(name)
        extended_name = name + ($imported[:ve_visual_equip] ? "" : diagonal_sufix)
        return character_exist?(extended_name) ? extended_name : name
      end
    end
    
    
    #=============================================================================
    #  Sprite_Reflect
    #=============================================================================
    class Sprite_Reflect
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#set_character_bitmap  (Modified)
      #   Moved changes to other methods designated by the VE Basic Module.
      #---------------------------------------------------------------------------
      def set_character_bitmap
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#set_bitmap_name  (Overridden)
      #   See Sprite_Reflect#set_character_bitmap
      #---------------------------------------------------------------------------
        def set_bitmap_name
        reflect = @character.reflect_sprite
        return (reflect) ? extended_bitmap_name(reflect[0]) : super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#set_bitmap_position  (Overridden)
      #   See Sprite_Reflect#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_position
        self.mirror = true
        self.angle = 180
        self.opacity = 220
        self.z = Galv_CEffects::REFLECT_Z
        self.wave_amp = $game_map.reflect_options[0]
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Reflect#character_index  (Overridden)
      #   Specify reflection character index
      #---------------------------------------------------------------------------
      def character_index
        @character.reflect_sprite ? @character.reflect_sprite[1] : super
      end
    end
    
    
    #=============================================================================
    #  Sprite_Mirror
    #=============================================================================
    class Sprite_Mirror
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#set_character_bitmap  (Modified)
      #   Move changes to methods designated by the VE basic module
      #---------------------------------------------------------------------------
      def set_character_bitmap
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#set_bitmap_name  (Overridden)
      #   See Sprite_Mirror#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_name
        reflect = @character.reflect_sprite
        return (reflect) ? extended_bitmap_name(reflect[0]) : super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#set_bitmap_position  (Overridden)
      #   See Sprite_Mirror#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_position
        self.mirror = true
        self.opacity = 255
        self.z = Galv_CEffects::REFLECT_Z
        super
      end
    
      #---------------------------------------------------------------------------
      # Sprite_Mirror#character_index  (Overridden)
      #   Specify reflection character index
      #---------------------------------------------------------------------------
      def character_index
        @character.reflect_sprite ? @character.reflect_sprite[1] : super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Mirror#direction_index  (Overridden)
      #   Mirror direction
      #---------------------------------------------------------------------------
      def direction_index
        return vertical_frames - 1 - super
      end
    end
    
    
    #=============================================================================
    #  Sprite_Shadow
    #=============================================================================
    class Sprite_Shadow < Sprite_Character
    
      #---------------------------------------------------------------------------
      # Sprite_Shadow#set_character_bitmap  (Modified)
      #   Move changes to methods designated by the VE basic module
      #---------------------------------------------------------------------------
      def set_character_bitmap
        super
      end
     
      #---------------------------------------------------------------------------
      # Sprite_Shadow#set_bitmap_position  (Overridden)
      #   See Sprite_Mirror#set_character_bitmap
      #---------------------------------------------------------------------------
      def set_bitmap_position
        self.color = Color.new(0, 0, 0, 255)
        self.z = Galv_CEffects::SHADOW_Z
        self.wave_amp = 1 if $game_map.shadow_options[2]
        self.wave_speed = 1000
        super
      end
    end
    Hey there, thanks for sharing this, is there anyway to make this work without diagonal frames plugin? Whenever the y values match it show the wrong frame.