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.

scripts Problem

i have some problems.

1. the charas are not animated
Code:
#==============================================================================
#  ** RPG Advocate's Advanced Shop Status Window
#------------------------------------------------------------------------------
#==============================================================================
    $original_fontsize  = 24      # Default size of the text used by RMXP
    $custom_fontsize    = 16      # Size of the new weapon/armor font size.
    $custom_y_position  = 8       # How many pixels below the Actor's name.
    $stat_fontsize      = 14      # Size of the new statistic font size.
    $stat_y_position    = 8       # How many pixels below the Actor's name.
#--------------------------------------------------------------------------
# * SDK Log
#--------------------------------------------------------------------------
SDK.log('Advanced Shop Status Window', 'RPG Advocate', 2.0, '')

#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Advanced Shop Status Window')
class Window_ShopStatus < Window_Base
  def rel(var1,var2,typ)
    if var1 > var2
      case typ
      when 0 
        return 1          
      when 1 
        return "+"         
      when 2
        return up_color
      end
    end
    if var1 < var2
      case typ
      when 0 
        return -1          
      when 1 
        return "-"         
      when 2
        return down_color
      end
    end
    if var1 = var2
      case typ
      when 0 
        return 0          
      when 1 
        return ""         
      when 2
        return normal_color
      end        
    end
  end
  # ---------------------------------------
  def initialize
    if SDK.enabled?('Realistic Shop')
      super(320, 128, 320, 352)
    else
      super(368, 128, 272, 352)
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @item = nil
    refresh
  end
  # ---------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    if @item == nil
      return
    end
    case @item
    when RPG::Item
      number = $game_party.item_number(@item.id)
      kind_word = $data_system.words.item
    when RPG::Weapon
      number = $game_party.weapon_number(@item.id)
      kind_word = $data_system.words.weapon
    when RPG::Armor
      number = $game_party.armor_number(@item.id)
      @default_names = [$data_system.words.armor1,$data_system.words.armor2,$data_system.words.armor3,$data_system.words.armor4]
      if @item.kind<4
        kind_word = @default_names[@item.kind]
      elsif SDK.enabled?('Multi-slot equipment script') #Add zu Multi-slot equipment script
       @extra_slot_names = G7_MS_MOD::EXTRA_SLOT_NAMES       
        if @item.kind - 4< @extra_slot_names.size
          kind_word  = @extra_slot_names[@item.kind - 4]
        else
          kind_word = '???'
        end
      else
        kind_word = '???'
      end
    end
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 200, 32, "Possessed:")
    self.contents.draw_text(4, 15, 200, 32, "Kind:")
    self.contents.font.color = normal_color
    self.contents.draw_text(self.width - 68, 0, 32, 32, number.to_s, 2)
    self.contents.draw_text(self.width - 72, 15, 32, 32, kind_word, 2)
    $game_party.actors.each_with_index do |actor, i|
      self.contents.font.size = $fontsize
      itemdata = []
      itemname = []
      if SDK.enabled?('Animated Chars')
        draw_actor_graphic(actor, 15, 100 + i * 64,actor.equippable?(@item))
        p actor.equippable?(@item)  if !@item.is_a?(RPG::Item)
        @actor_sprites[actor].visible = !@item.is_a?(RPG::Item)
        next if @item.is_a?(RPG::Item)
        if actor.equippable?(@item)
          @actor_sprites[actor].tone = Tone.new(0, 0, 0, 0)
          self.contents.font.color = normal_color
        else
          @actor_sprites[actor].frame = 0
          @actor_sprites[actor].tone = Tone.new(0, 0, 0, 255)
        end
      else
        if @item.is_a?(RPG::Item)
          next
        end
        draw_actor_name(actor,4, 36 + 72 * i)
      end
      if @item.is_a?(RPG::Weapon)
        if SDK.enabled?('Multi-slot equipment script')
          ids=actor.weapon_slots.size
        else
          ids=1
        end        
        for j in 0...ids
          itemdata.push($data_weapons[actor.weapon_ids[j]])
        end
      else
        k = @item.kind  # determine what type of armor
        if SDK.enabled?('Multi-slot equipment script')
          ids=actor.armor_slots.size
        else
          ids=4
        end  
        for j in 0...ids
          tempdata = $data_armors[actor.armor_ids[j]]
          if tempdata != nil
            if tempdata.kind == k 
              itemdata.push(tempdata)
            end
          end
        end
      end
      if k != nil && SDK.enabled?('Multi-slot equipment script')
        l = k + 1
        armor_set = []
        armor_set = G7_MS_MOD::ARMOR_KINDS.find_all{|v| v == l}
      end
      if actor.equippable?(@item)
        # Clear changes
        change = [0, 0, 0, 0, 0, 0, 0, 0]
        new = [0, 0, 0, 0, 0, 0, 0, 0]
        old = [0, 0, 0, 0, 0, 0, 0, 0]
        if SDK.enabled?('Multi-slot equipment script')
          if @item.is_a?(RPG::Weapon)
            ids=actor.weapon_slots.size
          else
            ids=actor.armor_slots.size
          end
          if @item.is_a?(RPG::Weapon)
            ids=1
          else
            ids=4
          end
        end
        for j in 0...ids         
          if itemdata[j] != nil
            # Add Cumulative Values
            itemname[j] = itemdata[j].name
            if @item.is_a?(RPG::Weapon)
              old[0] += itemdata[j].atk
            else
              old[7] += itemdata[j].eva
            end
            old[1] += itemdata[j].pdef
            old[2] += itemdata[j].mdef
            old[3] += itemdata[j].str_plus
            old[4] += itemdata[j].dex_plus
            old[5] += itemdata[j].agi_plus
            old[6] += itemdata[j].int_plus
          end
        end
        new[3] = @item.str_plus
        new[4] = @item.dex_plus
        new[5] = @item.agi_plus
        new[6] = @item.int_plus
        new[1] = @item.pdef
        new[2] = @item.mdef 
        new[0] = @item.atk if @item.is_a?(RPG::Weapon)
        new[7] = @item.eva if @item.is_a?(RPG::Armor)
        for j in 0...7
          if SDK.enabled?('Multi-slot equipment script')
            new[j] *= actor.weapon_slots.size
          end              
          change[j] = new[j] - old[j]
        end  
        self.contents.font.size = $custom_fontsize
        name = @item.name
        self.contents.font.color = normal_color
        if change - [0] == [] && !itemname.include?(name)
          self.contents.draw_text(102,36+$stat_y_position + 72 * i, 150, $custom_fontsize, "No Change")
        end
        if itemname.include?(name)
          self.contents.draw_text(102,36+$stat_y_position + 72 * i, 150, $custom_fontsize, "Currently Equipped")
        end
        self.contents.font.size = $stat_fontsize
        names = ["ATK", "PDF","MDF", "STR", "DEX", "AGI", "AGI", "EVA"]
        if @item.is_a?(RPG::Weapon) && change[0] != 0
          self.contents.font.color = normal_color      
          self.contents.draw_text(102, 36 +$stat_y_position+72 * i, 32,$stat_fontsize, names[0])
          self.contents.font.color = rel(new[0],old[0],2)
          self.contents.draw_text(132, 36 +$stat_y_position+72 * i, 4,$stat_fontsize, rel(new[0],old[0],1))
          self.contents.draw_text(132, 36 +$stat_y_position+72 * i, 30, $stat_fontsize, change[0].abs.to_s, 2)
        end
        if @item.is_a?(RPG::Armor) && change[7] != 0
          self.contents.font.color = normal_color
          self.contents.draw_text(102, 36 +$stat_y_position+72 * i, 32,$stat_fontsize, names[7])
          self.contents.font.color = rel(new[7],old[7],2)
          self.contents.draw_text(132, 36 +$stat_y_position+72 * i, 4,$stat_fontsize, rel(new[7],old[7],1))
          self.contents.draw_text(132, 36 +$stat_y_position+72 * i, 30, $stat_fontsize, change[7].abs.to_s, 2)
        end
        for j in 1...6
          if change[j] != 0
            self.contents.font.color = normal_color
            x = j > 2 ? 78 : 0 
            y = j > 2 ? j - 3 : j
            self.contents.draw_text(102+x, 36+y*16+$stat_y_position+72 * i, 32, $stat_fontsize, names[j])
            self.contents.font.color = rel(new[j],old[j],2)
            self.contents.draw_text(132+x, 36+y*16+$stat_y_position+72 * i, 4,$stat_fontsize, rel(new[j],old[j],1))
            self.contents.draw_text(132+x, 36+y*16+$stat_y_position+72 * i, 30, $stat_fontsize, change[j].abs.to_s, 2)
          end
        end
      else
        self.contents.font.color = disabled_color
        self.contents.font.size = $custom_fontsize
        self.contents.draw_text(102,36+$stat_y_position + 72 * i, 150, $custom_fontsize, "Cannot Equip")        
      end
    end
  end
  # ---------------------------------------
  def item=(item)
    if @item != item
      @item = item
      refresh
    end
  end
  # ---------------------------------------
