查看: 31355|回复: 34

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

[复制链接]
梦石
0
星屑
3682
在线时间
4468 小时
注册时间
2008-6-12
回帖
776
发表于 2015-11-20 18:02:02 | 显示全部楼层 |阅读模式

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

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

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

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

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


Enjoy it~~~
如果有问题,欢迎留言。
效果如下:
地图自动气泡.png

使用方法:
使用方法.png

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


  1. //=============================================================================
  2. // MrLiu_AutoBalloon.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 在RMMV游戏中地图界面的人物头顶自动显示气球
  6. * @author MrLiu-过眼云烟
  7. *
  8. * @help 事件页的说明下加入“autoballoon_11”,即显示第11行的表情,需将Balloon_1.png
  9. * 文件放在\img\system目录下,该文件默认大小为96*352,默认每格表情大小为32,每行3格
  10. * 后续版本将提供修改格式,显示速度等功能,敬请期待,如有问题欢迎给我留言。
  11. */
  12. //-----------------------------------------------------------------------------
  13. var Imported = Imported || {};
  14. Imported.MrLiu_AutoBalloon = true;

  15. var Lmd = Lmd || {};
  16. Lmd.MrLiu_AutoBalloon = Lmd.MrLiu_AutoBalloon || {};



  17.   var parameters = PluginManager.parameters('MrLiu_Shadow');
  18.   var displayAutoBalloon = String(parameters['displayAutoBalloon']);
  19.   var shadowOpacity = Number(parameters['shadowOpacity']);
  20.   displayAutoBalloon = false;
  21.   
  22. Lmd.MrLiu_AutoBalloon.Game_Character_initialize = Game_Character.prototype.initialize;
  23.   Game_Character.prototype.initialize = function() {
  24.     Lmd.MrLiu_AutoBalloon.Game_Character_initialize.call(this);
  25.     this._auto_balloon = 0;
  26. };

  27. Game_Character.prototype._auto_balloon = function() {
  28.         return this._auto_balloon;
  29. };

  30.   
  31. Lmd.MrLiu_AutoBalloon.Game_Event_refresh = Game_Event.prototype.refresh;
  32. Game_Event.prototype.refresh = function() {
  33.         Lmd.MrLiu_AutoBalloon.Game_Event_refresh.call(this);
  34.         if((this._erased == false)&&(this._trigger == 0)){
  35.         var list = this.list();
  36.         for(var i=0 ;i<list.length;i++){
  37.                 if (list[i].code == 108){
  38.                         var num =list[i].parameters[0].match(/autoballoon_(\d+)/g);
  39.                         if (num){
  40.                                 var num1 = Number((String(num)).match(/\d+(\.\d+)?/g));
  41.                                 this._auto_balloon = num1;
  42.                         }
  43.                 }
  44.         }
  45.         }
  46. };

  47. Game_Event.prototype.setupPage = function() {
  48.     if (this._pageIndex >= 0) {
  49.                 this._auto_balloon = 0;
  50.         this.setupPageSettings();
  51.     } else {
  52.                 this._auto_balloon = 0;
  53.         this.clearPageSettings();
  54.     }
  55.     this.refreshBushDepth();
  56.     this.clearStartingFlag();
  57.     this.checkEventTriggerAuto();
  58. };




  59.   
  60.   
  61. Lmd.MrLiu_AutoBalloon.Sprite_Character_initialize = Sprite_Character.prototype.initialize;
  62. Sprite_Character.prototype.initialize = function(character) {
  63.     Lmd.MrLiu_AutoBalloon.Sprite_Character_initialize.call(this,character);
  64.         this.createAutoBalloon();
  65.         this._dis_flag = 0;
  66.         this._flag = 0;
  67.         this._bx = 0
  68.         this.character = character;
  69. };
  70. Sprite_Character.prototype.createAutoBalloon = function() {
  71.     this._auto_balloon_sprite = new Sprite();
  72.     this._auto_balloon_sprite.bitmap = ImageManager.loadSystem('Balloon_1');
  73.         this._auto_balloon_sprite.opacity = 0;
  74.         this._auto_balloon_sprite.z = 7;
  75.         this._auto_balloon_sprite.x = this.x;
  76.     this._auto_balloon_sprite.y = this.y-40;//-this.patternHeight();// ;//- this.height*2;
  77.         this._auto_balloon_sprite.anchor.x = 0.5;
  78.     this._auto_balloon_sprite.anchor.y = 1;
  79.         //this.addChild(this._auto_balloon_sprite);
  80.     this.addChild(this._auto_balloon_sprite);
  81.         if (displayAutoBalloon){
  82.                 this._p_balloon_sprite = new Sprite();
  83.                 this._p_balloon_sprite.bitmap = ImageManager.loadSystem('Balloon_1');
  84.                 this._p_balloon_sprite.opacity = 0;
  85.                 this._p_balloon_sprite.z = 7;
  86.                 this.parent.addChild(this._p_balloon_sprite);//this.addChild(this._p_balloon_sprite);
  87.         }
  88. }       

  89. Lmd.MrLiu_AutoBalloon.Sprite_Character_update = Sprite_Character.prototype.update;
  90. Sprite_Character.prototype.update = function() {
  91.         Lmd.MrLiu_AutoBalloon.Sprite_Character_update.call(this);
  92.         if ((this.character._auto_balloon == 0)  || ! (this._balloonDuration == 0 ) || ($gameMap._interpreter.isRunning()) || ($gameSwitches[212] == true)){
  93.       this.clear_auto_balloon();
  94.         }
  95.     else{
  96.       this.update_auto_balloon();
  97.         }
  98. }


  99. Sprite_Character.prototype.face_to_event = function() {
  100.     var data = new Array();
  101.     var w = 1;
  102.     var h = 1 * 2;
  103.         for (var i=0;i<(h+1);i++)
  104.         {
  105.                 for (var j=0;j<(h+1);j++)
  106.                         {
  107.                             data.push([(this.character.x-w)+i,(this.character.y-w)+j]);
  108.                         }
  109.         }
  110.          for(var i =0;i<data.length;i++) {
  111.      if((String(data[i])) == (String([$gamePlayer.x , $gamePlayer.y]))) {
  112.       return true;
  113.      }
  114.     }
  115.         return false;
  116. }


  117. Sprite_Character.prototype.distance_balloom_opacity = function() {
  118.    this._auto_balloon_sprite.opacity += 70;
  119.     if (displayAutoBalloon){
  120.       this._p_balloon_sprite.opacity += 70;
  121.         }
  122. }


  123. Sprite_Character.prototype.clear_auto_balloon = function() {
  124.         if (this._auto_balloon_sprite.opacity == 0){
  125.       this._dis_flag = 255;
  126.       return;
  127.         }
  128.     this._auto_balloon_sprite.opacity = this._dis_flag;
  129.     if (displayAutoBalloon){
  130.       this._p_balloon_sprite.opacity = this._dis_flag;
  131.         }
  132.     this._dis_flag -= 35;
  133. }



  134. Sprite_Character.prototype.start_auto_balloon = function() {
  135.     this._flag = 1;
  136.     this._balloon_id = this.character._auto_balloon;
  137.     this._ry = (this.character._auto_balloon - 1) * 32;
  138. }

  139. Sprite_Character.prototype.set_rect = function(index) {
  140.     this._auto_balloon_sprite.setFrame(32 * index, this._ry, 32, 32);
  141.     if (displayAutoBalloon){
  142.       this._p_balloon_sprite.setFrame(32 * index, this._ry, 32, 32);
  143.         }
  144. }



  145. Sprite_Character.prototype.update_auto_balloon = function() {
  146.     if ((!this._auto_balloon_sprite) ||  (this._balloon_id != this._character._auto_balloon) || (this._flag == 0)){
  147.           this.start_auto_balloon();
  148.     }
  149.         //console.log(this.height);
  150.         //console.log(this.character.y);
  151.         //this._auto_balloon_sprite.y = this.character.y - this.height;
  152.         //console.log(this._auto_balloon_sprite.y);
  153.     if (displayAutoBalloon){
  154.                 this._p_balloon_sprite.x = $gamePlayer.x;
  155.         this._p_balloon_sprite.y = $gamePlayer.y;
  156.         }
  157.     if (this.face_to_event()){
  158.       this.distance_balloom_opacity();
  159.         }else{
  160.       this.clear_auto_balloon();
  161.         }
  162.     if (this._flag == 10){
  163.       this._flag = 0;
  164.           if(this._bx == 2){
  165.                   this._bx = 0;
  166.           }
  167.           else{
  168.                   this._bx++;
  169.           }
  170.         }
  171.     else{
  172.       this._flag++;
  173.         }
  174.         this.set_rect(this._bx);
  175. }
