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

Project1

 找回密码
 注册会员
搜索
查看: 5007|回复: 5

[搬运汉化] 事件名称--NPC名字显示(搬运修改)插件

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3015
在线时间
333 小时
注册时间
2018-3-28
帖子
199
发表于 2018-11-30 10:23:24 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 wr282828 于 2018-11-30 10:25 编辑

事件名称--NPC名字显示插件
前几天在论坛搜索的一个这样的插件 原本是打算用yep的,但是最终显示出来的文字效果有点不理想
后面找到了这个简短的插件 感觉很不错 就决定使用这个了 为了实现一些自己想要的效果 稍微地修改了些 搬运上来

1、新增了字体颜色的自定义设置
2、优化了文字与事件同步显示

脚本初学菜鸟 若有哪里不对的 还请各位大佬们指正

JAVASCRIPT 代码复制下载
  1. /*:
  2.  * @plugindesc Namepop Ver 1.03 NPC名称显示
  3.  * @author Morpho(dongdongDJH)
  4.  *
  5.  * @help
  6.  * 在地图事件注释栏内填入 NAMEPOP|高度修正值|字体Size|字体颜色;
  7.  * 高度修正值单位为1格,不填默认为1,字体大小不填默认为18;
  8.  * 例:NAMEPOP|1|18|#00FF00 ; NAMEPOP||20 ;
  9.  * 注:一定要用‘|’分隔高度修正值和字体Size;
  10.  * 若要调整描边 请直接在下方代码中调整 (ps:0.8是颜色的透明度,0-1)
  11.  */
  12. (function() {
  13.         _Sprite_Character_prototype_initialize = Sprite_Character.prototype.initialize;
  14.         Sprite_Character.prototype.initialize = function(character) {
  15.                 _Sprite_Character_prototype_initialize.call(this, character);
  16.                 this._tempCharacter = character;
  17.                 if (character instanceof Game_Event) {
  18.                         if (character.event().note.match("NAMEPOP") != null) {
  19.                                 var notetext = character.event().note.split("|");
  20.                                 this._namepopY = Number(notetext[1]) || 1;
  21.                                 this._fontSize = Number(notetext[2]) || 18;
  22.                                 this._BYcolor  =  notetext[3] || "#FFFFFF";
  23.                                 this.createNamepopSet();
  24.                         }
  25.                 }
  26.         };
  27.  
  28.         Sprite_Character.prototype.createNamepopSet = function() {
  29.                 var h = this._fontSize;
  30.                 this._namepopSprite = new Sprite();
  31.                 this._namepopSprite.bitmap = new Bitmap(h * 10, h);
  32.                 this._namepopSprite.bitmap.fontSize = h;
  33.                 this._namepopSprite.bitmap.outlineColor = "rgba(0, 0, 0, 0.8)"//描边颜色
  34.                 this._namepopSprite.bitmap.outlineWidth = 4;//字体描边
  35.                 this._namepopSprite.bitmap.textColor = this._BYcolor;//字体颜色
  36.                 this._namepopSprite.bitmap.drawText(this._tempCharacter.event().name, 0, 0, h * 10, h, 'center');
  37.                 this._namepopSprite.anchor.x = 0.5;
  38.                 this._namepopSprite.anchor.y = 1;
  39.                 this._namepopSprite.y = this.y - this._namepopY * 48;
  40.                 this.addChild(this._namepopSprite);
  41.         };
  42.  
  43. // ---- 新增跟随事件显示 ----
  44.         _Sprite_Character_prototype_setCharacterBitmap = Sprite_Character.prototype.setCharacterBitmap;
  45.         Sprite_Character.prototype.setCharacterBitmap = function() {
  46.                 _Sprite_Character_prototype_setCharacterBitmap.call(this);
  47.         if (this._tempCharacter instanceof Game_Event) {
  48.                         this._BYconditions = this._tempCharacter.findProperPageIndex();
  49.                         if(this._BYconditions >= 0 &&  this._namepopSprite){
  50.                                 this._namepopSprite.visible = true;
  51.                         }else if(this._namepopSprite){
  52.                                 this._namepopSprite.visible = false;
  53.                         }
  54.  
  55.                 }
  56.         };
  57.  
  58. }());


Namepop.zip (1.18 KB, 下载次数: 337)
用mv做了两款游戏,有兴趣的可以瞧一瞧:
《有毛病》--- 休闲、探索、策略、剧情、恐怖 都有那么一些,就是没有战斗。挺骚挺有意思的一个游戏。
steam链接:点击这里


《留离》--- 探索、高自由度、ARPG、战斗,就是没有啥剧情。
steam链接:点击这里

Lv4.逐梦者

梦石
0
星屑
5136
在线时间
603 小时
注册时间
2017-10-21
帖子
348
发表于 2018-11-30 18:12:26 | 显示全部楼层
支持下大佬~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
209
在线时间
51 小时
注册时间
2019-1-10
帖子
16
发表于 2019-1-13 07:55:44 | 显示全部楼层
本帖最后由 sandas 于 2019-1-13 07:58 编辑

