查看: 9144|回复: 15

[有事请教] 求个技能动画可以从使用者身上飞到目标身上的插件

[复制链接]
梦石
0
星屑
1573
在线时间
374 小时
注册时间
2017-12-26
回帖
291
发表于 2018-4-22 16:31:06 | 显示全部楼层 |阅读模式
悬赏100星屑已解决
比如说 弓箭  子弹  炮弹 导弹 什么的 总不能一发射就命中了吧   起码有个飞行过程  希望大大们给个  最好有视频教程  或者文字也许

最佳答案

查看完整内容

Victor系列插件中有个Throwable Objects,实现的功能相对最完善,除了飞矢、子弹之类的飞行物体之外,还能做出回旋镖之类的效果。 但是这个作者的插件跟YEP中的ActSeqPack插件冲突,如果你的工程严重依赖YEP的动作指令序列的话,就没办法用这个了。 (实际上这个作者的插件中也有实现ActSeqPack类似功能的作品,只不过知名度不高用的人不多) 我用的是这个,实测兼容YEP。 [pre lang="javascript" file="MoveAnime2.js"]//======== ...
梦石
0
星屑
7427
在线时间
948 小时
注册时间
2017-9-27
回帖
566
发表于 2018-4-22 16:31:07 | 显示全部楼层
Victor系列插件中有个Throwable Objects,实现的功能相对最完善,除了飞矢、子弹之类的飞行物体之外,还能做出回旋镖之类的效果。
但是这个作者的插件跟YEP中的ActSeqPack插件冲突,如果你的工程严重依赖YEP的动作指令序列的话,就没办法用这个了。
(实际上这个作者的插件中也有实现ActSeqPack类似功能的作品,只不过知名度不高用的人不多)
我用的是这个,实测兼容YEP。
  1. //=============================================================================
  2. // MoveAnime2.js
  3. //=============================================================================
  4. //Copyright (c) 2016 Trb
  5. // This software is released under the MIT License.
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. //
  8. //twitter [url]https://twitter.com/Trb_surasura[/url]
  9. /*:
  10. * @plugindesc アニメーションを飛ばすプラグイン 2
  11. * @author Trb
  12. *
  13. * @version 1.0(2.0)  2016 4/22 重大更新,与以前版本相比已是不同的两个插件。
  14. *          1.1       2016 7/ 4 修复错误的动画起始位置(当动画显示位置为【目标头部】、【目标中心】时)。
  15. *
  16. *
  17. * @help 让动画从使用者飞向目标。
  18. * 设置方式有两种:在技能的备注区写NoteTag,或者使用脚本命令。
  19. *
  20. * ----设置方式1----
  21. * 在技能的备注区
  22. * <ani_move: a>
  23. * <ani_arc: b>
  24. * <ani_deflection: c>
  25. * <ani_repeat: d>
  26. * (a,b,c,d为任意数字)
  27. * ani_move指令是必需的,其余指令是可选的。
  28. *
  29. * <ani_move:a>
  30. *   飞行动画耗费的帧数。
  31. *   (例如要在10帧内完成飞行就写<ani_move:10>)
  32. *
  33. * <ani_arc:b>
  34. *   设置飞行轨迹弧线高度。
  35. *   (单位是像素,例如<ani_arc:1>表示弧线顶点高度是1像素)
  36. *
  37. * <ani_deflection:c>
  38. *   设置弧线轨迹的波动范围。
  39. *   (<ani_arc:50> <ani_deflection:100> 表示arc的实际取值范围是-50~150)
  40. *   一般用于多段攻击技能。
  41. *
  42. * <ani_repeat:d>
  43. *   设置重复播放动画的次数。
  44. *   これはYEP_BattleCoreを入れると連続攻撃時にアニメーションが1回しか表示されない問題に
  45. *   対応するために追加した機能であり、
  46. *   これ単体で使うと本来の再生回数*d回再生されるようになってしまうので注意して下さい。
  47. *
  48. *
  49. * ----设置方法2----
  50. * 脚本命令:setParams(动画ID,ani_move值,ani_arc值,ani_deflection值)
  51. *
  52. * 例如想要ID为5的动画飞行10帧
  53. *                 setParams(5,10)
  54. *  (ani_arc值、ani_deflection值若省略,则表示其与备注内容相同)
  55. *
  56. * 一经设定,数值可长久保存,除非被新值覆盖。
  57. * 可以在事件中集中设置。
  58. * 设置的数值不会保存到存档文件中。
  59. *
  60. *
  61. * ==============================================================
  62. *
  63. * ----其他功能----
  64. *
  65. * setStartPosition(动画ID,x,y)
  66. *   可以设置动画的起始位置不是技能的使用者,而是在指定的坐标位置。
  67. *
  68. *   例如想要ID为10的动画从坐标(100,200)开始飞行
  69. *       setStartPosition(10,100,200)
  70. *
  71. *
  72. * clearParams(动画ID)
  73. *   重置指定动画的所有设置。
  74. *
  75. *
  76. * @param use_field
  77. * @desc 在非战斗时也可以飞行?
  78. * 不可以・・・false  可以・・・true
  79. * @default false
  80. *
  81. * @param variable
  82. * @desc 存储setParams参数的变量ID。
  83. * 0表示不存储。
  84. * @default 0
  85. *
  86. *
  87. */
  88. (function() {

  89.     var parameters = PluginManager.parameters('MoveAnime2');
  90.     var UseField = String(parameters['use_field']);
  91.     var Variable = parameters['variable'];

  92.     var params = [];
  93.     var subjectX = 0; //使用者的坐标
  94.     var subjectY = 0;
  95.     //params的内容
  96.     var moveDuration = 0,
  97.         arcRate = 1,
  98.         deflection = 2,
  99.         repeats = 3,
  100.         startX = 4,
  101.         startY = 5;

  102.     //带入设定值
  103.     setParams = function(id, move, arc, def, rep) {
  104.         id = Math.max(id, 0);
  105.         if (!params[id]) params[id] = [];
  106.         params[id][moveDuration] = move || 0;
  107.         params[id][arcRate] = arc || 0;
  108.         params[id][deflection] = def || 0;
  109.         params[id][repeats] = rep || 0;
  110.     };

  111.     setStartPosition = function(id, a, b) {
  112.         if (!params[id]) params[id] = [];
  113.         params[id][startX] = a;
  114.         params[id][startY] = b;
  115.     };

  116.     clearParams = function(id) {
  117.         params[id] = [];
  118.     };



  119.     var SBu = Sprite_Battler.prototype.update;
  120.     Sprite_Battler.prototype.update = function() {
  121.         SBu.call(this);
  122.         //获取当前行动角色的坐标
  123.         if (this._battler != null && this._battler.isActing()) {
  124.             if (!$gameSystem.isSideView() && this._actor) {
  125.                 //前视图
  126.                 subjectX = Graphics.boxWidth / 2;
  127.                 subjectY = Graphics.boxHeight * 0.8;
  128.             } else {
  129.                 subjectX = this.x;
  130.                 subjectY = this.y;
  131.             }
  132.         }

  133.     };

  134.     var WBsa = Window_BattleLog.prototype.startAction;
  135.     Window_BattleLog.prototype.startAction = function(subject, action, targets) {
  136.         var item = action.item();
  137.         if (Number(item.meta.ani_move) > 0) { //指定在技能备注区设置的move值
  138.             setParams(item.animationId, Number(item.meta.ani_move), Number(item.meta.ani_arc) || 0,
  139.                 Number(item.meta.ani_deflection) || 0, Number(item.meta.ani_repeat) || 0);
  140.         }
  141.         WBsa.call(this, subject, action, targets);
  142.     };


  143.     Window_BattleLog.prototype.showNormalAnimation = function(targets, animationId, mirror) {
  144.         var animation = $dataAnimations[animationId];
  145.         if (animation) {
  146.             var delay = this.animationBaseDelay();
  147.             var nextDelay = this.animationNextDelay();
  148.             targets.forEach(function(target) {
  149.                 target.startAnimation(animationId, mirror, delay);
  150.                 delay += nextDelay;
  151.                 var repeat = params[animationId] ? params[animationId][repeats] : 0;
  152.                 while (repeat > 0) { //追加动画重复次数
  153.                     target.startAnimation(animationId, mirror, delay);
  154.                     delay += nextDelay;
  155.                     repeat -= 1;
  156.                 }
  157.             });
  158.         }
  159.     };


  160.     var SAim = Sprite_Animation.prototype.initMembers;
  161.     Sprite_Animation.prototype.initMembers = function() {
  162.         SAim.call(this);
  163.         this._x2 = 0;
  164.         this._y2 = 0;
  165.         this._duration2 = 0;
  166.         this._arcRate = 0;
  167.         this._arc = 0;
  168.     };

  169.     //指定已设置的动画参数
  170.     var SAs = Sprite_Animation.prototype.setup;
  171.     Sprite_Animation.prototype.setup = function(target, animation, mirror, delay) {
  172.         if (params[animation.id]) {
  173.             var prm = params[animation.id];
  174.             if (prm[startX]) { //若startX已设置,则使用它的值
  175.                 var sx = mirror ? Graphics.boxWidth - prm[startX] : prm[startX];
  176.             } else { //否则使用技能使用者的坐标
  177.                 sx = $gameParty.inBattle() ? subjectX : $gamePlayer.screenX();
  178.             }
  179.             if (prm[startY]) {
  180.                 var sy = prm[startY];
  181.             } else {
  182.                 sy = $gameParty.inBattle() ? subjectY : $gamePlayer.screenY();
  183.             }

  184.             if ($gameParty.inBattle()) { //战斗时
  185.                 var t = target._battler ? target : target.parent;
  186.                 var pos = animation.position; //修正坐标为动画坐标(ver.1.1修正箇所)
  187.                 this._x2 = sx - t.x;
  188.                 this._y2 = sy - t.y - t.height * (pos - 2) / 2; //

  189.             } else if (UseField == 'true') { //非战斗时
  190.                 this._x2 = sx - target.x;
  191.                 this._y2 = sy - target.y;

  192.             }
  193.             this._duration2 = prm[moveDuration];
  194.             this._arc = this._duration2;
  195.             this._arcRate = prm[arcRate] + (Math.random() - 0.5) * prm[deflection] * 2;

  196.         }
  197.         SAs.call(this, target, animation, mirror, delay);
  198.     };

  199.     //坐标更新
  200.     var SAup = Sprite_Animation.prototype.updatePosition;
  201.     Sprite_Animation.prototype.updatePosition = function() {
  202.         SAup.call(this);
  203.         //计算更新值
  204.         if (this._duration2 > 0) {
  205.             this._x2 -= this._x2 / this._duration2;
  206.             this._y2 -= this._y2 / this._duration2;
  207.             this.x += this._x2;
  208.             this.y += this._y2 - Math.sin(this._duration2 / this._arc * Math.PI) * this._arcRate;
  209.             this._duration2 -= 1;
  210.         }
  211.     };


  212.     //存档时保存设置
  213.     var SSof = Scene_Save.prototype.onSavefileOk;
  214.     Scene_Save.prototype.onSavefileOk = function() {
  215.         if (Variable > 0) {
  216.             $gameVariables._data[Variable] = params.clone();
  217.         }
  218.         SSof.call(this);
  219.     };

  220.     //读档时读取设置
  221.     var SLol = Scene_Load.prototype.onLoadSuccess;
  222.     Scene_Load.prototype.onLoadSuccess = function() {
  223.         if (Variable > 0) {
  224.             try {
  225.                 params = $gameVariables._data[Variable].clone();
  226.             } catch (e) {}
  227.         }
  228.         SLol.call(this);
  229.     };


  230. })();
