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.

problem with endings _xxx

ZuNNeR

Member

Hello. I have two scripts that need to modify the spriteset's ends: Blizz abs and a script for a custom number of frames (enter at the end number of spriteset's frames). And here my problem: How do I do to these two scripts work together? Because the ending is rather only one, so it will run 1 or 2 but not together. when I wrote something after the blizz's sprite ending it doesn't work ,because blizz abs don't finding his end of sprite. When I wrote first ending of the frame script, and the second ending of blizz abs, abs don't working too, because name of sprite isn't the same.I hope you understood;). whether can something to do with this?
I'm sorry for my English. I'm not too good.

@DOWN
Ok, here's the script for custom frames:

Sprite_Character
Code:
 

class Sprite_Character < RPG::Sprite

  attr_accessor :character

  def initialize(viewport, character = nil)

    super(viewport)

    @character = character

    @filename = @character.character_name.to_s

    @x_frame = @y_frame = 4

    @x_frame = @filename.split(/@/)[1].to_i if @filename.split(/@/)[1].to_i != 0

    @y_frame = @filename.split(/@/)[2].to_i if @filename.split(/@/)[2].to_i != 0

    update

  end

  def update

    super

    if @tile_id != @character.tile_id or @character_name != @character.character_name or @character_hue != @character.character_hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      self.bitmap = RPG::Cache.character(@character.character_name,0) rescue self.bitmap = RPG::Cache.character("",0)

      @cw = bitmap.width / @x_frame

      @ch = bitmap.height / @y_frame

      self.ox = @cw / 2

      self.oy = @ch

    end

    self.visible = (not @character.transparent)

    if @tile_id == 0

      sx = @character.pattern * @cw

       case @character.direction

       when 2

         sy = 0 * @ch

       when 4

         sy = 1 * @ch

       when 6

         sy = 2 * @ch

       when 8

         sy = 3 * @ch

       when 1

         if @y_frame == 8

           sy = 4 * @ch

         else

           sy = 1 * @ch

         end

       when 3

         if @y_frame == 8

           sy = 5 * @ch

         else

           sy = 0 * @ch

         end

       when 7

         if @y_frame == 8

           sy = 6 * @ch

         else

           sy = 3 * @ch

         end

       when 9

         if @y_frame == 8

           sy = 7 * @ch

         else

           sy = 2 * @ch

         end

       when 5

         if @y_frame == 8

           sy = 0 * @ch

         else

           sy = 0 * @ch

         end

       end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    self.x = @character.screen_x

    self.y = @character.screen_y

    self.z = @character.screen_z(@ch)

    self.opacity = @character.opacity

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

  end

end

 

 
Game_Character
Code:
 

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

# ** Game_Character

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

class Game_Character

  def update

    if moving?

      update_move

    else

      update_stop

    end

    # If animation count exceeds maximum value

    # * Maximum value is move speed * 1 taken from basic value 18

    if @anime_count > 18 - @move_speed * 2

      # If stop animation is OFF when stopping

      if not @step_anime and @stop_count > 0

        # Return to original pattern

        @pattern = @original_pattern

      # If stop animation is ON when moving

      else

        stand = 1

        x_frame = 4

        x_frame = @character_name.split(/@/)[1].to_i if @character_name.split(/@/)[1].to_i != 0

        stand = @character_name.split(/@/)[3].to_i if @character_name.split(/@/)[3].to_i != 0

        if stand != 0

          @pattern = @pattern % (x_frame - 1) + 1

        else

          @pattern = (@pattern +1) % x_frame

        end

      end

      # Clear animation count

      @anime_count = 0

    end

    # If waiting

    if @wait_count > 0

      # Reduce wait count

      @wait_count -= 1

      return

    end

    # If move route is forced

    if @move_route_forcing

      # Custom move

      move_type_custom

      return

    end

    # When waiting for event execution or locked

    if @starting or lock?

      # Not moving by self

      return

    end

    # If stop count exceeds a certain value (computed from move frequency)

    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)

      # Branch by move type

      case @move_type

      when 1  # Random

        move_type_random

      when 2  # Approach

        move_type_toward_player

      when 3  # Custom

        move_type_custom

      end

    end

  end

end

 

This is sample charset:
http://www.speedyshare.com/files/222023 ... _8_8_0.png


here is blizz abs:
http://forum.chaos-project.com/index.ph ... n.html#new
 

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