VE Throwable Objects in YEP Battle Core Engine Sequences Patch

BrianKB

Villager
Member
Joined
Nov 30, 2019
Messages
5
Reaction score
10
First Language
English
Primarily Uses
RMMV
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

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.
 

Attachments

Last edited:

BlueBomber000

Villager
Member
Joined
Dec 23, 2018
Messages
29
Reaction score
14
First Language
English
Primarily Uses
RMMV
Cool! I plan to add this to my project as I've been needing exactly this sort of patch. I'll let you know how it works out.

Quick question: how would I make this specific to a weapon as opposed to an attack animation? Like for instance, I want to use the THROW command if the user has a "Boomerang" equipped, but not when they have a "Rifle" equipped, though I have them both listed as using the "missile" attack animation.
 

BrianKB

Villager
Member
Joined
Nov 30, 2019
Messages
5
Reaction score
10
First Language
English
Primarily Uses
RMMV
Basically you can do it like described in the VE Throwable Objects documentation.

In the weapon notetags for any weapon you want to have a projectile, define the throw image like this:

<throw image: picture 'Arrow'>

In this case, you would need a picture in your img/pictures folder named Arrow.png. You could alternatively do icon X where X is the icon id.

Then in your basic attack skill, put something like this in the notetags. This tells the skill to define a throw object based on the weapon being held by the actor.

<throw object: before>
image: weapon
</throw object>

Then in the basic attack skill notetags, in the appropriate place in the action sequence, enter these lines:

throw: targets, before
wait for throw

If the held weapon doesn't have a defined throw image, it should ignore the throw animation, so you can define it for your boomerang and not for your rifle and it should work as desired.
 

HalcyonDaze

Smoke and Mirrors
Veteran
Joined
Feb 6, 2013
Messages
266
Reaction score
122
First Language
English
Primarily Uses
RMMV
I remember having this in a project years ago, and being bummed about having to take it out because 1.3.1 broke it. Thanks for making this! Any chance of a simple demo?
 

BrianKB

Villager
Member
Joined
Nov 30, 2019
Messages
5
Reaction score
10
First Language
English
Primarily Uses
RMMV
I'm not really sure how to go about making a demo. If you look at the original VictorSant video for Throwable Objects it should show you most of how to go about using the plugin, and all the features for customizing your projectiles.

The example notetags from my first post are probably the simplest possible starting point - they define the image for a throwable object and leave everything else as defaults, and then show an example action sequence that inserts the new throw actions. If you've installed the required plugins, you should be able to put this in the notetags of a skill and try it out (it will just fling the icon in the 2nd slot).

<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>

Here is a slightly fancier one I made, that demonstrates what's opened up by having throwable objects and battles sequences working together. This skill throws five things in rapid succession, with damage and animation for each one. First it defines the 5 throw objects distinctly, so they can each go to a different end location relative the center of the target, for a slight spread in the projectiles. The duration is changed from the default so it will be a quick flight time, and the image will also spin as it flies. Notice that the throw objects can be given any name desired.

<throw object: spark1>
image: picture 'Spark Volley'
duration: 8
spin: 45
</throw object>
<throw object: spark2>
image: picture 'Spark Volley'
duration: 8
spin: 45
end: 40 40
</throw object>
<throw object: spark3>
image: picture 'Spark Volley'
duration: 8
spin: 45
end: -40 -40
</throw object>
<throw object: spark4>
image: picture 'Spark Volley'
duration: 8
spin: 45
end: 40 -40
</throw object>
<throw object: spark5>
image: picture 'Spark Volley'
duration: 8
spin: 45
end: -40 40
</throw object>

<target action>
perform action
wait 5
throw: targets, spark1
wait for throw
action animation
action effect
throw: targets, spark2
wait for throw
action animation
action effect
throw: targets, spark3
wait for throw
action animation
action effect
throw: targets, spark4
wait for throw
action animation
action effect
throw: targets, spark5
wait for throw
action animation
action effect
wait for animation
</target action>
 

Krystek_My

Veteran
Veteran
Joined
Dec 29, 2017
Messages
211
Reaction score
44
First Language
Polish
Primarily Uses
RMMV
@BrianKB Hey
Thank for this extension.
I have a question: How to throw weapon. Like there is in Victor's helpfile thing about throwing weapon, but I can't get this working.
Thanks in advance.
 

BrianKB

Villager
Member
Joined
Nov 30, 2019
Messages
5
Reaction score
10
First Language
English
Primarily Uses
RMMV
@Krystek_My

See my reply to BlueBomber in this thread:
https://forums.rpgmakerweb.com/index.php?threads/ve-throwable-objects-in-yep-battle-core-engine-sequences-patch.116466/post-1041026

In short, you define the desired image in the weapon you want to throw. You could try making a png file that is the same image as the weapon, if you want it to look like you're throwing the whole weapon.

Then in your weapon throwing skill, you'll want something like this in the notetags, customized as to your preference:

<throw object: before>
image: weapon
</throw object>
<target action>
perform action
wait 5
throw: targets, before
wait for throw
action animation
wait for animation
action effect
</target action>
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Ami
4 days im not using my laptop to waiting someone to reinstall (sigh)
Stream will be live shortly with some Donkey Kong 64! Feel free to drop by!
Working on a test Boss for the new No Travel Game Jam
- Name Plugin by Moghunter -
Free RPG Maker Ready Charging Up Animation

Enjoy -No Credit Needed But Appreciated -
Download it at https://lvgames.itch.io/free-charging-up-pixel-animation-fx-rpg-maker-ready
:/ .... so, thought I’d go to the park to sit in the cool breeze and get out of the house a little. Nope, guess that’s quarantined too. Ok...

Forum statistics

Threads
95,490
Messages
929,548
Members
125,740
Latest member
Smeinela
Top