Hi all! I am attempting to create a shield projectile that bounces between three random enemies (ala Captain America). I am doing this via VisuStella Action Sequence Projectiles plugin. What I have tried is to set the skill itself up to hit 3 random enemies, then in the common event, have the projectile move from user to current enemy, do the action effect on the current enemy, then have the projectile move from 'current enemy' to 'next enemy' and perform the action even on the 'next enemy'. Apparently this does not work, is anyone able to suggest the correct way to do this?
Bouncing Shield?
RPG Maker MZ SupportCan you elaborate on what you mean when you say "this does not work" for those of us who don't live in your head or have access to your project? 😛
Well, when I tried it, it just did damage on whoever the first target was three times. the projectile animation worked fine. What I am trying to figure out is how to designate the next random target using action sequences (projectiles in this case) for a skill that has three random targets so that you can see the shield going from user to target, then target to next target, then from that target to the final target, and back to the user. I see the option for 'next target' and feel like that is the right idea but not sure how to order that into the action sequence.
May also need to use one of these ACSET options instead?
Can you show me what you have currently?
So basically do start action sequence, then projectile as seen below
For the start location I have "user" and for the goal location I have "current target". After that is a shockwave effect and animation and damage effect. That part works fine up until the next part.
Then it should move from the 'current target' to the 'next target' (in this case 2nd random target is what I was aiming for) so I do another projectile entry but this time the start location is 'current target' and the goal location is 'next target'
And so on. Feel like I am using next target incorrectly.
This is the skill
This is what it does currently
May have found my answer though
Instead of doing current to next I can change the current target to a random target (force random) after the hit and then do prev target to current target
Instead of doing current to next I can change the current target to a random target (force random) after the hit and then do prev target to current target
You need to have the projectile go from "prev target" to "current target" and in between each one do "MECH: Next Target".
However, this results in the visual being weird if the same random target is chosen twice. You probably need to do the targeting manually to ensure that a different one is chosen for each hit.
However, this results in the visual being weird if the same random target is chosen twice. You probably need to do the targeting manually to ensure that a different one is chosen for each hit.
You are right, it looks weird when it doesn't bounce to another enemy using TARGET: RANDOM, or if there's only one target. I can just make it into a low cost single target attack for now.
Here's how I did it for Chain Lightning, you might be able to do the same thing for this:
JavaScript:
<JS Targets>
const foes = this.subject().opponentsUnit();
const target = foes.members()[this._targetIndex];
targets.push(target);
let members = foes.aliveMembers();
members.splice(members.indexOf(target), 1);
let extraTargets = 3;
while (extraTargets--) {
const member = members[Math.randomInt(members.length)];
if (member) {
targets.push(member);
members.splice(members.indexOf(member), 1);
}
}
</JS Targets>
Awesome, thanks for the advice! I would just paste this in my action sequence as a script where I was choosing my targets with TARGET: RANDOM before correct?
Will I need to designate the target as the variable JS Targets?
Put it in the notebox for your skill. Then you can use "next target" instead of random, as targets will contain a unique set of random enemies from the troop already.
Original thread: https://forums.rpgmakerweb.com/threads/bouncing-shield.138409/