查看: 9021|回复: 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。
[pre lang="javascript" file="MoveAnime2.js"]//=============================================================================
// MoveAnime2.js
//=============================================================================
//Copyright (c) 2016 Trb
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
//twitter https://twitter.com/Trb_surasura
/*:
* @plugindesc アニメーションを飛ばすプラグイン 2
* @author Trb
*
* @version 1.0(2.0)  2016 4/22 重大更新,与以前版本相比已是不同的两个插件。
*          1.1       2016 7/ 4 修复错误的动画起始位置(当动画显示位置为【目标头部】、【目标中心】时)。
*
*
* @help 让动画从使用者飞向目标。
* 设置方式有两种:在技能的备注区写NoteTag,或者使用脚本命令。
*
* ----设置方式1----
* 在技能的备注区
* <ani_move: a>
* <ani_arc: b>
* <ani_deflection: c>
* <ani_repeat: d>
* (a,b,c,d为任意数字)
* ani_move指令是必需的,其余指令是可选的。
*
* <ani_move:a>
*   飞行动画耗费的帧数。
*   (例如要在10帧内完成飞行就写<ani_move:10>)
*
* <ani_arc:b>
*   设置飞行轨迹弧线高度。
*   (单位是像素,例如<ani_arc:1>表示弧线顶点高度是1像素)
*
* <ani_deflection:c>
*   设置弧线轨迹的波动范围。
*   (<ani_arc:50> <ani_deflection:100> 表示arc的实际取值范围是-50~150)
*   一般用于多段攻击技能。
*
* <ani_repeat:d>
*   设置重复播放动画的次数。
*   これはYEP_BattleCoreを入れると連続攻撃時にアニメーションが1回しか表示されない問題に
*   対応するために追加した機能であり、
*   これ単体で使うと本来の再生回数*d回再生されるようになってしまうので注意して下さい。
*
*
* ----设置方法2----
* 脚本命令:setParams(动画ID,ani_move值,ani_arc值,ani_deflection值)
*
* 例如想要ID为5的动画飞行10帧
*                 setParams(5,10)
*  (ani_arc值、ani_deflection值若省略,则表示其与备注内容相同)
*
* 一经设定,数值可长久保存,除非被新值覆盖。
* 可以在事件中集中设置。
* 设置的数值不会保存到存档文件中。
*
*
* ==============================================================
*
* ----其他功能----
*
* setStartPosition(动画ID,x,y)
*   可以设置动画的起始位置不是技能的使用者,而是在指定的坐标位置。
*
*   例如想要ID为10的动画从坐标(100,200)开始飞行
*       setStartPosition(10,100,200)
*
*
* clearParams(动画ID)
*   重置指定动画的所有设置。
*
*
* @param use_field
* @desc 在非战斗时也可以飞行?
* 不可以・・・false  可以・・・true
* @default false
*
* @param variable
* @desc 存储setParams参数的变量ID。
* 0表示不存储。
* @default 0
*
*
*/
(function() {

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

    var params = [];
    var subjectX = 0; //使用者的坐标
    var subjectY = 0;
    //params的内容
    var moveDuration = 0,
        arcRate = 1,
        deflection = 2,
        repeats = 3,
        startX = 4,
        startY = 5;

    //带入设定值
    setParams = function(id, move, arc, def, rep) {
        id = Math.max(id, 0);
        if (!params[id]) params[id] = [];
        params[id][moveDuration] = move || 0;
        params[id][arcRate] = arc || 0;
        params[id][deflection] = def || 0;
        params[id][repeats] = rep || 0;
    };

    setStartPosition = function(id, a, b) {
        if (!params[id]) params[id] = [];
        params[id][startX] = a;
        params[id][startY] = b;
    };

    clearParams = function(id) {
        params[id] = [];
    };



    var SBu = Sprite_Battler.prototype.update;
    Sprite_Battler.prototype.update = function() {
        SBu.call(this);
        //获取当前行动角色的坐标
        if (this._battler != null && this._battler.isActing()) {
            if (!$gameSystem.isSideView() && this._actor) {
                //前视图
                subjectX = Graphics.boxWidth / 2;
                subjectY = Graphics.boxHeight * 0.8;
            } else {
                subjectX = this.x;
                subjectY = this.y;
            }
        }

    };

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


    Window_BattleLog.prototype.showNormalAnimation = function(targets, animationId, mirror) {
        var animation = $dataAnimations[animationId];
        if (animation) {
            var delay = this.animationBaseDelay();
            var nextDelay = this.animationNextDelay();
            targets.forEach(function(target) {
                target.startAnimation(animationId, mirror, delay);
                delay += nextDelay;
                var repeat = params[animationId] ? params[animationId][repeats] : 0;
                while (repeat > 0) { //追加动画重复次数
                    target.startAnimation(animationId, mirror, delay);
                    delay += nextDelay;
                    repeat -= 1;
                }
            });
        }
    };


    var SAim = Sprite_Animation.prototype.initMembers;
    Sprite_Animation.prototype.initMembers = function() {
        SAim.call(this);
        this._x2 = 0;
        this._y2 = 0;
        this._duration2 = 0;
        this._arcRate = 0;
        this._arc = 0;
    };

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

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

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

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

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

    //坐标更新
    var SAup = Sprite_Animation.prototype.updatePosition;
    Sprite_Animation.prototype.updatePosition = function() {
        SAup.call(this);
        //计算更新值
        if (this._duration2 > 0) {
            this._x2 -= this._x2 / this._duration2;
            this._y2 -= this._y2 / this._duration2;
            this.x += this._x2;
            this.y += this._y2 - Math.sin(this._duration2 / this._arc * Math.PI) * this._arcRate;
            this._duration2 -= 1;
        }
    };


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

    //读档时读取设置
    var SLol = Scene_Load.prototype.onLoadSuccess;
    Scene_Load.prototype.onLoadSuccess = function() {
        if (Variable > 0) {
            try {
                params = $gameVariables._data[Variable].clone();
            } catch (e) {}
        }
        SLol.call(this);
    };


})();[/pre]

点评

这个非常好用谢谢!  发表于 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
星屑
15294
在线时间
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
星屑
16261
在线时间
4014 小时
注册时间
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.

在本版发帖返回顶部