Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Nowe tagi wiadomości
Autor Wiadomość
PaKiTos 




Preferowany:
RPG Maker 2003

Ranga RM:
2 gry

Pomógł: 16 razy
Dołączył: 05 Lis 2009
Posty: 359
Skąd: spytaj innych
Wysłany: Sob 01 Maj, 2010 13:38
Nowe tagi wiadomości
Skrypcik ulepsza wiadomości. Można napisać \HP[1] i widać, ile postać ma HP.

Reszta w skrypcie.
Spoiler:

Kod:
#==============================================================================
# ■ Nowe tagi wiadomości
#ェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェ
#autor: PaKiTos
#ェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェェ
#POMOC:
#\lv[N] - pokazuje poziom postaci
#\hp[N] - pokazuje ilość hp
#\mxhp[N] - pokazuje maksymalne hp
#\sp[N] - pokazuje ilość sp
#\mxsp[N] - pokazuje maksymalne sp
#\zapis[s] - pokazuje ile slotów jest zapisanych
#\IloscSkilli[N] - pokazuje ile bohater ma umiejętności
#------------------------------------------------------------------------------
# ( N jako numer gracza, S musi być )
#==============================================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # &#9679; &#23450;&#25968;
  #--------------------------------------------------------------------------
  MAX_LINE = 4                            # &#26368;&#22823;&#34892;&#25968;
  #--------------------------------------------------------------------------
  # &#9679; &#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#21021;&#26399;&#21270;
  #--------------------------------------------------------------------------
  def initialize
    super(0, 288, 544, 128)
    self.z = 200
    self.active = false
    self.index = -1
    self.openness = 0
    @opening = false            # &#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#12458;&#12540;&#12503;&#12531;&#20013;&#12501;&#12521;&#12464;
    @closing = false            # &#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#12463;&#12525;&#12540;&#12474;&#20013;&#12501;&#12521;&#12464;
    @text = nil                 # &#34920;&#31034;&#12377;&#12409;&#12365;&#27531;&#12426;&#12398;&#25991;&#31456;
    @contents_x = 0             # &#27425;&#12398;&#25991;&#23383;&#12434;&#25551;&#30011;&#12377;&#12427; X &#24231;&#27161;
    @contents_y = 0             # &#27425;&#12398;&#25991;&#23383;&#12434;&#25551;&#30011;&#12377;&#12427; Y &#24231;&#27161;
    @line_count = 0             # &#29694;&#22312;&#12414;&#12391;&#12395;&#25551;&#30011;&#12375;&#12383;&#34892;&#25968;
    @wait_count = 0             # &#12454;&#12455;&#12452;&#12488;&#12459;&#12454;&#12531;&#12488;
    @background = 0             # &#32972;&#26223;&#12479;&#12452;&#12503;
    @position = 2               # &#34920;&#31034;&#20301;&#32622;
    @show_fast = false          # &#26089;&#36865;&#12426;&#12501;&#12521;&#12464;
    @line_show_fast = false     # &#34892;&#21336;&#20301;&#26089;&#36865;&#12426;&#12501;&#12521;&#12464;
    @pause_skip = false         # &#20837;&#21147;&#24453;&#12385;&#30465;&#30053;&#12501;&#12521;&#12464;
    create_gold_window
    create_number_input_window
    create_back_sprite
  end
  #--------------------------------------------------------------------------
  # &#9679; &#35299;&#25918;
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_gold_window
    dispose_number_input_window
    dispose_back_sprite
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12501;&#12524;&#12540;&#12512;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update
    super
    update_gold_window
    update_number_input_window
    update_back_sprite
    update_show_fast
    unless @opening or @closing             # &#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#38283;&#38281;&#20013;&#20197;&#22806;
      if @wait_count > 0                    # &#25991;&#31456;&#20869;&#12454;&#12455;&#12452;&#12488;&#20013;
        @wait_count -= 1
      elsif self.pause                      # &#25991;&#31456;&#36865;&#12426;&#24453;&#27231;&#20013;
        input_pause
      elsif self.active                     # &#36984;&#25246;&#32930;&#20837;&#21147;&#20013;
        input_choice
      elsif @number_input_window.visible    # &#25968;&#20516;&#20837;&#21147;&#20013;
        input_number
      elsif @text != nil                    # &#27531;&#12426;&#12398;&#25991;&#31456;&#12364;&#23384;&#22312;
        update_message                        # &#12513;&#12483;&#12475;&#12540;&#12472;&#12398;&#26356;&#26032;
      elsif continue?                       # &#32154;&#12369;&#12427;&#22580;&#21512;
        start_message                         # &#12513;&#12483;&#12475;&#12540;&#12472;&#12398;&#38283;&#22987;
        open                                  # &#12454;&#12451;&#12531;&#12489;&#12454;&#12434;&#38283;&#12367;
        $game_message.visible = true
      else                                  # &#32154;&#12369;&#12394;&#12356;&#22580;&#21512;
        close                                 # &#12454;&#12451;&#12531;&#12489;&#12454;&#12434;&#38281;&#12376;&#12427;
        $game_message.visible = @closing
      end
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25152;&#25345;&#37329;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#20316;&#25104;
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new(384, 0)
    @gold_window.openness = 0
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25968;&#20516;&#20837;&#21147;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#20316;&#25104;
  #--------------------------------------------------------------------------
  def create_number_input_window
    @number_input_window = Window_NumberInput.new
    @number_input_window.visible = false
  end
  #--------------------------------------------------------------------------
  # &#9679; &#32972;&#26223;&#12473;&#12503;&#12521;&#12452;&#12488;&#12398;&#20316;&#25104;
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = Cache.system("MessageBack")
    @back_sprite.visible = (@background == 1)
    @back_sprite.z = 190
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25152;&#25345;&#37329;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#35299;&#25918;
  #--------------------------------------------------------------------------
  def dispose_gold_window
    @gold_window.dispose
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25968;&#20516;&#20837;&#21147;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#35299;&#25918;
  #--------------------------------------------------------------------------
  def dispose_number_input_window
    @number_input_window.dispose
  end
  #--------------------------------------------------------------------------
  # &#9679; &#32972;&#26223;&#12473;&#12503;&#12521;&#12452;&#12488;&#12398;&#35299;&#25918;
  #--------------------------------------------------------------------------
  def dispose_back_sprite
    @back_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25152;&#25345;&#37329;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update_gold_window
    @gold_window.update
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25968;&#20516;&#20837;&#21147;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update_number_input_window
    @number_input_window.update
  end
  #--------------------------------------------------------------------------
  # &#9679; &#32972;&#26223;&#12473;&#12503;&#12521;&#12452;&#12488;&#12398;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update_back_sprite
    @back_sprite.visible = (@background == 1)
    @back_sprite.y = y - 16
    @back_sprite.opacity = openness
    @back_sprite.update
  end
  #--------------------------------------------------------------------------
  # &#9679; &#26089;&#36865;&#12426;&#12501;&#12521;&#12464;&#12398;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update_show_fast
    if self.pause or self.openness < 255
      @show_fast = false
    elsif Input.trigger?(Input::C) and @wait_count < 2
      @show_fast = true
    elsif not Input.press?(Input::C)
      @show_fast = false
    end
    if @show_fast and @wait_count > 0
      @wait_count -= 1
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#27425;&#12398;&#12513;&#12483;&#12475;&#12540;&#12472;&#12434;&#32154;&#12369;&#12390;&#34920;&#31034;&#12377;&#12427;&#12409;&#12365;&#12363;&#21028;&#23450;
  #--------------------------------------------------------------------------
  def continue?
    return true if $game_message.num_input_variable_id > 0
    return false if $game_message.texts.empty?
    if self.openness > 0 and not $game_temp.in_battle
      return false if @background != $game_message.background
      return false if @position != $game_message.position
    end
    return true
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12513;&#12483;&#12475;&#12540;&#12472;&#12398;&#38283;&#22987;
  #--------------------------------------------------------------------------
  def start_message
    @text = ""
    for i in 0...$game_message.texts.size
      @text += "&#12288;&#12288;" if i >= $game_message.choice_start
      @text += $game_message.texts[i].clone + "\x00"
    end
    @item_max = $game_message.choice_max
    convert_special_characters
    reset_window
    new_page
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25913;&#12506;&#12540;&#12472;&#20966;&#29702;
  #--------------------------------------------------------------------------
  def new_page
    contents.clear
    if $game_message.face_name.empty?
      @contents_x = 0
    else
      name = $game_message.face_name
      index = $game_message.face_index
      draw_face(name, index, 0, 0)
      @contents_x = 112
    end
    @contents_y = 0
    @line_count = 0
    @show_fast = false
    @line_show_fast = false
    @pause_skip = false
    contents.font.color = text_color(0)
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25913;&#34892;&#20966;&#29702;
  #--------------------------------------------------------------------------
  def new_line
    if $game_message.face_name.empty?
      @contents_x = 0
    else
      @contents_x = 112
    end
    @contents_y += WLH
    @line_count += 1
    @line_show_fast = false
  end
  #--------------------------------------------------------------------------
  # &#9679; &#29305;&#27530;&#25991;&#23383;&#12398;&#22793;&#25563;
  #--------------------------------------------------------------------------
  def convert_special_characters
    @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
    @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
    @text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
    @text.gsub!(/\\LV\[([0-9]+)\]/i) { $game_actors[$1.to_i].level }
    @text.gsub!(/\\HP\[([0-9]+)\]/i) { $game_actors[$1.to_i].hp }
        @text.gsub!(/\\MXHP\[([0-9]+)\]/i) { $game_actors[$1.to_i].maxhp }
            @text.gsub!(/\\SP\[([0-9]+)\]/i) { $game_actors[$1.to_i].sp }
        @text.gsub!(/\\MXSP\[([0-9]+)\]/i) { $game_actors[$1.to_i].maxsp }
                @text.gsub!(/\\IloscSkilli\[([0-9]+)\]/i) { $game_actors[$1.to_i].skills.size }
    @text.gsub!(/\\zapis\[([s]+)\]/i) { $game_system.save_count }
    @text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
    @text.gsub!(/\\G/)              { "\x02" }
    @text.gsub!(/\\\./)             { "\x03" }
    @text.gsub!(/\\\|/)             { "\x04" }
    @text.gsub!(/\\!/)              { "\x05" }
    @text.gsub!(/\\>/)              { "\x06" }
    @text.gsub!(/\\</)              { "\x07" }
    @text.gsub!(/\\\^/)             { "\x08" }
    @text.gsub!(/\\\\/)             { "\\" }
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#32972;&#26223;&#12392;&#20301;&#32622;&#12398;&#35373;&#23450;
  #--------------------------------------------------------------------------
  def reset_window
    @background = $game_message.background
    @position = $game_message.position
    if @background == 0   # &#36890;&#24120;&#12454;&#12451;&#12531;&#12489;&#12454;
      self.opacity = 255
    else                  # &#32972;&#26223;&#12434;&#26263;&#12367;&#12377;&#12427;&#12289;&#36879;&#26126;&#12395;&#12377;&#12427;
      self.opacity = 0
    end
    case @position
    when 0  # &#19978;
      self.y = 0
      @gold_window.y = 360
    when 1  # &#20013;
      self.y = 144
      @gold_window.y = 0
    when 2  # &#19979;
      self.y = 288
      @gold_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12513;&#12483;&#12475;&#12540;&#12472;&#12398;&#32066;&#20102;
  #--------------------------------------------------------------------------
  def terminate_message
    self.active = false
    self.pause = false
    self.index = -1
    @gold_window.close
    @number_input_window.active = false
    @number_input_window.visible = false
    $game_message.main_proc.call if $game_message.main_proc != nil
    $game_message.clear
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12513;&#12483;&#12475;&#12540;&#12472;&#12398;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update_message
    loop do
      c = @text.slice!(/./m)            # &#27425;&#12398;&#25991;&#23383;&#12434;&#21462;&#24471;
      case c
      when nil                          # &#25551;&#30011;&#12377;&#12409;&#12365;&#25991;&#23383;&#12364;&#12394;&#12356;
        finish_message                  # &#26356;&#26032;&#32066;&#20102;
        break
      when "\x00"                       # &#25913;&#34892;
        new_line
        if @line_count >= MAX_LINE      # &#34892;&#25968;&#12364;&#26368;&#22823;&#12398;&#12392;&#12365;
          unless @text.empty?           # &#12373;&#12425;&#12395;&#32154;&#12365;&#12364;&#12354;&#12427;&#12394;&#12425;
            self.pause = true           # &#20837;&#21147;&#24453;&#12385;&#12434;&#20837;&#12428;&#12427;
            break
          end
        end
      when "\x01"                       # \C[n]  (&#25991;&#23383;&#33394;&#22793;&#26356;)
        @text.sub!(/\[([0-9]+)\]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "\x02"                       # \G  (&#25152;&#25345;&#37329;&#34920;&#31034;)
        @gold_window.refresh
        @gold_window.open
      when "\x03"                       # \.  (&#12454;&#12455;&#12452;&#12488; 1/4 &#31186;)
        @wait_count = 15
        break
      when "\x04"                       # \|  (&#12454;&#12455;&#12452;&#12488; 1 &#31186;)
        @wait_count = 60
        break
      when "\x05"                       # \!  (&#20837;&#21147;&#24453;&#12385;)
        self.pause = true
        break
      when "\x06"                       # \>  (&#30636;&#38291;&#34920;&#31034; ON)
        @line_show_fast = true
      when "\x07"                       # \<  (&#30636;&#38291;&#34920;&#31034; OFF)
        @line_show_fast = false
      when "\x08"                       # \^  (&#20837;&#21147;&#24453;&#12385;&#12394;&#12375;)
        @pause_skip = true
      else                              # &#26222;&#36890;&#12398;&#25991;&#23383;
        contents.draw_text(@contents_x, @contents_y, 40, WLH, c)
        c_width = contents.text_size(c).width
        @contents_x += c_width
      end
      break unless @show_fast or @line_show_fast
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12513;&#12483;&#12475;&#12540;&#12472;&#12398;&#26356;&#26032;&#32066;&#20102;
  #--------------------------------------------------------------------------
  def finish_message
    if $game_message.choice_max > 0
      start_choice
    elsif $game_message.num_input_variable_id > 0
      start_number_input
    elsif @pause_skip
      terminate_message
    else
      self.pause = true
    end
    @wait_count = 10
    @text = nil
  end
  #--------------------------------------------------------------------------
  # &#9679; &#36984;&#25246;&#32930;&#12398;&#38283;&#22987;
  #--------------------------------------------------------------------------
  def start_choice
    self.active = true
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25968;&#20516;&#20837;&#21147;&#12398;&#38283;&#22987;
  #--------------------------------------------------------------------------
  def start_number_input
    digits_max = $game_message.num_input_digits_max
    number = $game_variables[$game_message.num_input_variable_id]
    @number_input_window.digits_max = digits_max
    @number_input_window.number = number
    if $game_message.face_name.empty?
      @number_input_window.x = x
    else
      @number_input_window.x = x + 112
    end
    @number_input_window.y = y + @contents_y
    @number_input_window.active = true
    @number_input_window.visible = true
    @number_input_window.update
  end
  #--------------------------------------------------------------------------
  # &#9679; &#12459;&#12540;&#12477;&#12523;&#12398;&#26356;&#26032;
  #--------------------------------------------------------------------------
  def update_cursor
    if @index >= 0
      x = $game_message.face_name.empty? ? 0 : 112
      y = ($game_message.choice_start + @index) * WLH
      self.cursor_rect.set(x, y, contents.width - x, WLH)
    else
      self.cursor_rect.empty
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25991;&#31456;&#36865;&#12426;&#12398;&#20837;&#21147;&#20966;&#29702;
  #--------------------------------------------------------------------------
  def input_pause
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      self.pause = false
      if @text != nil and not @text.empty?
        new_page if @line_count >= MAX_LINE
      else
        terminate_message
      end
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#36984;&#25246;&#32930;&#12398;&#20837;&#21147;&#20966;&#29702;
  #--------------------------------------------------------------------------
  def input_choice
    if Input.trigger?(Input::B)
      if $game_message.choice_cancel_type > 0
        Sound.play_cancel
        $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
        terminate_message
      end
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      $game_message.choice_proc.call(self.index)
      terminate_message
    end
  end
  #--------------------------------------------------------------------------
  # &#9679; &#25968;&#20516;&#20837;&#21147;&#12398;&#20966;&#29702;
  #--------------------------------------------------------------------------
  def input_number
    if Input.trigger?(Input::C)
      Sound.play_decision
      $game_variables[$game_message.num_input_variable_id] =
        @number_input_window.number
      $game_map.need_refresh = true
      terminate_message
    end
  end
end


Życzę miłego używania ^_^
________________________
po co to kopiujesz? ;d
Spoiler:

Fakty:
1.Widzisz mój podpis
2.Jesteś w internecie
3.Czytasz
4.Siedzisz przy komputerze
5.Jesteś na UltimaForum
6.Twój nick to Gość


kiedys tu bylo fajniej... coz gospoda rma forever
chwala tym ktorzy nadal robia w 2k
 
 
Asantos 




Preferowany:
RPG Maker VX

Ranga RM:
1 gra

Pomógł: 15 razy
Dołączył: 31 Sty 2010
Posty: 236
Skąd: Gniezno
Wysłany: Sob 01 Maj, 2010 15:36
Nie dopisałeś że "N" to ID bohatera oraz autora. A tak w ogóle to może być... Na następny raz bardziej się przyłóż i napisz coś więcej chociażby "na siłę" :)
________________________
Rebelianci łączcie się!
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sob 01 Maj, 2010 16:12
No i znowu wyjdzie, że się czepiam, ale w VX'e nie ma maxsp ani sp.
Kod:
@text.gsub!(/\\SP\[([0-9]+)\]/i) { $game_actors[$1.to_i].sp }
@text.gsub!(/\\MXSP\[([0-9]+)\]/i) { $game_actors[$1.to_i].maxsp }


Ponadto prosiłam, abyś usuwał japońskie znaki.
________________________


 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene