设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 25386|回复: 33
打印 上一主题 下一主题

[原创发布] 【插件】仿空轨地图人物气球

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3657
在线时间
4466 小时
注册时间
2008-6-12
帖子
802
跳转到指定楼层
1
发表于 2015-11-20 18:02:02 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 过眼云烟 于 2015-11-20 18:01 编辑

这是我尝试开发的第三个MV插件,希望大家多多回帖支持,你们的回帖会给我更大的动力!
效果的话类似于空之轨迹游戏中人物走近NPC会显示气泡表情,使用方法是在事件的说明中添加autoballoon_11,即显示11号表情。
截图中的素材为我按照空之轨迹修改后的实现的效果,附件中的图片取自MV RTP默认素材的表情文件,请参照此图格式制作您自己的表情合集。

后续版本将提供修改格式,显示速度等功能,敬请期待,当然如果大家留言不积极我就懒得继续开发了


Enjoy it~~~
如果有问题,欢迎留言。
效果如下:


使用方法:


自动气球包素材格式,请放到System目录下:(参照)



JAVASCRIPT 代码复制下载
  1. //=============================================================================
  2. // MrLiu_AutoBalloon.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc 在RMMV游戏中地图界面的人物头顶自动显示气球
  7.  * @author MrLiu-过眼云烟
  8.  *
  9.  * @help 事件页的说明下加入“autoballoon_11”,即显示第11行的表情,需将Balloon_1.png
  10.  * 文件放在\img\system目录下,该文件默认大小为96*352,默认每格表情大小为32,每行3格
  11.  * 后续版本将提供修改格式,显示速度等功能,敬请期待,如有问题欢迎给我留言。
  12.  */
  13. //-----------------------------------------------------------------------------
  14. var Imported = Imported || {};
  15. Imported.MrLiu_AutoBalloon = true;
  16.  
  17. var Lmd = Lmd || {};
  18. Lmd.MrLiu_AutoBalloon = Lmd.MrLiu_AutoBalloon || {};
  19.  
  20.  
  21.  
  22.   var parameters = PluginManager.parameters('MrLiu_Shadow');
  23.   var displayAutoBalloon = String(parameters['displayAutoBalloon']);
  24.   var shadowOpacity = Number(parameters['shadowOpacity']);
  25.   displayAutoBalloon = false;
  26.  
  27. Lmd.MrLiu_AutoBalloon.Game_Character_initialize = Game_Character.prototype.initialize;
  28.   Game_Character.prototype.initialize = function() {
  29.     Lmd.MrLiu_AutoBalloon.Game_Character_initialize.call(this);
  30.     this._auto_balloon = 0;
  31. };
  32.  
  33. Game_Character.prototype._auto_balloon = function() {
  34.         return this._auto_balloon;
  35. };
  36.  
  37.  
  38. Lmd.MrLiu_AutoBalloon.Game_Event_refresh = Game_Event.prototype.refresh;
  39. Game_Event.prototype.refresh = function() {
  40.         Lmd.MrLiu_AutoBalloon.Game_Event_refresh.call(this);
  41.         if((this._erased == false)&&(this._trigger == 0)){
  42.         var list = this.list();
  43.         for(var i=0 ;i<list.length;i++){
  44.                 if (list[i].code == 108){
  45.                         var num =list[i].parameters[0].match(/autoballoon_(\d+)/g);
  46.                         if (num){
  47.                                 var num1 = Number((String(num)).match(/\d+(\.\d+)?/g));
  48.                                 this._auto_balloon = num1;
  49.                         }
  50.                 }
  51.         }
  52.         }
  53. };
  54.  
  55. Game_Event.prototype.setupPage = function() {
  56.     if (this._pageIndex >= 0) {
  57.                 this._auto_balloon = 0;
  58.         this.setupPageSettings();
  59.     } else {
  60.                 this._auto_balloon = 0;
  61.         this.clearPageSettings();
  62.     }
  63.     this.refreshBushDepth();
  64.     this.clearStartingFlag();
  65.     this.checkEventTriggerAuto();
  66. };
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. Lmd.MrLiu_AutoBalloon.Sprite_Character_initialize = Sprite_Character.prototype.initialize;
  74. Sprite_Character.prototype.initialize = function(character) {
  75.     Lmd.MrLiu_AutoBalloon.Sprite_Character_initialize.call(this,character);
  76.         this.createAutoBalloon();
  77.         this._dis_flag = 0;
  78.         this._flag = 0;
  79.         this._bx = 0
  80.         this.character = character;
  81. };
  82. Sprite_Character.prototype.createAutoBalloon = function() {
  83.     this._auto_balloon_sprite = new Sprite();
  84.     this._auto_balloon_sprite.bitmap = ImageManager.loadSystem('Balloon_1');
  85.         this._auto_balloon_sprite.opacity = 0;
  86.         this._auto_balloon_sprite.z = 7;
  87.         this._auto_balloon_sprite.x = this.x;
  88.     this._auto_balloon_sprite.y = this.y-40;//-this.patternHeight();// ;//- this.height*2;
  89.         this._auto_balloon_sprite.anchor.x = 0.5;
  90.     this._auto_balloon_sprite.anchor.y = 1;
  91.         //this.addChild(this._auto_balloon_sprite);
  92.     this.addChild(this._auto_balloon_sprite);
  93.         if (displayAutoBalloon){
  94.                 this._p_balloon_sprite = new Sprite();
  95.                 this._p_balloon_sprite.bitmap = ImageManager.loadSystem('Balloon_1');
  96.                 this._p_balloon_sprite.opacity = 0;
  97.                 this._p_balloon_sprite.z = 7;
  98.                 this.parent.addChild(this._p_balloon_sprite);//this.addChild(this._p_balloon_sprite);
  99.         }
  100. }       
  101.  
  102. Lmd.MrLiu_AutoBalloon.Sprite_Character_update = Sprite_Character.prototype.update;
  103. Sprite_Character.prototype.update = function() {
  104.         Lmd.MrLiu_AutoBalloon.Sprite_Character_update.call(this);
  105.         if ((this.character._auto_balloon == 0)  || ! (this._balloonDuration == 0 ) || ($gameMap._interpreter.isRunning()) || ($gameSwitches[212] == true)){
  106.       this.clear_auto_balloon();
  107.         }
  108.     else{
  109.       this.update_auto_balloon();
  110.         }
  111. }
  112.  
  113.  
  114. Sprite_Character.prototype.face_to_event = function() {
  115.     var data = new Array();
  116.     var w = 1;
  117.     var h = 1 * 2;
  118.         for (var i=0;i<(h+1);i++)
  119.         {
  120.                 for (var j=0;j<(h+1);j++)
  121.                         {
  122.                             data.push([(this.character.x-w)+i,(this.character.y-w)+j]);
  123.                         }
  124.         }
  125.          for(var i =0;i<data.length;i++) {
  126.      if((String(data[i])) == (String([$gamePlayer.x , $gamePlayer.y]))) {
  127.       return true;
  128.      }
  129.     }
  130.         return false;
  131. }
  132.  
  133.  
  134. Sprite_Character.prototype.distance_balloom_opacity = function() {
  135.    this._auto_balloon_sprite.opacity += 70;
  136.     if (displayAutoBalloon){
  137.       this._p_balloon_sprite.opacity += 70;
  138.         }
  139. }
  140.  
  141.  
  142. Sprite_Character.prototype.clear_auto_balloon = function() {
  143.         if (this._auto_balloon_sprite.opacity == 0){
  144.       this._dis_flag = 255;
  145.       return;
  146.         }
  147.     this._auto_balloon_sprite.opacity = this._dis_flag;
  148.     if (displayAutoBalloon){
  149.       this._p_balloon_sprite.opacity = this._dis_flag;
  150.         }
  151.     this._dis_flag -= 35;
  152. }
  153.  
  154.  
  155.  
  156. Sprite_Character.prototype.start_auto_balloon = function() {
  157.     this._flag = 1;
  158.     this._balloon_id = this.character._auto_balloon;
  159.     this._ry = (this.character._auto_balloon - 1) * 32;
  160. }
  161.  
  162. Sprite_Character.prototype.set_rect = function(index) {
  163.     this._auto_balloon_sprite.setFrame(32 * index, this._ry, 32, 32);
  164.     if (displayAutoBalloon){
  165.       this._p_balloon_sprite.setFrame(32 * index, this._ry, 32, 32);
  166.         }
  167. }
  168.  
  169.  
  170.  
  171. Sprite_Character.prototype.update_auto_balloon = function() {
  172.     if ((!this._auto_balloon_sprite) ||  (this._balloon_id != this._character._auto_balloon) || (this._flag == 0)){
  173.           this.start_auto_balloon();
  174.     }
  175.         //console.log(this.height);
  176.         //console.log(this.character.y);
  177.         //this._auto_balloon_sprite.y = this.character.y - this.height;
  178.         //console.log(this._auto_balloon_sprite.y);
  179.     if (displayAutoBalloon){
  180.                 this._p_balloon_sprite.x = $gamePlayer.x;
  181.         this._p_balloon_sprite.y = $gamePlayer.y;
  182.         }
  183.     if (this.face_to_event()){
  184.       this.distance_balloom_opacity();
  185.         }else{
  186.       this.clear_auto_balloon();
  187.         }
  188.     if (this._flag == 10){
  189.       this._flag = 0;
  190.           if(this._bx == 2){
  191.                   this._bx = 0;
  192.           }
  193.           else{
  194.                   this._bx++;
  195.           }
  196.         }
  197.     else{
  198.       this._flag++;
  199.         }
  200.         this.set_rect(this._bx);
  201. }

