Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Animated Message Script
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


here is the script for it, you need to make a face for you character, three of them with the name of the character set and put them in the folder call Face in the characters folder. just make the new folder in the characters folder. ex john will be john_talk1 - talk3. you also need to make a picture that will show when the character that is being talked to is an npc, just make a picture and call it No-Face,

make a new script and put this

Code:
class Game_System
attr_accessor :npc_name
attr_accessor :skip

new_init initialize
def initialize
@npc_name = ""
@skip = false
new_init
end
end
class Message
  def delay(wait)
    count = Graphics.frame_count
    while wait + count >= Graphics.frame_count
      Graphics.update
    end
  end
    
  def load_face(id, frame)
    actor = $game_party.actors[id]
    if id == -1
      $fac = "No-Face"
      $fac_hue = 200
    else
      $fac = Â� (actor.character_name) + "_talk#{frame}"
      $fac_hue = actor.character_hue
    end
    @face = Sprite.new
    @face.bitmap = RPG::Cache.character("Faces/" + $fac,$fac_hue)
    case id
    when -1
      @face.x = 88
      @face.y = 178
      @face.z = 600
    when 0
      @face.x = 88
      @face.y = 178
      @face.z = 600
    when 1
      @face.x = 86
      @face.y = 178
      @face.z = 600
    when 2...3
      @face.x = 88
      @face.y = 178
      @face.z = 600
    end
  end
    
  def face_update
    if @face != nil
      @face.bitmap.dispose
    end
  end
    
  def remove
    if @face != nil
      @face.bitmap.dispose
      @face.dispose
    end
    if @test_window != nil
      @test_window.dispose
    end
    if @pic_w != nil
      @pic_w.dispose
    end
    if @name != nil
      @name.dispose
    end
    if @fake != nil
      @fake.dispose
    end
    if @detail != nil
      @detail.dispose
    end
  end
    
  def messages(id , message, waiting = 4)
    actor = $game_party.actors[id]
    unless id == -1
      $text = actor.name
    else
      $text = $game_system.npc_name
    end
    @var = id
    @message = message
    @waiting = waiting
    @test_window = Window_Message.new
    @test_window.contents.font.name = "Arial"
    @test_window.contents.font.size = 18
    @test_window.visible = true
    @test_window.y = 304
    @test_window.x = 80
    @test_window.width = 480
    @test_window.height = 160
    @test_window.back_opacity = 190
    x = 0
    y = 0
    #detatil
    @pic_w = Window_Base.new(80, 170, 136,135)
    @pic_w.back_opacity = 160
    @name = Window_Help.new
    @name.width = 150
    @name.height = 45
    @name.x = 215
    @name.y = 260
    @name.back_opacity = 160
    @fake = Window_Help.new
    @fake.width = 150
    @fake.height = 640
    @fake.x = 219
    @fake.y = 253
    @fake.opacity = 0
    @fake.set_text($text)
    @detail = Window_Help.new
    @detail.width = @fake.width
    @detail.height = @fake.height
    @detail.x = 453
    @detail.y = 415
    @detail.z = 10000
    @detail.opacity = 0
    @detail.set_text("X - (Close)")
    #detaitl
    while ((c = @message.slice!(/./m)) != nil)
      @var += 1
      if @var >= 3
        @var = 1
      end
      w = @test_window.contents.text_size(c).width
      h = @test_window.contents.text_size(c).height
      if ((x + w) > 429)
        x = 0
        y += h
      end
      @test_window.contents.draw_text(x,y,w,h,c)
      x += w
      if $game_system.skip == false
        Audio.se_play("Audio/SE/" + "001-System01", 100, 100)
        delay(@waiting)
        face_update
        load_face(id, @var)
      elsif $game_system.skip == true
        face_update
        load_face(id, 1)
      end
    end
    face_update
    load_face(id, 1)
    if @waiting
      loop do
        Graphics.update
        Input.update
        break if Input.trigger?(Input::X)
      end
      remove
    end    
  end
end

$msg = Message.new

to call it just put this
for npc, do this
Code:
$game_system.npc_name = "JAMES"#set the name of the npc, then make msg

like this
Code:
$msg.messages(-1,"What up with you today my friend, what a
wonderful day isn't it. I love the message system alot, don't you.")

when it is a npc, you - 1 before the text.

then for characters, you this
Code:
$msg.messages(0,"You need to go study")
#you number from 0-3
#0 - 3 are the id for your character, 0 for player one and so on.
if you want a to make a message just show faster or slower you can make something like this[/CODE]

Code:
$msg.messages(0,"You need to go study", 4)#four is how fast it will show the text.
#you can change it to what ever you want.


finally, if you want a message to skip
before the message, call
Code:
$game_system.skip = true
, then the msg script
if you want it not to skip, just call the false of skip

ex

Code:
$game_system.skip = true
message# skipping
$game_system.skip = false
message# no skipping


hope you like it
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Animated Icons Samo the thief 0 2,468 12-11-2006, 01:00 PM
Last Post: Samo the thief
  Change character script jaigai 0 2,796 11-19-2006, 01:00 PM
Last Post: jaigai
  Just a modification of Abyssos' facs script lumina... 0 2,632 11-01-2006, 01:00 PM
Last Post: lumina...
  Credit Script 1.1 acoole 0 2,472 10-24-2006, 01:00 PM
Last Post: acoole
  Script Dev Kit Nick 0 2,842 10-15-2006, 01:00 PM
Last Post: Nick
  Auto Skipping Message Sonokawa 0 2,017 09-02-2006, 01:00 PM
Last Post: Sonokawa
  Show a Message in any Scene Tsunokiette 1 3,005 08-17-2006, 01:15 PM
Last Post: GoldenShadow
  Opening Image script sasuke89 0 2,058 07-24-2006, 01:00 PM
Last Post: sasuke89
  Change Color of The diferent Status Script MASTERLOKI 0 2,311 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Event Name and ID Search Script Hadriel 0 2,077 06-21-2006, 01:00 PM
Last Post: Hadriel



Users browsing this thread: