~Site
¤Accueil
¤Forum
¤Admin

~Base de scripts
¤Scripts de base
¤Scripts Menu
¤Scripts Combat
¤Scripts Système
¤Scripts Modifiés

Scripts Système
Mouvement pixel par pixel
Afficher le temps réel
Nom de la map dans le menu
Chenille
Coeurs à la zelda sur la map
Avoir 3 accessoires
Météo améliorée
Advanced Message Script
Nom de la map


Advanced Message Script ::: posté le 2006-02-20 @ 12:08:00
Auteur: Dubealex
Titre: Advanced_Message
Description: Grâce à ce script vous pourrez ajouter de nouvelles fonctions dans les messages.
Ressources: Facesets au format 96x96 pour la commande f[nom]
Image(s):
Image 01
Image 02
Image 03

Installation:
Créez un nouveau script au dessus de "Main", appelé "Advanced_Message" puis coller le script suivant dedans.

# ??? XRXS 9. ???????????????? ver..12d ???
# Original scrïpt by ?? ??, ??, RaTTiE
# scrïpt from: http://f26.aaacafe.ne.jp/~xxms/RPGXP_XRXS9.htm
#
#Advanced Version by: dubealex
#
#To found all my NEW features, press CONTROL+F and search for the word "#NEW"
#To found the code where the "Skip Letter By Letter mode", search for "# SKIP"
#
# You can found all the command list on my website
# rmxp.dubealex.com
# Go in the "scrïpt" section.


#============================================
# ¦ Window_Message
#============================================
class Window_Message < Window_Selectable
# ???????
DEFAULT_TYPING_ENABLE = true # false????????
#------------------------------------------
# ? ?????????
#------------------------------------------
alias xrxs9_initialize initialize
def initialize

$defaultfonttype = "Tahoma"
$defaultfontsize = 24

# IF for any reasons the FONT doesn't appears in your game, this is
# because you are using a different version of RMXP. Look in the class MAIN
# (under this one)
# Go at line #10 and #12, and just copy the word that begins with a $ sign
# and replace what is after the equal sign on lign #27 and 28 of this class.

xrxs9_initialize
# ?????????????""???
if $soundname_on_speak == nil then
$soundname_on_speak = ""
end
# ??????????
$gaiji_file = "./Graphics/Gaiji/sample.png"
# ?????????
if FileTest.exist?($gaiji_file)
@gaiji_cache = Bitmap.new($gaiji_file)
else
@gaigi_cache = nil
end
# ???????????
@opacity_text_buf = Bitmap.new(32, 32)
end
#------------------------------------------
# ? ?????????
#------------------------------------------
alias xrxs9_terminate_message terminate_message
def terminate_message
if @name_window_frame != nil
@name_window_frame.dispose
@name_window_frame = nil
end
if @name_window_text != nil
@name_window_text.dispose
@name_window_text = nil
end
xrxs9_terminate_message
end
#------------------------------------------
# ? ??????
#------------------------------------------
def refresh
# ???
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.name = $fontface
@x = @y = @max_x = @max_y = @indent = @lines = 0
@face_indent = 0
@opacity = 255
@cursor_width = 0
@write_speed = 0
@write_wait = 0
@mid_stop = false
@face_file = nil
# @popchar ? -2 ?????????-1???????????
# 0????? ???????0?????1????????
@popchar = -2
# ???????????
if $game_temp.choice_start == 0
@x = 8
end
# ???????????·???
if $game_temp.message_text != nil
@now_text = $game_temp.message_text
# ?????F?·???
if (/A\[Ff][(.+?)]/.match(@now_text))!=nil then
# ????????
if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
# ??????
@face_file = $1 + ".png"
self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
# ?? 128???????????????
@x = @face_indent = 128
end
@now_text.gsub!(/\[Ff][(.*?)]/) { "" }
end
# ??????
begin
last_text = @now_text.clone
# V??????????(????)
@now_text.gsub!(/\[Vv][([IiWwAaSs]?)([0-9]+)]/) { convart_value($1, $2.to_i) }
end until @now_text == last_text
@now_text.gsub!(/\[Nn][([0-9]+)]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end

#NEW
#Dubealex Show Monster Name Feature
@now_text.gsub!(/\[Mm][([0-9]+)]/) do
$data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""
end
#End new command

#NEW
#Dubealex Show Item Price Feature
@now_text.gsub!(/\[Pp]rice[([0-9]+)]/) do
$data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : ""
end
#End new command

#NEW
#Dubealex Show Hero Class Name Feature
@now_text.gsub!(/\[Cc]lass[([0-9]+)]/) do
$data_classes[$data_actors[$1.to_i].class_id] != nil ? $data_classes[$data_actors[$1.to_i].class_id].name : ""
end
#End new command

#NEW
#Dubealex Show Current Map Name Feature
@now_text.gsub!(/\[Mm]ap/) do
$game_map.name != nil ? $game_map.name : ""
end
#End new command

# name?·???
name_window_set = false
if (/\[Nn]ame[(.+?)]/.match(@now_text)) != nil
# ????
name_window_set = true
name_text = $1
# name[]?????
@now_text.sub!(/\[Nn]ame[(.*?)]/) { "" }
end
# ?????????
if (/\[Pp][([-1,0-9]+)]/.match(@now_text))!=nil then
@popchar = $1.to_i
if @popchar == -1
@x = @indent = 48
@y = 4
end
@now_text.gsub!(/\[Pp][([-1,0-9]+)]/) { "" }
end
# ?????????
@max_choice_x = 0
if @popchar >= 0
@text_save = @now_text.clone
@max_x = 0
@max_y = 4
for i in 0..3
line = @now_text.split(/n/)[3-i]
@max_y -= 1 if line == nil and @max_y <= 4-i
next if line == nil
line.gsub!(/\w[(w+)]/) { "" }
cx = contents.text_size(line).width
@max_x = cx if cx > @max_x
if i >= $game_temp.choice_start
@max_choice_x = cx if cx > @max_choice_x
end
end
self.width = @max_x + 32 + @face_indent
self.height = (@max_y - 1) * 32 + 64
@max_choice_x -= 68
@max_choice_x -= @face_indent*216/128
else
@max_x = self.width - 32 - @face_indent
for i in 0..3
line = @now_text.split(/n/)[i]
next if line == nil
line.gsub!(/\w[(w+)]/) { "" }
cx = contents.text_size(line).width
if i >= $game_temp.choice_start
@max_choice_x = cx if cx > @max_choice_x
end
end
@max_choice_x += 8
end
# ??????????????
@cursor_width = 0
#if @lines >= $game_temp.choice_start
# @cursor_width = [@cursor_width, @max_choice_x - @face_indent].max
#end
# ????"\\" ? "
Design By RaZ © Watery Build 2005