MrLiu_AutoBalloon.rar

1.93 KB, 下载次数: 1260

评分

参与人数 11星屑 +425 梦石 +2 +5 收起 理由
FriendsMind + 1 我好喜歡你做的插件!
plain666 + 1 塞糖
Kim_Shyuen + 1 精品文章
abr80210 + 1 我很赞同
simyaoyao + 1 塞糖
c248611 + 45 塞糖
夜$神 + 42 Mark,好插件
king + 96 塞糖
余烬之中 + 166 + 2 图书馆收录
rpg-sheep + 10 666

查看全部评分

本人三无老人,请大神轻拍

Lv1.梦旅人

梦石
0
星屑
50
在线时间
248 小时
注册时间
2010-8-22
帖子
127
2
发表于 2015-11-20 19:23:11 | 只看该作者
VA 版的 Balloon

Balloon_1.png (9.98 KB, 下载次数: 110)

Balloon_1.png
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

职业の水客

梦石
0
星屑
12955
在线时间
6992 小时
注册时间
2010-6-16
帖子
3475

开拓者

3
发表于 2015-11-20 19:41:19 | 只看该作者
真是不错的插件
一个看图的地方
群爆炸重建后状态:论坛老人最多(只剩下了活跃的老人),技术力很强(依旧不变)的编程灌水群:901540785
专门讨论RM相关的Q群:56875149
PS:第一个群不是专门讨论RM的,第二个才是哦。
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