end
#==============================================================================
end
#--------------------------------------------------------------------------
# End SDK Enabled Test 
#--------------------------------------------------------------------------
2. this has no animated icons and the icons are shown out of the window.
Code:
#==========================================================================
# ** SG Item Found Window
#==========================================================================
# sandgolem 
# Version 1.6
# 14.05.07
#Modifed @ Hanmac
#==========================================================================

SG_FindWord_Default = 'Found:'
SG_NoFind_Default = 'nothing'
SG_Get_Item_Default = true
SG_gold_icon = '032-Item01'
SG_FindWin_CenterY = 120
SG_FindWin_Opacity = 160
SG_Max_items = 0#3

# Instruct: http://www.gamebaker.com/rmxp/scripts/item-found-window.htm
=begin
#==========================================================================

Versionslog
v1.6
Heldstatus hinzugef?gt

v1.5
variable hinzugef?gt
Titel kann ausgeblendet werden

v1.4
Gold hinzugef?gt

v1.3
"nichts" hinzuf?gt

v1.2
Zusatzfunktionen

v1.1
Anzahl und Item hinzuf?gen.

v1.0
Oginal von sandgolem

#========================
To-Do-List:
anzeige Status-erh?hung

#==========================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it.
#
# Have problems? Official topic:
#   http://forums.gamebaker.com/showthread.php?t=141
#
#==========================================================================
=end
begin
  SDK.log('SG Item Found Window', 'sandgolem', 1.6, '07.05.07')
  if SDK.state('SG Item Found Window') != true
    @sg_itemfound_disabled = true
  end
  rescue
