Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Emoticon on Face, Show emoticon on face in message windows.
Nechi
post Feb 16 2008, 06:36 AM
Post #1


Certamen Promus
Group Icon

Group: Revolutionary
Posts: 117
Type: None
RM Skill: Beginner




Add this before Main Script
CODE
#==============================================================================
# Emoticon on Face
#------------------------------------------------------------------------------
# By Nechigawara Sanzenin
# WARNING!! : This script can use on RPG Maker VX Only!! (XP Not Support)
=begin
How to Use:
Add "\E[Number Of Emoticon]" To text in message control
You can see Number of Emoticon on "Balloon.png" in "Graphics\System" or
"%programfiles%\Common Files\Enterbrain\RGSS2\RPGVX\Graphics\System".
when the line number of emoticonset is 1 , Number of Emoticon is 1.
when the line number of emoticonset is 2 , Number of Emoticon is 2.
Max of Number of Emoticon is 10.
You can set Emoticon's Position at EMO_X and EMO_y.
You can set frame rate at BALLOON_WAIT.
if the message window don't have face,Noting happen.
=end
#==============================================================================
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  BALLOON_WAIT = 12
  EMO_X = 93
  EMO_Y = 15
  #--------------------------------------------------------------------------
  alias inc_initialize initialize
  def initialize
    inc_initialize
    @viewport = Viewport.new(0, 0, 544, 416)
    @viewport.z = z + 50
    @balloon_face = 0
    create_balloon
  end
  #--------------------------------------------------------------------------
  alias inc_dispose dispose
  def dispose
    inc_dispose
    dispose_balloon
    @viewport.dispose
  end
  #--------------------------------------------------------------------------
  def update
    super
    update_gold_window
    update_number_input_window
    update_back_sprite
    update_show_fast
    update_balloon
    unless @opening or @closing             # ウィンドウの開閉中以外
      if @wait_count > 0                    # 文章内ウェイト中
        @wait_count -= 1
      elsif self.pause                      # 文章送り待機中
        input_pause
      elsif self.active                     # 選択肢入力中
        input_choice
      elsif @number_input_window.visible    # 数値入力中
        input_number
      elsif @text != nil                    # 残りの文章が存在
        update_message                        # メッセージの更新
      elsif continue?                       # 続ける場合
        start_message                         # メッセージの開始
        open                                  # ウィンドウを開く
        $game_message.visible = true
      else                                  # 続けない場合
        close                                 # ウィンドウを閉じる
        $game_message.visible = @closing
      end
    end
  end
  #--------------------------------------------------------------------------
  def create_balloon
    dispose_balloon
    @balloon_duration = 8 * 8 + BALLOON_WAIT
    @balloon_sprite = ::Sprite.new(@viewport)
    @balloon_sprite.bitmap = Cache.system("Balloon")
    @balloon_sprite.ox = 16
    @balloon_sprite.oy = 32
    @balloon_sprite.visible = false
    update_balloon
  end
  #--------------------------------------------------------------------------
  def refresh_balloon
    if @balloon_face == 0 or @balloon_face > 10
      @balloon_sprite.visible = false
    else
      @balloon_sprite.visible = true
    end
    update_balloon
  end
  #--------------------------------------------------------------------------
  def update_balloon
    if @balloon_duration > 0
      @balloon_duration -= 1
      if @balloon_duration == 0
        @balloon_duration = 8 * 8 + BALLOON_WAIT
        @balloon_duration -= 1
      else
        @balloon_sprite.x = x + EMO_X
        @balloon_sprite.y = y + EMO_Y
        @balloon_sprite.z = z + 50
        if @balloon_duration < BALLOON_WAIT
          sx = 7 * 32
        else
          sx = (7 - (@balloon_duration - BALLOON_WAIT) / 8) * 32
        end
        sy = (@balloon_face - 1) * 32
        @balloon_sprite.src_rect.set(sx, sy, 32, 32)
      end
    end
  end
  #--------------------------------------------------------------------------
  def dispose_balloon
    if @balloon_sprite != nil
      @balloon_sprite.dispose
      @balloon_sprite = nil
    end
  end
  #--------------------------------------------------------------------------
  alias inc_terminate_message terminate_message
  def terminate_message
    inc_terminate_message
    @balloon_sprite.visible = false
  end
  #--------------------------------------------------------------------------
  alias inc_convert_special_characters convert_special_characters
  def convert_special_characters
    inc_convert_special_characters
    @text.gsub!(/\\E\[([0-9]+)\]/i) { "\x09[#{$1}]" }
  end
  #--------------------------------------------------------------------------
  def update_message
    loop do
      c = @text.slice!(/./m)            # 次の文字を取得
      case c
      when nil                          # 描画すべき文字がない
        finish_message                  # 更新終了
        break
      when "\x00"                       # 改行
        new_line
        if @line_count >= MAX_LINE      # 行数が最大のとき
          unless @text.empty?           # さらに続きがあるなら
            self.pause = true           # 入力待ちを入れる
            break
          end
        end
      when "\x01"                       # \C[n]  (文字色変更)
        @text.sub!(/\[([0-9]+)\]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "\x02"                       # \G  (所持金表示)
        @gold_window.refresh
        @gold_window.open
      when "\x03"                       # \.  (ウェイト 1/4 秒)
        @wait_count = 15
        break
      when "\x04"                       # \|  (ウェイト 1 秒)
        @wait_count = 60
        break
      when "\x05"                       # \!  (入力待ち)
        self.pause = true
        break
      when "\x06"                       # \>  (瞬間表示 ON)
        @line_show_fast = true
      when "\x07"                       # \<  (瞬間表示 OFF)
        @line_show_fast = false
      when "\x08"                       # \^  (入力待ちなし)
        @pause_skip = true
      when "\x09"
        @text.sub!(/\[([0-9]+)\]/, "")
        unless $game_message.face_name.empty?
          @balloon_face = $1.to_i
          refresh_balloon
        end
      else                              # 普通の文字
        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
end

How to Use:

Add "\E[Number Of Emoticon]" To text in message control

You can see Number of Emoticon on "Balloon.png" in "Graphics\System" or "%programfiles%\Common Files\Enterbrain\RGSS2\RPGVX\Graphics\System".
when the line number of emoticonset is 1 , Number of Emoticon is 1.
when the line number of emoticonset is 2 , Number of Emoticon is 2.
Max of Number of Emoticon is 10.
You can set Emoticon's Position at EMO_X and EMO_y.
You can set frame rate at BALLOON_WAIT.
if the message window don't have face,Noting happen.

Screen Shot :


This post has been edited by Nechi: Feb 16 2008, 08:05 AM


__________________________


Now, I 'm very busy.I'm work hard in the university. If you send me PM, sorry that I can't answer them at the moment.
Go to the top of the page
 
+Quote Post
   
ERZENGEL
post Feb 16 2008, 10:39 AM
Post #2


Level 8
Group Icon

Group: Revolutionary
Posts: 127
Type: None
RM Skill: Undisclosed




Hey thats really a nice effect but I don't like it because when
I want to show some actor emotions I use an other face wink.gif
Go to the top of the page
 
+Quote Post
   
Koru-chan
post Feb 16 2008, 06:39 PM
Post #3


Level 7
Group Icon

Group: Revolutionary
Posts: 102
Type: Event Designer
RM Skill: Advanced




It's okay if someone doesn't want to use alternate faces, nice alternative. However, when you go to a Japanese site and translate one of their scripts, you should:

1. Make sure that you don't leave some of the text (like the initial warning to only use on VX) babelfished.
2. You should link to the original page, even if it's Japanese, so you give proper credit to the creator.


__________________________



PM me if you want your own graph, please do NOT take and alter for your own.
Go to the top of the page
 
+Quote Post
   
woratana
post Feb 16 2008, 06:51 PM
Post #4


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




@Koru

I think he didn't translate from Japanese script.

The Japanese comments should come with original RGSS2, and he copy from it.


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
lahandi
post Feb 18 2008, 03:06 AM
Post #5


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Artist
RM Skill: Skilled




Mr. Nechi,

1. Which line I should modified (and if you know, what is the coordinates) if I'm using the faceset in the right side of message box (Neo Face System)?

2. It would very kind of you if you could tell how to put the emoticon balloon directly in the message line. Something like : Watchout for the trap! excl.gif .


Thank you very much. smile.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Nechi
post Feb 18 2008, 07:14 AM
Post #6


Certamen Promus
Group Icon

Group: Revolutionary
Posts: 117
Type: None
RM Skill: Beginner




QUOTE (lahandi @ Feb 18 2008, 02:13 AM) *
Mr. Nechi,

1. Which line I should modified (and if you know, what is the coordinates) if I'm using the faceset in the right side of message box (Neo Face System)?

2. It would very kind of you if you could tell how to put the emoticon balloon directly in the message line. Something like : Watchout for the trap! excl.gif .


Thank you very much. smile.gif

1. I will see that script and ask for wor-kun. if he 's ok for me to editing his script, I will create addon for Neo Face System.
2. text system in RGSS doesn't like HTML system, I think i can add it before or after text only, Sorry^^

This post has been edited by Nechi: Feb 18 2008, 07:15 AM


__________________________


Now, I 'm very busy.I'm work hard in the university. If you send me PM, sorry that I can't answer them at the moment.
Go to the top of the page
 
+Quote Post
   
BlasterBoy
post Feb 18 2008, 08:08 AM
Post #7


Level 9
Group Icon

Group: Revolutionary
Posts: 138
Type: Developer
RM Skill: Beginner




Explain how this works...


__________________________

Credit to Nightwalker

PROGRESS [I----------------]
Go to the top of the page
 
+Quote Post
   
Nechi
post Feb 19 2008, 03:09 AM
Post #8


Certamen Promus
Group Icon

Group: Revolutionary
Posts: 117
Type: None
RM Skill: Beginner




QUOTE (BlasterBoy @ Feb 18 2008, 07:15 AM) *
Explain how this works...

It's will show emotion animation on face graphic in message window.


__________________________


Now, I 'm very busy.I'm work hard in the university. If you send me PM, sorry that I can't answer them at the moment.
Go to the top of the page
 
+Quote Post
   
SeeYouAlways
post Feb 20 2008, 03:44 AM
Post #9


Demented Moogle
Group Icon

Group: Banned
Posts: 1,130
Type: None
RM Skill: Undisclosed




Hmm... Nifty. I don't know if I want to display the icon over the character (default) or the face (this script), though. pinch.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Rory
post Feb 20 2008, 05:41 AM
Post #10


GFX Pro
Group Icon

Group: +Gold Member
Posts: 409
Type: Artist
RM Skill: Skilled




Its a good script, but the emoticons look better on the characters.


__________________________

THE SAVAGE NYMPH
Note: this is Magdreamer, I'm using my real name for my forum name now.
Go to the top of the page
 
+Quote Post
   
Guest_From_Ariel_*
post Mar 18 2008, 04:03 PM
Post #11





Guests





Sorry I'm a bit new but I have a question.....

Would it be possible to create a script that would put a small image of a mouth on top of the face graphic
It could be animated to go along with this script to look like the lips are moving or could be used to change the mouth to a frown instead of a smile etc.

This might allow a sort of dynamic face graphic.

Thnx in advance !

Huggles biggrin.gif
Go to the top of the page
 
+Quote Post
   
Twilight27
post Apr 2 2008, 04:24 PM
Post #12


Level 19
Group Icon

Group: Revolutionary
Posts: 371
Type: Event Designer
RM Skill: Beginner




Add "\E[Number Of Emoticon]" To text in message control

You can see Number of Emoticon on "Balloon.png" in "Graphics\System" or "%programfiles%\Common Files\Enterbrain\RGSS2\RPGVX\Graphics\System".
when the line number of emoticonset is 1 , Number of Emoticon is 1.
when the line number of emoticonset is 2 , Number of Emoticon is 2.
Max of Number of Emoticon is 10.
You can set Emoticon's Position at EMO_X and EMO_y.
You can set frame rate at BALLOON_WAIT.
if the message window don't have face,Noting happen.


So all I have to do is:
1) Copy/paste script into script database.
2) Put "\E[Number of Emoticon]" into the text window.

Example:
Kirby:
\E[1] This is cool!

And an exclamation mark will appear?


__________________________

Fall to the power of the Emo!
We have cookies!


Notice!! Check out my topic (http://www.rpgrevolution.com/forums/index.php?showtopic=45736&st=0#entry454175) if you're interested in helping me make a script that limits the number of characters & items you use in battle AND also an item durability feature! Thanks for any help in advance!
Go to the top of the page
 
+Quote Post
   
xeiviersorth
post Apr 9 2008, 03:08 PM
Post #13



Group Icon

Group: Member
Posts: 1
Type: Event Designer
RM Skill: Skilled




okay this may sound noobish but i dont know how to use the face sets can some one plz teach me? on rmxp not vx


This post has been edited by xeiviersorth: Apr 9 2008, 03:12 PM
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 09:01 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker