Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 4 messages ] 
Auteur Message
 Sujet du message: [Message Avancé] Slipknot_Message + DEMO
MessagePublié: 04 Jan 2007, 11:41 
Ancien membre du staff
Ancien membre du staff

Inscrit le: 03 Nov 2006, 01:00
Messages: 598
Points d'aide: 0/60

Créations :

Voir ses créations

Bonjour à tous ^^

Je souhaite soumettre ici un script d'affichage de messages avancé,fait par Slipknot.
C'est une alternative à l'Advanced Message System de Dubealex, qui reprend les mêmes fonctions, et qui en a d'autres, comme par exemple la possibilité d'écrire avec une ombre sous les lettres, un contour noir, et la fenêtre d'affichage se redimensionne automatiquement.

Voici ici les commandes à rentrer dans les messages, et quelques screens, le script étant dans mon deuxième post.



.::PRINCIPALES COMMANDES::.


Elles sont à mettre en début de message...

C[chiffre entre 0 et 6] : changer la couleur du texte
face{nom exact de l'image} : place un faceset sur la DROITE du message
face[nom exact de l'image] : place un faceset à GAUCHE du message

Ne pas oublier que les facesets doivent faire 96 par 96 pixels et doivent être placés dans un repertoire
"message", lui-même placé dans le dossier "pictures" du projet. Ce
cache peut être changé dans le script mais il ne faut pas oublier de
changer l'emplacement et le nom du dossier en conséquences.

font[nom exact de la police] : changer la police d'écriture d'un message à l'autre

Pour changer la couleur de façon définitive; changer le nom à la ligne 136 :
Code: Tout sélectionner
[contents.font].each {|w| w.name = "Nom de votre police" )


Pour entourer le texte ou lui donner une ombre portée, il suffit de
changer la valeur de la ligne 29 : 0 pour rien, 1 pour l'ombre et 2
pour le contour

Il est également possible de changer la couleur du
contour ou de l'ombre, il suffit de remplacer le code couleur aux
lignes 50 (contour) ou 63 (ombre). Faites des essais^^


a[nom du personnage qui parle]
: affiche une boïte de message avec le nom entré au préalable.

Toutes les autres commandes d'affichage de variables, interupteurs, icones, argent, etc....sont les mêmes que celles de l'AMS R4.


.::QUELQUES SCREENSHOTS::.


Faceset à gauche :
Image
Faceset à droite :
Image
Texte ombré (noir) :
Image
Texte ombré (rouge) :
Image
Contour des lettes en noir :
Image
Affichage de la name box :
Image

Le script est dans le post qui suit, par question de commodité, et pour être sûre qu'il rentre entier ^^



Haut
 Profil  
 
 Sujet du message: Re: [Message Avancé] Slipknot_Message + DEMO
MessagePublié: 04 Jan 2007, 11:44 
Ancien membre du staff
Ancien membre du staff

Inscrit le: 03 Nov 2006, 01:00
Messages: 598
Points d'aide: 0/60

Créations :

Voir ses créations

Code: Tout sélectionner
#-----------------------------------------------------------------
# ¦ Slipknot's Advance Message System ¦
#-----------------------------------------------------------------
#  Dernière mise à jour : 02/01/06
#-----------------------------------------------------------------
#  - Objets, Armes, Armures et sorts par Dubealex
#  - Name Box par Dubealex
#  - Taille du texte par  Dubealex
#  - Tye de la police par Dubealex
#  - Nom de la map par Dubealex
#  - Window Over Event by Dubealex
#-----------------------------------------------------------------
#   Reporter les bugs aux adresses suivantes :
#   - dubealex.com/asylum
#   - rmxp.net/forums
#   - crankeye.com/forums
#-----------------------------------------------------------------

#-----------------------------------------------------------------
# This module carries the some message settings
#-----------------------------------------------------------------
module Message
  #---------------------------------------------------------------
  # ● Style de texte :
  #     0: normal
  #     1: ombré
  #     2: contours
  #---------------------------------------------------------------
  Default_Text = 0
  #---------------------------------------------------------------
  # ● Fade the name box and picture
  #---------------------------------------------------------------
  Fade = true
  #---------------------------------------------------------------
  # ● Change it to change the folder for the message
  # pictures
  #---------------------------------------------------------------
  Path = "Graphics/Pictures/"
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
# Add the text displays to the bitmap class
#-----------------------------------------------------------------
class Bitmap
  #---------------------------------------------------------------
  # ● Draws the text 5 times to get the outline effect
  #---------------------------------------------------------------
  def draw_text_outline x, y, wid, hei, str, ali=0
    color = font.color.dup
    font.color = Color.new 0, 0, 0, color.alpha #changer ces valeurs pour changer la couleur
    draw_text(x - 1, y, wid, hei, str, ali)
    draw_text(x-1, y, wid, hei, str, ali)
    draw_text(x, y - 1, wid, hei, str, ali)
    draw_text(x, y-1,  wid, hei, str, ali)
    font.color = color
    draw_text(x, y, wid, hei, str, ali)
  end
  #---------------------------------------------------------------
  # ● Draws the text 3 times to get the shadow effect
  #---------------------------------------------------------------
  def draw_text_shadow x, y, wid, hei, str, ali=0
    color = font.color.dup
    font.color = Color.new -20, 0, 0, (color.alpha*2/3) #changer ces valeurs pour changer la couleur
    draw_text(x - 2, y 2, wid, hei, str, ali)
    font.color = color
    draw_text(x, y, wid, hei, str, ali)
  end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
# The Window Message
#-----------------------------------------------------------------
class Window_Message < Window_Selectable
  #---------------------------------------------------------------
  # ● Include the modules to use their methods and
  # constants
  #---------------------------------------------------------------
  include Message, Input, RPG
  #---------------------------------------------------------------
  # ● Create the message window, and define some
  # variables
  #---------------------------------------------------------------
  def initialize
    super 65, 299, 510, 175
    self.contents = Bitmap.new width-32, height-32
    self.z = 9998
    @contents_showing = false
    self.index = -1
    self.opacity = @cursor_width = 0
    @back = Window_Base.new 65, 299, 510, 175
    self.active = self.visible = false
  end
  #---------------------------------------------------------------
  # ● Change visibility of the contents window and the
  # back one
  #---------------------------------------------------------------
  def visible=(val)
    super
    @back.visible = val
  end
  #---------------------------------------------------------------
  # ● Dispose all the windows
  #---------------------------------------------------------------
  def dispose
    terminate_message
    $game_temp.message_window_showing = false
    @back.dispose
    [@input_number_window].each{|i| if exists? i; i.dispose; end}
    super
  end
  #---------------------------------------------------------------
  # ● Terminates the message and dispose some objects
  #---------------------------------------------------------------
  def terminate_message
    self.active = @back.pause = false
    self.index = -1
    contents.clear
    @contents_showing = false
    if $game_temp.message_proc != nil
      $game_temp.message_proc.call
    end
    [$game_temp].each {|t| t.message_text = t.message_proc = nil;
      t.choice_start = 99; t.choice_max = t.choice_cancel_type = 0;
      t.choice_proc = nil; t.num_input_start = 99;
      t.num_input_variable_id = t.num_input_digits_max = 0 }
    [@gold_window, @name_box, @picture].each{|o|
      o.dispose if exists? o }
  end
 #---------------------------------------------------------------
  # ● Read all the message text and write it into the
  # window
  #---------------------------------------------------------------
  def refresh
    contents.clear
    # Setting the text options to default
    [contents.font].each {|w| w.name = "Dumbledor 1","Arial"
      w.size = 22; w.bold = w.italic = false}
    case Default_Text
    when 0 then disp_text
    when 1 then disp_text false,true
    when 2 then disp_text true end
    # Setting some variables to 0
    @cursor_width = x = y = 0
    x=8 if $game_temp.choice_start == 0
    if $game_temp.message_text != nil
      text = $game_temp.message_text
      begin
        last_text = text.clone
        # Show Variables Value
        text.gsub!(/\[Vv][([0-9]+)]/) { $game_variables[$1.to_i] }
      end until text == last_text
      # Show Hero Name
      text.gsub!(/\[Nn][([0-9]+)]/) {
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" }
      # Current money display
      text.gsub!(/\$$/) {"#{$game_party.gold} #{$data_system.words.gold}"}
      text.gsub!(/\$/) { $game_party.gold.to_s }
      # Show Hero Class Name
      text.gsub!(/\[Cc]lass[([0-9]+)]/) {
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].class_name : "" }
      # Show Current Map Name
      text.gsub!(/\[Mm]ap/) { $game_map.name }
      # Set some variables to false
      name_box = face = picture = over_event = false
      # Name box
      if (/\[Nn]a[(.+?)]/.match(text)) != nil
        name_box, name_text = true, $1
        text.sub!(/\[Nn]a[.*?]/){""}
      end
      # Picture
      if (/\[Pp]ic[(.+?)]/.match(text)) != nil
        picture, pic_name = true, $1
        text.sub!(/\[Pp]ic[.*?]/){""}
      end
      # Face
      #  - Right
      if (/\[Ff]ace{(.+?)}/.match(text)) != nil
        face, face_name = 1, $1
        text.sub!(/\[Ff]ace{.*?}/){""}
      end
      #  - Left
      if (/\[Ff]ace[(.+?)]/.match(text)) != nil
        face, face_name = 0, $1
        text.sub!(/\[Ff]ace[.*?]/){""}
      end
      # Window over event
      if (/\[Pp][([-1,0-9]+)]/.match(text)) != nil
        over_event, event = true, $1.to_i
        text.sub!(/\[Pp][[-1,0-9]+]/){""}
      end
      # "" display
      text.gsub!(/\\/){"\000"}
      # Text Color
      text.gsub!(/\[Cc][([0-9]+)]/){"\001[#$1]"}
      # Show Gold Window
      text.gsub!(/\[Gg]/){"\002"}
      # Text size
      text.gsub!(/\[Tt][Ss][(d+)]/){"\003[#$1]"}
      # Text font
      text.gsub!(/\[Ff]ont[(.+?)]/){"\004[#$1]"}
      # Text different display
      text.gsub!(/\[Tt]ext[([0-2])]/){"\005[#$1]"}
      # SlipKnot's Icon
      text.gsub!(/\[Ii]idiot[(.+?)]/){"\006[#$1]"}
      # Dubealex's Icon
      text.gsub!(/\[Ii]i{([IiWwAaSs]?)}[(d+)]/){change_icon($1,$2.to_i)}
      # Bold font
      text.gsub!(/\[Bb]/){"\007"}
      # Italic font
      text.gsub!(/\[Ii]/){"\010"}
      # Array with all the lines width
      stxt = 0, 0, 0, 0
      @back.height = 32
      icon = ""
      x = 104 if face == 0
      while (c = text.slice!(/./m)) != nil
        if c == "\000" then c = "\" end
        if c == "\001"
          text.sub!(/[([0-9]+)]/, "")
          color = $1.to_i
          contents.font.color = text_color(color) if color >= 0
          next
        end
        if c == "\002"
          if @gold_window == nil
            @gold_window = Window_Gold.new
            @gold_window.x = 560 - @gold_window.width
            if $game_temp.in_battle then @gold_window.y = 192
            else @gold_window.y = self.y >= 128 ? 32 : 384 end
            @gold_window.opacity = @back.opacity
            @gold_window.back_opacity = @back.back_opacity
          end; next
        end
        if c == "\003"
          text.sub!(/[([0-9]+)]/, "")
          contents.font.size = [[$1.to_i, 6].max, 32].min
          next
        end
        if c == "\004"
          text.sub!(/[(.+?)]/, "")
          contents.font.name = $1.to_s
          next
        end
        if c == "\005"
          text.sub!(/[([0-9]+)]/, "")
          case $1.to_i
          when 0 then disp_text
          when 1 then disp_text false,true
          when 2 then disp_text true end
          next
        end
        if c == "\006"
          text.sub!(/[(.+?)]/, "")
          icon = $1.to_s
          c = ""
        end
        if c == "\007"
          [contents.font].each {|i| i.bold = !i.bold }
          next
        end
        if c == "\010"
          [contents.font].each {|i| i.italic = !i.italic }
          next
        end
        if c == "\013"
          text.sub!(/[(.*?)]/, "")
          icon = $1.to_s
          c = ""
        end
        if c == "
"
          @cursor_width = [@cursor_width, x].max if y >= $game_temp.choice_start
          y += 1
          x = face == 0 ? 104 : 0
          if y >= $game_temp.choice_start
            x += 8
            @cursor_width = [@cursor_width, x].max
            if face == 0
              @cursor_width -= 104
              @cursor_x = 112
            else @cursor_x = 8 end
          end
          next
        else stxt[y] += contents.text_size(c).width end
        if icon != ""
          icon_y = (32-24)/2
          contents.blt(4+x, 32*y+4, Cache.icon(icon), Rect.new(0,0,24,24))
          stxt[y] += 24
          x += 24
          icon = ""
        end
        if @outline_text and !@shadow_text
          contents.draw_text_outline 4+x, 32*y, 40, 32, c
        elsif @shadow_text and !@outline_text
          contents.draw_text_shadow 4+x, 32*y, 40, 32, c
        else contents.draw_text 4+x, 32*y, 40, 32, c end
        x += contents.text_size(c).width
      end
      for i in 0..3 do stxt[i] += 104 end if face == 0
      @back.height = y*32+32
      @back.width = stxt.max+40
    end
    men_pos
    if $game_temp.choice_max > 0
      @item_max = $game_temp.choice_max
      self.active, self.index = true, 0
    end
    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new digits_max
      @back.height += 32
      width = [@back.width, @input_number_window.width-16].max
      @back.width = width
      [@input_number_window].each {|o|
        o.number = number
        o.y = self.y+$game_temp.num_input_start*32
        o.x = face != 0 ? self.x+8 : self.x+8+112 }
    end
    if face
      bitmap = Cache.load_bitmap Path, face_name
      fy = @back.height <= 128 ? 0 : (@back.height-128)/2
      fx = face == 0 ? 0 : stxt.max+8
      @back.width = stxt.max + 136 if face == 1
      contents.blt fx, fy, bitmap, Rect.new(0,0,96,96)
      @back.height = 128 if @back.height <= 128
      men_pos
    end
    if over_event and $game_map.events != nil
      ch = event <= 0 ? $game_player : $game_map.events[event]
      fx = [[ch.screen_x-@back.width/2, 4].max, 636-@back.width].min
      fy = [[ch.screen_y-(@back.height+48), 4].max, 476-@back.height].min
      self.x = @back.x = fx
      self.y = @back.y = fy
    end
    if picture
      px = self.x+@back.width
      @picture = Sprite.new
      @picture.bitmap = Cache.load_bitmap Path, pic_name
      @picture.x = px-@picture.bitmap.width
      @picture.y = self.y-@picture.bitmap.height
      @picture.opacity = 0 if Fade
    end
    if name_box
      @name_box = Name_Box.new self.x, self.y-15, name_text
      @name_box.opacity = 0 if Fade
      @name_box.back.opacity = $game_system.message_frame == 0 ? 255 : 0
    end
  end


Haut
 Profil  
 
 Sujet du message: Re: [Message Avancé] Slipknot_Message + DEMO
MessagePublié: 04 Jan 2007, 11:44 
Ancien membre du staff
Ancien membre du staff

Inscrit le: 03 Nov 2006, 01:00
Messages: 598
Points d'aide: 0/60

Créations :

Voir ses créations

Code: Tout sélectionner
#---------------------------------------------------------------
  # ● Update the cursor, the pause graphic, fade the
  # windows and handle the input
  #---------------------------------------------------------------
  def update
    super
    @back.update
    if @input_number_window != nil
      @input_number_window.update
      if Input.trigger? C
        $game_system.se_play $data_system.decision_se
        $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
        $game_map.need_refresh = true
        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end; return
    end
    if @contents_showing
      @back.pause = true if $game_temp.choice_max == 0
      if Input.trigger? B
        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
          $game_system.se_play $data_system.cancel_se
          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
          terminate_message
        end
      end
      if Input.trigger? C
        if $game_temp.choice_max > 0
          $game_system.se_play $data_system.decision_se
          $game_temp.choice_proc.call(self.index)
        end
        terminate_message
      end; return
    end
    if $game_temp.message_text != nil
      @contents_showing = true
      $game_temp.message_window_showing = true
      reset_window; refresh
      Graphics.frame_reset
      self.visible = true
      self.contents_opacity = 0
      if @input_number_window != nil
        @input_number_window.contents_opacity = 0
      end
      loop do
        Graphics.update
        self.contents_opacity += 24
        @name_box.opacity += 24 if exists? @name_box and Fade
        @picture.opacity += 24 if exists? @picture and Fade
        if @input_number_window != nil
          @input_number_window.contents_opacity += 24
        end
        break if self.contents_opacity == 255
      end
      return
    end
    if self.visible
      loop do
        Graphics.update
        @back.opacity -= 48
        break if @back.opacity == 0
      end
      self.visible = false
      $game_temp.message_window_showing = false
      return
    end
  end
  #---------------------------------------------------------------
  # ● Get the icon bitmaps and names of each item,
  # armor, weapon and skills
  #    option: item, weapon, armor or skill
  #    index: the id of the object
  #---------------------------------------------------------------
  def change_icon option, index
    s = case option.downcase
      when "i" then $data_items[index]
      when "w"then $data_weapons[index]
      when "a" then $data_armors[index]
      when "s" then $data_skills[index] end
    return sprintf("\013[%s]%s", s.icon_name, s.name) unless s.name == nil
  end
  #---------------------------------------------------------------
  # ● Set the variables for outline and shadow text
  #    w1: outline text true or false
  #    w2: shadow text true or false
  #---------------------------------------------------------------
  def disp_text w1=false, w2=false
    @outline_text, @shadow_text = w1, w2
  end
  #---------------------------------------------------------------
  # ● Return false if the objects is nil or is disposed
  #---------------------------------------------------------------
  def exists? object
    return false if object.nil? or object.disposed?
    return true
  end
  #---------------------------------------------------------------
  # ● Resize the windows and set their positions
  #---------------------------------------------------------------
  def men_pos
    h2 = @back.height/2
    self.y = $game_temp.in_battle ? 96 - h2 :
      case $game_system.message_position
      when 0 then 96 - h2
      when 1 then 240-h2
      when 2 then 384-h2 end
    self.x = 320 - @back.width/2
    @back.x, @back.y = self.x, self.y
  end
  #---------------------------------------------------------------
  # ● Change the visibility of the windows and call
  # men_pos to resize them
  #---------------------------------------------------------------
  def reset_window
    men_pos
    @back.opacity = $game_system.message_frame == 0 ? 255 : 0
    @back.back_opacity = 160
  end
  #---------------------------------------------------------------
  # ● Update the cursor rect, if this is needed
  #---------------------------------------------------------------
  def update_cursor_rect
    if @index >= 0
      n = $game_temp.choice_start + @index
      cursor_rect.set @cursor_x, n*32, @cursor_width, 32
    else cursor_rect.empty end
  end
  #---------------------------------------------------------------
  # The name box sprite
  #---------------------------------------------------------------
  class Name_Box < Sprite
    #---------------------------------------------------------------
    attr_accessor "back"
    #---------------------------------------------------------------
    # ● Create the name box text sprite
    #     x: the x position of the text
    #     y: the y position of the text
    #     text: the text chosen to be displayed
    #---------------------------------------------------------------
     def initialize x, y, text=" "
      dumb = Bitmap.new 320, 42
      # Ajout Krazplay pour correction, la police doit être la même que plus bas
      dumb.font = Font.new("Dumbledor 1","Arial")
      dumb.draw_text(0, 0, 320, 22, text)
      # Fin ajout Krazplay
      size = dumb.text_size(text).width
      dumb.dispose
      @back = Window_Base.new x, y, size+12, 32
      @back.back_opacity = 255      # Opacité du fond de la name box (max 255)
      viewport = Viewport.new x+6, y+5, size, 22
      viewport.z = @back.z+10
      super viewport
      self.bitmap = Bitmap.new size, 22
      self.bitmap.font = Font.new("Dumbledor 1","Arial")   # Police d'écriture de la name box
      case Message::Default_Text
      when 0 then bitmap.draw_text 0, 0, size, 22, text
      when 1 then bitmap.draw_text_shadow 0, 0, size, 22, text
      when 2 then bitmap.draw_text_outline 0, 0, size, 22, text end
    end
    #---------------------------------------------------------------
    # ● Dispose the text and back
    #---------------------------------------------------------------
    def dispose
      super
      @back.dispose
    end
  #---------------------------------------------------------------
  end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
# Little modification to get the maps names
#-----------------------------------------------------------------
class Scene_Title
  #---------------------------------------------------------------
  $map_infos = load_data "Data/MapInfos.rxdata"
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
class Game_Map
  #---------------------------------------------------------------
  def name; $map_infos[@map_id].name; end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
# Little modification to fix the cursor width
#-----------------------------------------------------------------
class Window_InputNumber < Window_Base
  #---------------------------------------------------------------
  def initialize(digits_max)
    @digits_max = digits_max
    @number = 0
    dummy = Bitmap.new 32, 32
    @cursor_width = dummy.text_size("0").width+8
    dummy.dispose
    super 0, 0, @cursor_width*@digits_max+64, 64
    self.contents = Bitmap.new width-32, 32
    self.z += 9999
    self.opacity = @index = 0
    refresh
    update_cursor_rect
  end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------


Haut
 Profil  
 
 Sujet du message: Re: [Message Avancé] Slipknot_Message + DEMO
MessagePublié: 21 Aoû 2010, 17:09 
Artisan (Nv 4)

Inscrit le: 15 Mai 2008, 00:00
Messages: 167
Points d'aide: 0/60

Créations :

Voir ses créations

Désolé de poster si tard mais quelqu'un pourrais me dire pourquoi sa me fait ????? ' ' ? 64 ??? SyntaxError ????????

S'il vous plaît j'ai vu les screens et j'ai besoin de se script :(


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 4 messages ] 

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 1 invité


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728