end

if !@sg_itemfound_disabled
#--------------------------------------------------------------------------

class Game_System
  attr_accessor :sg_found_word
  attr_accessor :sg_get_item
  attr_accessor :sg_no_find
end
#--------------------------------------------------------------------------
class Scene_Map
  attr_accessor :sg_find_window
  attr_accessor :sg_find_window_titel
  alias sg_findwindow_scenemap_update update
  def update
    if @sg_find_window != nil
      sg_findwindow_update
    else
      sg_findwindow_scenemap_update
    end
  end
  
  def sg_findwindow_update
    $game_map.update
    $game_system.update
    $game_screen.update
    @spriteset.update
    @message_window.update
    @sg_find_window.wait -= 1
    if @sg_find_window.wait == 1 or Input.trigger?(Input::C) or Input.trigger?(Input::B)
      #$game_player.disable_player_movement = false
      #$game_player.disable_player_trigger  = false    
      @sg_find_window.dispose
      @sg_find_window = nil
      @sg_find_window_titel.dispose
      @sg_find_window_titel = nil
      for i in 0..2
        $sg_found[i] = []
        $sg_found_number[i] = []
        $sg_found_name[i] = []
      end
      $sg_found_gold = nil
      if @window_sprites != nil
        @window_sprites.each { |sprite| sprite.dispose if sprite.is_a?(Sprite_AnimatedIcon) }
      end
    end
  end