复制代码

点评

这个非常好用谢谢!  发表于 2018-4-23 23:14
回复

使用道具 举报

梦石
0
星屑
1573
在线时间
374 小时
注册时间
2017-12-26
回帖
291
 楼主| 发表于 2018-4-22 20:18:55 | 显示全部楼层
找到了一个  等下试试看
回复

使用道具 举报

梦石
0
星屑
1228
在线时间
132 小时
注册时间
2018-4-3
回帖
3
发表于 2018-4-22 20:28:39 | 显示全部楼层
我都在找     可以話我知是什麼插件
回复

使用道具 举报

梦石
0
星屑
1573
在线时间
374 小时
注册时间
2017-12-26
回帖
291
 楼主| 发表于 2018-4-22 21:56:21 | 显示全部楼层

点评

可以用的 只是好麻烦 要调整很多次  发表于 2018-4-22 23:16
我用了很多yep和mog的插件,老早那个大佬放出来插件的时候,我怎么实验都不成功,但新工程没问题  发表于 2018-4-22 22:42
回复

使用道具 举报

梦石
0
星屑
15309
在线时间
720 小时
注册时间
2011-7-16
回帖
1373

开拓者

发表于 2018-4-24 23:20:25 | 显示全部楼层
非常好的插件,学习学习
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复

