Victor Sant's Throwable Objects plugin is great for improving battle animations with projectiles. However it is not compatible with Yanfly's Battle Core.
Michael Caiola did a
good patch for allowing the use of both plug-ins together. However, due to the implementation of jumping back to the original battle code when you want to use a throwable object, there were a few limitations:
- You cannot use action sequences with any skills that use throwable objects.
- You cannot use throwable objects with any skills used by enemies.
- Skills with throwable objects will no longer have cast animations.
What I've done is a different patch to bring throwable objects fully into action sequences. Put this plugin under YEP_BattleEngineCore, and you will be able to use two new commands in action sequences: THROW and WAIT FOR THROW.
To use, you set up a throw object according to the methods in VE_ThrowableObjects. Then you use the Throw command in an action sequence, giving it the target(s) to be hit by the object and the throwable object "type". The type can be any string, so long as you use the same type when setting up the throw object and the throw action sequence (originally the options were "before", "during", and "after", but we are using yanfly's action timings now). As in Victor's original throwable objects plugin, the origin of the projectile will be the user of the skill and the endpoint(s) will be the target(s), and you can reverse this by putting return in the throw object notetags.
Example skill notetags:
<throw object: before>
image: icon 2
</throw object>
<target action>
perform action
wait 5
throw: targets, before
wait for throw
action animation
wait for animation
action effect
</target action>
You will need the following plugins; I have them in this order (I put the VE plugins above BattleEngineCore so that BattleEngineCore can overwrite battle functions as it needs):
VE_BasicModule
VE_ThrowableObjects
YEP_BattleEngineCore
YEP_X_ActSeqPack1 (probably optional)
YEP_X_ActSeqPack2 (probably optional)
YEP_X_ActSeqPack3 (probably optional)
VE_Throwable_BECPatch (my new plugin)
I have not tested throwing animations, for which you would need the plugin VE - Looping Animation.
Script
Spoiler Code:
- var VETBEC_BattleManager_processActionSequence = BattleManager.processActionSequence;
- BattleManager.processActionSequence = function(actionName, actionArgs) {
- // THROW - syntax in action sequence is throw: target, type. E.g. throw: targets, before
- if (actionName === 'THROW') {
- return this.actionThrow(actionArgs);
- }
- // WAIT FOR THROW - syntax in action sequence is wait for throw
- if (actionName === 'WAIT FOR THROW') {
- return this.actionWaitForThrow();
- }
- return VETBEC_BattleManager_processActionSequence.call(this,
- actionName, actionArgs);
- };
- BattleManager.actionThrow = function(actionArgs) {
- if (!$gameSystem.isSideView()) return true;
-
- var targets = this.makeActionTargets(actionArgs[0]);
- //Call the startThrow function in VE_ThrowableObjects
- targets.forEach(function(target) {
- BattleManager._logWindow.startThrow(BattleManager._subject, BattleManager._action, target, actionArgs[1]);
- });
-
- return true;
- };
- BattleManager.actionWaitForThrow = function() {
- this._logWindow.waitForThrowFinish();
- return false;
- };
- Spriteset_Battle.prototype.isAnyoneThrowing = function() {
- //check every throwableobject for every battler, and see if it has duration > 0 or delay > 0
- return this.battlerSprites().some(function(sprite) {
- return sprite._throwableObjects.some(function(throwsprite) {
- return throwsprite.isPlaying();
- });
- });
- };
- var VETBEC_Window_BattleLog_updateWaitMode = Window_BattleLog.prototype.updateWaitMode;
- Window_BattleLog.prototype.updateWaitMode = function() {
- if (this._waitMode === 'throw') {
- if (this._spriteset.isAnyoneThrowing()) return true;
- }
- return VETBEC_Window_BattleLog_updateWaitMode.call(this);
- };
- //This function name used to avoid clashing with waitForThrow in VE_ThrowableObjects
- Window_BattleLog.prototype.waitForThrowFinish = function() {
- this.setWaitMode('throw');
- };
复制代码
Edit: Forgot to say that this is free for use in any project.
本贴来自国际rpgmaker官方论坛作者:BrianKB处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/ve-throwable-objects-in-yep-battle-core-engine-sequences-patch.116466/