查看: 3085|回复: 5

[已经解决] 请问心情动画可以扩展吗?

[复制链接]
梦石
0
星屑
55
在线时间
52 小时
注册时间
2006-12-8
回帖
24
发表于 2013-3-13 08:17:33 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我想尽量丰富角色的动作,心情之类的,但是心情动画好像只有8个,如果把别的图命名为balloon放到system文件夹就替换了原有的文件了,想问下有没有脚本之类的可以扩展心情动画呢?另外,VA的有些只有三格的人物动作不知道怎么用啊,换上如果跟人对话就会跳到别人的动作去了,也想问下这是怎么回事
梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
回帖
1526
发表于 2013-3-13 17:54:34 | 显示全部楼层
本帖最后由 j433463 于 2013-3-13 18:35 编辑

呃,有个月姬(姬公主)的图标气球脚本,看了网站的使用条款没有提到禁止转贴,只有保持原脚本和脚本上方的说明,所以我就贴出了,若有疑义,请说一声,我好及时删除。

脚本需要配合一张气球图:



图片请放到 Graphics/System 内。

下面这是脚本:

  1. =begin
  2. #==============================================================================
  3. ** Icon Balloon
  4. Author: Tsukihime
  5. Date: Sep 3, 2012
  6. ------------------------------------------------------------------------------
  7. ** Change log
  8. Sep 3
  9.    - updated with more method aliasing
  10.    - initial release
  11. ------------------------------------------------------------------------------   
  12. Similar to the emotion balloons, except it uses an icon instead.
  13. You will need a copy of the Icon-Balloon.png file, which is basically
  14. one row of balloon frames copied from the Balloon.png file.

  15. Script call:

  16.     show_icon_balloon(char_id, icon_index, wait?)
  17.    
  18. `char_id` is the character on the map
  19.      (-1 = player, 0 = this event, 1+ is specific event ID)

  20. `icon_index` is the index of the icon
  21. `wait` is a boolean representing whether the game should wait until the balloon disappears
  22. #==============================================================================
  23. =end
  24. $imported = {} if $imported.nil?
  25. $imported["Tsuki_IconBalloons"] = true
  26. #==============================================================================
  27. # ** Configuration
  28. #==============================================================================
  29. module Tsuki
  30.   module Icon_Balloon
  31.   end
  32. end
  33. #==============================================================================
  34. # ** Rest of script
  35. #==============================================================================

  36. class Game_Interpreter
  37.   
  38.   def show_icon_balloon(char_id, icon_index, need_wait=false)
  39.     character = get_character(char_id)
  40.     if character
  41.       character.icon_balloon_id = icon_index
  42.       Fiber.yield while character.icon_balloon_id > 0 if need_wait
  43.     end
  44.   end
  45. end

  46. class Game_CharacterBase
  47.   
  48.   attr_accessor :icon_balloon_id
  49.   
  50.   alias :th_icon_balloon_init_public :init_public_members
  51.   def init_public_members
  52.     th_icon_balloon_init_public
  53.     @icon_balloon_id = 0
  54.   end
  55. end

  56. class Sprite_Character
  57.   
  58.   alias :th_icon_balloon_initialize :initialize
  59.   def initialize(viewport, character = nil)
  60.     @icon_balloon_duration = 0
  61.     th_icon_balloon_initialize(viewport, character)
  62.   end
  63.   
  64.   alias :th_icon_balloon_dispose :dispose
  65.   def dispose
  66.     th_icon_balloon_dispose
  67.     end_icon_balloon
  68.   end

  69.   alias :th_icon_balloon_update :update
  70.   def update
  71.     th_icon_balloon_update
  72.     update_icon_balloon #new  
  73.   end
  74.   
  75.   alias :th_icon_balloon_setup_new :setup_new_effect
  76.   def setup_new_effect
  77.     th_icon_balloon_setup_new
  78.     if !@icon_balloon_sprite && @character.icon_balloon_id > 0
  79.       @icon_balloon_id = @character.icon_balloon_id
  80.       start_icon_balloon
  81.     end
  82.   end
  83.   
  84.   # new icon balloon methods
  85.   
  86.   def start_icon_balloon
  87.     dispose_icon_balloon
  88.    
  89.     @icon_balloon_duration = 8 * balloon_speed + balloon_wait
  90.     @icon_balloon_sprite = ::Sprite.new(viewport)
  91.     @icon_balloon_sprite.bitmap = Cache.system("Icon-Balloon")
  92.     @icon_balloon_sprite.ox = 16
  93.     @icon_balloon_sprite.oy = 32
  94.    
  95.     @icon = Cache.system("Iconset")
  96.     @icon_rect = Rect.new(@icon_balloon_id % 16 * 24, @icon_balloon_id / 16 * 24, 24, 24)
  97.     @icon_balloon_sprite.bitmap.blt(4, 2, @icon, @icon_rect, 255)
  98.    
  99.     update_icon_balloon
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # * Free Balloon Icon
  103.   #--------------------------------------------------------------------------
  104.   def dispose_icon_balloon
  105.     if @icon_balloon_sprite
  106.       @icon_balloon_sprite.dispose
  107.       @icon_balloon_sprite = nil
  108.     end
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # * Update Balloon Icon
  112.   #--------------------------------------------------------------------------
  113.   def update_icon_balloon
  114.     if @icon_balloon_duration > 0
  115.       @icon_balloon_duration -= 1
  116.       if @icon_balloon_duration > 0
  117.         @icon_balloon_sprite.x = x
  118.         @icon_balloon_sprite.y = y - height
  119.         @icon_balloon_sprite.z = z + 200
  120.         
  121.         sx = balloon_frame_index * 32
  122.         sy = 0
  123.         @icon_balloon_sprite.src_rect.set(sx, sy, 32, 32)
  124.         @icon_balloon_sprite.bitmap.blt(sx+4, sy+2, @icon, @icon_rect, 255)
  125.       else
  126.         end_icon_balloon
  127.       end
  128.     end
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # * End Balloon Icon
  132.   #--------------------------------------------------------------------------
  133.   def end_icon_balloon
  134.     dispose_icon_balloon
  135.     @character.icon_balloon_id = 0
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # * Balloon Icon Display Speed
  139.   #--------------------------------------------------------------------------
  140.   def balloon_speed
  141.     return 8
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # * Wait Time for Last Frame of Balloon
  145.   #--------------------------------------------------------------------------
  146.   def balloon_wait
  147.     return 12
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # * Frame Number of Balloon Icon
  151.   #--------------------------------------------------------------------------
  152.   def balloon_frame_index
  153.     return 7 - [(@icon_balloon_duration - balloon_wait) / balloon_speed, 0].max
  154.   end
  155. end