百合控

梦石
0
星屑
6438
在线时间
1274 小时
注册时间
2013-8-21
帖子
3657

开拓者

4
发表于 2015-11-20 20:32:13 | 只看该作者
我看楼主很有前途
(其实并不需要我说= =
萌新瑟瑟发抖
看到我请叫我去干活
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3078
在线时间
764 小时
注册时间
2008-7-5
帖子
760
5
发表于 2015-11-21 10:12:38 | 只看该作者
支持云烟君!!
阿姨我还未填平坑.....
自己是“擅长美工的笨蛋策划在干着程序的活”
  
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3263
在线时间
3616 小时
注册时间
2006-9-6
帖子
37399

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

6
发表于 2015-11-21 10:37:07 | 只看该作者
很棒的插件,有些时候NPC很多,可以使其中重要的NPC凸现出来
回复 支持 反对

使用道具 举报

Lv2.观梦者

姬魂

梦石
0
星屑
423
在线时间
399 小时
注册时间
2009-8-30
帖子
612

开拓者

7
发表于 2015-11-21 12:49:04 | 只看该作者
好溜
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
64 小时
注册时间
2014-3-20
帖子
14
8
发表于 2015-11-23 06:18:40 | 只看该作者
这个效果做的很不错!32个赞
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
689
在线时间
2 小时
注册时间
2015-11-24
帖子
2
9
发表于 2015-11-24 22:07:27 | 只看该作者
请收下我的膝盖
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
1697
在线时间
16 小时
注册时间
2014-7-27
帖子
4
10
发表于 2015-11-26 13:24:51 | 只看该作者
感谢分享。感觉很棒。
W
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-25 00:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表