end
#--------------------------------------------------------------------------
class Interpreter
  def sg_find_window(wait = 100)
    if $scene.is_a?(Scene_Map)
      size = 0
      for i in 0..2
        if $sg_found[i] == nil
          $sg_found[i] = []
        end
        size += $sg_found[i].size
      end 
      if $sg_found_gold != nil or  size == 0 
        size += 1
      end
      if  SG_Max_items != nil && SG_Max_items != 0
        max_items =  SG_Max_items
      else
        max_items = 1
      end
      if  max_items >= size
        max_items = size
      end
      #$game_player.disable_player_movement = true
      #$game_player.disable_player_trigger  = true
      $scene.sg_find_window = Window_SGFound.new(max_items,size)
      $scene.sg_find_window_titel = Window_SGFound_Titel.new(max_items)
      $scene.sg_find_window.wait = wait
    end
  end
  #--------------------------------------------
  #Standard ?nderung
  #--------------------------------------------
  def sg_find_word(word = SG_FindWord_Default)
    $game_system.sg_found_word = word
  end
  #----------------------  
  def sg_get_item(bool = SG_Get_Item_Default)
    $game_system.sg_get_item = bool
  end
  #----------------------  
  def sg_no_find(word = SG_NoFind_Default)
    $game_system.sg_no_find = word
  end
  #----------------------  
   def get_item(item_typ,item,n=1)
     case item_typ
     when 0
      $game_party.gain_item(item, n)
     when 1
      $game_party.gain_weapon(item, n)
     when 2
      $game_party.gain_armor(item, n)
    end
  end
  #----------------------
  def sg_get_hero(id,n=1,held_id=nil)
     if held_id==nil
       for i in 0..$game_party.actors.size-1
        case id
        when 0
          $game_party.actors[i].maxhp += n
        when 1
          $game_party.actors[i].maxsp += n
        when 2
          $game_party.actors[i].exp += n
        when 3
          $game_party.actors[i].str += n
        when 4
          $game_party.actors[i].dex += n
        when 5
          $game_party.actors[i].agi += n
        when 6
          $game_party.actors[i].int += n
        end
      end
      else
        case id
        when 0
          $game_party.actors[held_id].maxhp += n
        when 1
          $game_party.actors[held_id].maxsp += n
        when 2
          $game_party.actors[held_id].exp += n
        when 3
          $game_party.actors[held_id].str += n
        when 4
          $game_party.actors[held_id].dex += n
        when 5
          $game_party.actors[held_id].agi += n
        when 6
          $game_party.actors[held_id].int += n
        end
      end
    end
#--------------------------------------------
# Var-Find
#--------------------------------------------
  def sg_find_var(id,n=1,name=nil)
    if $sg_found == nil
      $sg_found = []
      $sg_found_name = []
      $sg_found_number = []
    end
    if $sg_found[2]== nil
      $sg_found[2] = []
      $sg_found_nummer[2] = []
      $sg_found_name[2] = []
    end
    $sg_found[2] += [id]
    $sg_found_nummer[2] += [n]
    if name != nil
      $sg_found_name[2] += [name]
    else
      $sg_found_name[2] += [$data_system.variables[id]]
    end    
    if $game_system.sg_get_item != nil
      if $game_system.sg_get_item
        $game_variables[id] += n
      end
    else
      if SG_Get_Item_Default
        $game_variables[id] += n
      end
    end
  end
#--------------------------------------------
# Gold-Find
#--------------------------------------------
  def sg_find_gold(gold)
    if $sg_found_gold == nil
      $sg_found_gold = 0
    end
    $sg_found_gold+=gold
    if $game_system.sg_get_item != nil
      if $game_system.sg_get_item
        $game_party.gain_gold(gold)
      end
    else
      if SG_Get_Item_Default
        $game_party.gain_gold(gold)
      end
    end
  end