复制代码

MrLiu_AutoBalloon.rar

1.93 KB, 下载次数: 1292

评分

参与人数 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

查看全部评分

本人三无老人,请大神轻拍
梦石
0
星屑
50
在线时间
248 小时
注册时间
2010-8-22
回帖
105
发表于 2015-11-20 19:23:11 | 显示全部楼层
VA 版的 Balloon
Balloon_1.png
回复

使用道具 举报

职业の水客

梦石
2
星屑
17082
在线时间
7500 小时
注册时间
2010-6-16
回帖
3466

极短27评委MZ评测员极短26评委开拓者

发表于 2015-11-20 19:41:19 | 显示全部楼层
真是不错的插件
游戏开发工具集,一站式AI生图+图片完美像素化及相关处理网站。
群爆炸重建后状态:论坛老人最多(只剩下了活跃的老人),技术力很强(依旧不变)的编程灌水群:901540785
专门讨论RM相关的Q群:56875149
PS:第一个群不是专门讨论RM的,第二个才是哦。
PS2:接受MV/MZ插件定制(QQ763992443)
回复

使用道具 举报

百合控

梦石
0
星屑
6548
在线时间
1275 小时
注册时间
2013-8-21
回帖
3522

开拓者

发表于 2015-11-20 20:32:13 | 显示全部楼层
我看楼主很有前途
(其实并不需要我说= =
萌新瑟瑟发抖
看到我请叫我去干活
回复

使用道具 举报

梦石
0
星屑
3118
在线时间
766 小时
注册时间
2008-7-5
回帖
715
发表于 2015-11-21 10:12:38 | 显示全部楼层
支持云烟君!!
阿姨我还未填平坑.....
自己是“擅长美工的笨蛋策划在干着程序的活”
  
回复

使用道具 举报

名侦探小柯

梦石
10
星屑
4425
在线时间
3741 小时
注册时间
2006-9-6
回帖
36596

极短27获奖MZ评测员开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

发表于 2015-11-21 10:37:07 | 显示全部楼层
很棒的插件,有些时候NPC很多,可以使其中重要的NPC凸现出来
不定期回归 ~ 游戏开发之旅
———————————————————————————————
回复

使用道具 举报

姬魂

梦石
0
星屑
443
在线时间
400 小时
注册时间
2009-8-30
回帖
568

开拓者

发表于 2015-11-21 12:49:04 | 显示全部楼层
好溜
回复

使用道具 举报

梦石
0
星屑
50
在线时间
64 小时
注册时间
2014-3-20
回帖
12
发表于 2015-11-23 06:18:40 | 显示全部楼层
这个效果做的很不错!32个赞
回复

使用道具 举报

梦石
0
星屑
689
在线时间
2 小时
注册时间
2015-11-24
回帖
2
发表于 2015-11-24 22:07:27 | 显示全部楼层
请收下我的膝盖
回复

使用道具 举报

梦石
0
星屑
1697
在线时间
16 小时
注册时间
2014-7-27
回帖
4
发表于 2015-11-26 13:24:51 | 显示全部楼层
感谢分享。感觉很棒。
W
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部