复制代码



调用方法是:

  1. show_icon_balloon(角色 id, 图标 id, 保持几帧时间)
复制代码


角色 id 可以是 -1 玩家, 0 本事件, 1 或以上为指定的事件 id



好像还有一个 tomoaky 写的 icon 脚本也是做类似的效果,脚本名是 RGSS3_アイコンポップ ver 1.2,
日文脚本请自己下载吧:

http://hikimoki.sakura.ne.jp/rgss3/script_map/tmicpop.rb


评分

参与人数 1梦石 +1 收起 理由
Mic_洛洛 + 1 认可答案

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

梦石
0
星屑
55
在线时间
52 小时
注册时间
2006-12-8
回帖
24
 楼主| 发表于 2013-3-13 09:22:52 | 显示全部楼层
76213585 发表于 2013-3-13 08:50
VA的三格的人物动作用固定朝向就好了
如果想要他們转的話   就自己去弄或是求 要不然就找現成

谢谢,不过有时候我用了固定朝向(比如人倒在地上之类的),但只要人物试着对话就会跳到下一格图,不对话了又会恢复= =
回复

使用道具 举报

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
回帖
1526
发表于 2013-3-13 12:39:53 | 显示全部楼层
心情图本身无法扩增,就那几种,不过可以用动画来做,其实以前 XP 也是用动画做心情图的,

或者可以用脚本来扩展,但这样扩展的心情图名称不会出现在下拉选单中,要用时必须用脚本命令去调用,

另外,还有一种图标心情脚本,是用现成的图标来做心情图,有多少合适图标,就可以做出多少种心情。

评分

参与人数 1星屑 +3 收起 理由
怪蜀黍 + 3 我很赞同

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

梦石
0
星屑
55
在线时间
52 小时
注册时间
2006-12-8
回帖
24
 楼主| 发表于 2013-3-13 17:25:20 | 显示全部楼层
j433463 发表于 2013-3-13 12:39
心情图本身无法扩增,就那几种,不过可以用动画来做,其实以前 XP 也是用动画做心情图的,

或者可以用脚本 ...

谢谢指点!我试了用动画来做心情,不过图太小了,自己用PS改大又虚了。。= =
图标的话,该怎么让它出现在人物头顶上方呢?
回复

使用道具 举报

梦石
0
星屑
55
在线时间
52 小时
注册时间
2006-12-8
回帖
24
 楼主| 发表于 2013-3-13 21:32:03 | 显示全部楼层
j433463 发表于 2013-3-13 17:54
呃,有个月姬(姬公主)的图标气球脚本,看了网站的使用条款没有提到禁止转贴,只有保持原脚本和脚本上方的 ...

好的,非常感谢~{:2_280:}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部