#--------------------------------------------
# Held-Find
#--------------------------------------------
  def sg_find_hero(id,var=1,held_id=nil,name=nil)
    if $sg_found == nil
      $sg_found = []
      $sg_found_name = []
      $sg_found_number = []
    end
    if $sg_found[2] == nil
      $sg_found[2] = []
      $sg_found_nummer[2] = []
      $sg_found_name[2] = []
    end
    $sg_found_nummer[2] += [var]
    $sg_found[2] += [held_id]
    if name != nil
      $sg_found_name[2] += [name]
    else
      case id
      when 0
        $sg_found_name[2] += [$data_system.words.hp]
      when 1
        $sg_found_name[2] += [$data_system.words.sp]
      when 2
        $sg_found_name[2] += ["EXP"]
      when 3
        $sg_found_name[2] += [$data_system.words.str]
      when 4
        $sg_found_name[2] += [$data_system.words.dex]
      when 5
        $sg_found_name[2] += [$data_system.words.agi]
      when 6
        $sg_found_name[2] += [$data_system.words.int]
      end
    end
    if $game_system.sg_get_item != nil
      if $game_system.sg_get_item
        sg_get_hero(id,var,held_id)
      end
    else
      if SG_Get_Item_Default
        sg_get_hero(id,var,held_id)
      end
    end
  end
  #---------------------------------
  def sg_find(item_typ,item,n=1,name = nil)
    if $sg_found == nil
      $sg_found = []
      $sg_found_name = []
      $sg_found_number = []
    end      
    if $sg_found[0] == nil
      $sg_found[0] = []
      $sg_found_name[0] = []
      $sg_found_number[0] = []
    end    
     case item_typ
     when 0
      $sg_found[0] += [$data_items[item]]
      if name == nil
        $sg_found_name[0] += [$data_items[item].name]
      end
    when 1
      $sg_found[0] += [$data_weapons[item]]
      if name == nil
        $sg_found_name[0] += [$data_weapons[item].name]
      end
    when 2
      $sg_found[0] += [$data_armors[item]]
      if name == nil
        $sg_found_name[0] += [$data_armors[item].name]
      end
    end    
    if name != nil
      $sg_found_name[0] += [name]
    end
    $sg_found_number[0] += [n]
    if $game_system.sg_get_item != nil 
      if $game_system.sg_get_item
      get_item(item_typ,item,n)
    end
  else
    get_item(item_typ,item,n)
  end
end
#--------------------------------------------
# Spezifische Find
#--------------------------------------------
  def sg_find_item(item,n=1,name = nil)
    sg_find(0,item,n,name)
  end
#-------------------
  def sg_find_weapon(item,n=1,name = nil)
    sg_find(1,item,n,name)
  end
#-------------------
  def sg_find_armor(item,n=1,name = nil)
    sg_find(2,item,n,name)
  end
#-------------------
end
#--------------------------------------------
# Find Window
#--------------------------------------------
#-----------------
# Title window
#-----------------  
class Window_SGFound_Titel < Window_Base
  def initialize(max_items)
    super(180, SG_FindWin_CenterY - max_items*16, 280, max_items*32+64)
    self.contents = Bitmap.new(width - 32, 32)
    self.opacity = SG_FindWin_Opacity
    refresh
  end
#-----------------
  def refresh
    if $game_system.sg_found_word != nil
      if $game_system.sg_found_word != ''
        self.contents.draw_text(0,0,self.width,32,$game_system.sg_found_word)
      end
    else
      self.contents.draw_text(0,0,self.width,32,SG_FindWord_Default)
    end
  end
end
#-----------------
class Window_SGFound < Window_Base
  attr_accessor :wait