按自己的需求改了一下,这个事件名称显示好省代码~

JAVASCRIPT 代码复制下载
  1. /*:
  2.  * @plugindesc Namepop Ver 1.03 NPC名称显示
  3.  * @author Morpho(dongdongDJH)
  4.  *
  5.  * @help
  6.  * 在地图事件注释栏内填入 NPOP|显示文字|字体颜色|高度修正值|字体Size;
  7.  * 高度修正值单位为1格,不填默认为1,字体大小不填默认为18,颜色默认;显示文字默认显示名称
  8.  * 例:NPOP|显示文字|#00FF00 ; NPOP|显示文字; NPOP||#FF6600。(ps:只在注释内写NPOP则可显示名称)
  9.  * 注:一定要用‘|’分隔高度修正值和字体Size;
  10.  * 若要调整描边 请直接在下方代码中调整 (ps:0.8是颜色的透明度,0-1)
  11.  */
  12. (function() {
  13.         _Sprite_Character_prototype_initialize = Sprite_Character.prototype.initialize;
  14.         Sprite_Character.prototype.initialize = function(character) {
  15.                 _Sprite_Character_prototype_initialize.call(this, character);
  16.                 this._tempCharacter = character;
  17.                 if (character instanceof Game_Event) {
  18.                         if (character.event().note.match("NPOP") != null) {
  19.                                 var notetext = character.event().note.split("|");
  20.                                 this._namepopn = notetext[1] || this._tempCharacter.event().name;
  21.                                 this._BYcolor  =  notetext[2] || "#FFFFFF";
  22.                                 this._namepopY = Number(notetext[3]) || 1;
  23.                                 this._fontSize = Number(notetext[4]) || 18;
  24.                                 this.createNamepopSet();
  25.                         }
  26.                 }
  27.         };
  28.  
  29.         Sprite_Character.prototype.createNamepopSet = function() {
  30.                 var name = this._namepopn;
  31.                                 var h = this._fontSize;
  32.                 this._namepopSprite = new Sprite();
  33.                 this._namepopSprite.bitmap = new Bitmap(h * 10, h);
  34.                 this._namepopSprite.bitmap.fontSize = h;
  35.                 this._namepopSprite.bitmap.outlineColor = "rgba(0, 0, 0, 0.8)"//描边颜色
  36.                 this._namepopSprite.bitmap.outlineWidth = 4;//字体描边
  37.                 this._namepopSprite.bitmap.textColor = this._BYcolor;//字体颜色
  38.                 this._namepopSprite.bitmap.drawText(name, 0, 0, h * 10, h, 'center');
  39.                 this._namepopSprite.anchor.x = 0.5;
  40.                 this._namepopSprite.anchor.y = 1;
  41.                 this._namepopSprite.y = this.y - this._namepopY * 48;
  42.                 this.addChild(this._namepopSprite);
  43.         };
  44.  
  45. // ---- 新增跟随事件显示 ----
  46.         _Sprite_Character_prototype_setCharacterBitmap = Sprite_Character.prototype.setCharacterBitmap;
  47.         Sprite_Character.prototype.setCharacterBitmap = function() {
  48.                 _Sprite_Character_prototype_setCharacterBitmap.call(this);
  49.         if (this._tempCharacter instanceof Game_Event) {
  50.                         this._BYconditions = this._tempCharacter.findProperPageIndex();
  51.                         if(this._BYconditions >= 0 &&  this._namepopSprite){
  52.                                 this._namepopSprite.visible = true;
  53.                         }else if(this._namepopSprite){
  54.                                 this._namepopSprite.visible = false;
  55.                         }
  56.  
  57.                 }
  58.         };
  59.  
  60. }());

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
535
在线时间
59 小时
注册时间
2019-1-14
帖子
43
发表于 2019-1-21 04:40:47 | 显示全部楼层
楼主,你这个有BUG,显示名字后居然会被树等装饰物挡住……
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1340
在线时间
157 小时
注册时间
2019-9-14
帖子
59
发表于 2021-3-15 22:47:26 | 显示全部楼层
楼主 可以增加显示变量值的功能吗?mv的名称显示插件好像都不支持显示变量
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3015
在线时间
333 小时
注册时间
2018-3-28
帖子
199
 楼主| 发表于 2021-3-16 14:37:32 | 显示全部楼层
Eevee伊布 发表于 2021-3-15 22:47
楼主 可以增加显示变量值的功能吗?mv的名称显示插件好像都不支持显示变量 ...

不知道为啥不能编辑自己发的这个帖子了,新增了显示变量的功能,如果要刷新名称的话 理论上切换地图场景都是可以更新显示的。

Namepop.rar (1.26 KB, 下载次数: 150)
用mv做了两款游戏,有兴趣的可以瞧一瞧:
《有毛病》--- 休闲、探索、策略、剧情、恐怖 都有那么一些,就是没有战斗。挺骚挺有意思的一个游戏。
steam链接:点击这里


《留离》--- 探索、高自由度、ARPG、战斗,就是没有啥剧情。
steam链接:点击这里
回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 08:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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