使用道具 举报

梦石
0
星屑
1573
在线时间
374 小时
注册时间
2017-12-26
回帖
291
 楼主| 发表于 2018-4-25 23:07:55 | 显示全部楼层
梦想家大魔王 发表于 2018-4-22 16:31
Victor系列插件中有个Throwable Objects,实现的功能相对最完善,除了飞矢、子弹之类的飞行物体之外,还能 ...

请问大佬回旋镖的效果怎么做   ?
回复

使用道具 举报

梦石
0
星屑
16296
在线时间
4017 小时
注册时间
2015-9-14
回帖
1322

开拓者

发表于 2018-4-26 01:48:15 | 显示全部楼层
https://rpg.blue/data/attachment/album/202003/28/021323lltgrsvfytfwuya5.gif
回复

使用道具 举报

梦石
0
星屑
1573
在线时间
374 小时
注册时间
2017-12-26
回帖
291
 楼主| 发表于 2018-4-26 07:51:21 | 显示全部楼层
wabcmcc 发表于 2018-4-26 01:48
MOG ( Chrono Engine)有斉你要求.
網址:https://atelierrgss.wordpress.com/rmv-chrono-engine/
YouTube 視 ...

我好像进不去视频的网站  这个插件可以在回合战斗中使用么
回复

使用道具 举报

梦石
0
星屑
7427
在线时间
948 小时
注册时间
2017-9-27
回帖
566
发表于 2018-4-27 17:43:10 | 显示全部楼层
qq1065526265 发表于 2018-4-25 23:07
请问大佬回旋镖的效果怎么做   ?

我记得是插件有参数,决定是不是能飞回来。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部