#-----------------
  def initialize(max_items,size)
    @size=size
    super(180, SG_FindWin_CenterY - max_items*16+32, 280, max_items*32+32)
    @size = 1 if @size == 0
    self.contents = Bitmap.new(width - 32, @size*32)
    self.opacity = 0
    refresh
  end
#-----------------
  def refresh
     if SDK.enabled?('Animated Icons')
      @window_sprites.each { |sprite| sprite.dispose if sprite.is_a?(Sprite_AnimatedIcon) }
    end
    y = 0
#-----------------
# no window
#-----------------
    if $sg_found_gold == nil and @size == 0
      if $game_system.sg_no_find != nil
        self.contents.draw_text(0,y,self.width,32,$game_system.sg_no_find) 
      else
        self.contents.draw_text(0,y,self.width,32,SG_NoFind_Default)
      end
    end
#-----------------
# Gold window
#-----------------
    if $sg_found_gold != nil
      if SDK.enabled?('Animated Icons')
        sprite = Sprite_AnimatedIcon.new(0,y+4, SG_gold_icon, self)
        @window_sprites << sprite
      else
        bitmap = RPG::Cache.icon(SG_gold_icon)
        self.contents.blt(0,y+4,bitmap,Rect.new(0,0,24,24))
      end
      self.contents.draw_text(28,y,self.width,32,$data_system.words.gold)
      self.contents.draw_text(28,y,self.width,32,$sg_found_gold,2)
      y += 32
    end
#-----------------
# window
#-----------------
    for j in 0...$sg_found.size
      for i in 0...$sg_found[j].size
        case j
        when 2
           if $sg_found[2][i] != nil
             self.contents.draw_text(28,y,self.width,32,"#{$sg_found_name[j][i]}(#{$game_party.actors[$sg_found[j][i]].name})")        
           else
             self.contents.draw_text(28,y,self.width,32,"#{$sg_found_name[j][i]}(Alle)") 
           end
        when 0
          if SDK.enabled?('Animated Icons')
            sprite = Sprite_AnimatedIcon.new(0,y+4, $sg_found[0][i].icon_name, self)
            @window_sprites << sprite
          else
            bitmap = RPG::Cache.icon($sg_found[0][i].icon_name)
            self.contents.blt(0,y+4,bitmap,Rect.new(0,0,24,24))
          end
        end
        self.contents.draw_text(28,y,self.width,32,$sg_found_name[j][i]) if j <2
        self.contents.draw_text(28,y,self.width-64,32,$sg_found_number[j][i].to_s,2)
        y += 32    
      end
    end   
  end
#-------------------
#taste
#-------------------
  def update
    if Input.press?(Input::UP)
      self.oy -= 4 if self.oy > 0
    elsif Input.press?(Input::DOWN)
      self.oy += 4 if self.oy < self.contents.height - (self.height - 32)
    end
  end
end
#--------------------------------------------------------------------------
end
3. can someone make this in a Sprites Class?
Code:
#--------------------------------------------------------------
#Faceset-Skipt
# version 1.2
#--------------------------------------------------------------
=begin







=end

Actor_face = {1=>['Aluxes_Fc'], 
2=>['Aluxes_Fc'], 
4=>['Aluxes_Fc'], 
5=>['Name', 4], 
6=>['Name', 5], 
7=>['Name', 6], 
8=>['Name', 7]}

class Window_Base
  def draw_actor_face(x,y,width=nil,hight=nil,id=nil)
    if x.is_a?(Rect)
      @x=x.x
      @y=x.y
      @face_size = [x.width,x.hight]
      @id=y
    else
      @x=x
      @y=y
      @face_size = [width,hight]
      @id=id
    end
    if Actor_face[@id][2] == nil
      n=Actor_face[@id][1]
    else
      n=[Actor_face[@id][1],Actor_face[@id][2]]
    end
    $face[@id] = Face.new(@x,@y,@face_size,Actor_face[@id][0],wait=nil,n)
    $face[@id].set_opacity(0)
  end
 #-------------------------------
 def clear_face
  for i in 0...$face.size
      if $face[i] != nil
        $face[i].dispose
        $face[i] = nil
      end
    end
 end
end
#-------------------------------
#-------------------------------
class Face < Window_Base
  attr_accessor :wait
  def initialize(x,y,width,hight,name,wait=nil,i=nil,align=nil)
    vars=[x,y,width,hight,name,wait,i,align]
    
    @face_opacity = 225
    @group_face=[48,48]
    @n=[4,4]
    @face_size = [96,96]
    j=0
    if x.is_a?(Rect)
      @x=x.x
      @y=x.y
      @face_size = [x.width,x.hight]
      j+=1
    else
      @x=x
      @y=vars[j+1]
      j+=2
      if width.is_a?(Integer)
        @face_size = [width,hight]
        j+=2
      elsif width.is_a?(Array)
        @face_size = width
        j+=1
      end
    end
    @name = vars[j]
    @wait=vars[j+1]
    @i=vars[j+2]
    @align=vars[j+3]
    if !@i.is_a?(Array)
      if @i != nil
        @i=[@i%@n[0]+1, @i/@n[1]+1]
      else
        @i=[0,0]
      end
    end
    @align=0 if @align==nil
    if @wait == false or @wait == nil or @wait == 0
      @wait = false
    else
      @wait = @wait * 40
    end
    super(x, y, @face_size[0] +32,@face_size[1] +32)
    refresh
  end
#----------------------------------
  def refresh
    if @rand == nil
      @rand = 0
    end
    self.contents = Bitmap.new(@face_size[0]+2 * @rand, @face_size[1]+2 * @rand)
    self.contents.clear
    self.width = @face_size[0] + 32 + 2 * @rand
    self.height = @face_size[1] + 32 + 2 * @rand
    #---------------
    if @Rahmen != nil
      self.x = @x -@rand
      self.y = @y -@rand
      self.opacity =  0
      bitmap_rahmen=RPG::Cache.picture(@Rahmen)
      self.contents.stretch_blt(Rect.new(0,0,@face_size[0]+2 * @rand,@face_size[1]+2 * @rand),bitmap_rahmen,Rect.new(0,0,bitmap_rahmen.width,bitmap_rahmen.height),@face_opacity)  
    else
      self.opacity = @face_opacity
    end
    #-------------
    bitmap=RPG::Cache.picture(@name)
    if @i != [0,0]#also Gruppen
      self.contents.stretch_blt(Rect.new(@rand,@rand,@face_size[0],@face_size[1]),bitmap,Rect.new(@group_face[0]*(@i[0] - 1),@group_face[1]*(@i[1] - 1),@group_face[0],@group_face[1]))
    else
      self.contents.stretch_blt(Rect.new(@rand,@rand,@face_size[0],@face_size[1]),bitmap,Rect.new(0,0,bitmap.width,bitmap.height))
    end
  end
 #----------------------------------  
  def set_group_face(width,height,nx,ny)
    if width.is_a?(Array)
      @group_face = width
      if height.is_a?(Array)
        @n=height
      else
        @n=[height,nx]
      end
    else
      @group_face = [width,height]
      if nx.is_a?(Array)
        @n=nx
      else
        @n=[nx,ny]
      end
    end
    refresh
  end
#----------------------------------  
  def set_opacity(opacity)
    @face_opacity = opacity
    refresh
  end
#----------------------------------  
  def set_rand(rahmen,rand)
    @Rahmen=rahmen
    @rand=rand
    refresh
  end
#----------------------------------  
  def update
    self.wait=@wait
    return if @wait == false
    if @wait != 0
     @wait -= 1
    end
  end
#----------------------------------  
end

class Scene_Map  
  alias facewindow_scenemap_update update
  def update
    facewindow_scenemap_update
    $face=[] if $face == nil 
    for i in 0...$face.size
      if $face[i] != nil
        if $face[i].wait == 0
          $face[i].dispose
          $face[i] = nil
        else
          $face[i].update
        end
      end
    end
  end
end

I hope for a comment.
 

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