Oct 17, 2012
Reaction score
First Language
Primarily Uses
Okay, so I am attempting to write a custom force action javascript call inside various Yanfly note tags. This call is intended to pick a random battler other than the user that performs the initial attack at X% chance and have them use skill Y. There is nothing wrong with the Yanfly plugins or in which note tags I place the call. What is wrong is my knowledge of JS and the strange things I encounter with using forced actions and how MV handles them etc.

For example:

<Custom Confirm Effect>
var successRate = 0.10;
var whoAttacks = $gameParty.members()[Math.floor(Math.random()*$gameParty.members().length)];
if (Math.random() <= successRate) {
whoAttacks.forceAction(28, -1);
</Custom Confirm Effect>

As it is now it has a 10% chance of picking any party member and using skill 28 on the last target. I haven't taken it any further than that because A: I don't I'm doing and B: because of two strange issues.

Issue 1: It's A turn: he performs the normal sequence, at the end of the sequence asks B to use skill X through forced action. B makes the forced action, but then his turn disappears.
EXAMPLE: if you selected use Item his turn will be bypassed and he won't use that item, ONLY IF his turn (use item) happens BEFORE his forced action will it work as intended.

Issue 2: Under the circumstance, if the initial attacker is chosen as the one to force action it will proceed normally and then another random member will also perform the forced action. Basically calling 2 of them to use it for some strange reason.

Any thoughts and or help on this matter would be greatly appreciated. I also believe this knowledge could be beneficial to the community for those interested in making more intense battles for their turn based or active time battles and possibly a great idea for a plugin :)

Thank you for your time, Pioneer

Latest Posts

Latest Profile Posts

Quite the versatile cast so far :p


Edit: Sprites are made by Alexdraws and TheMightyPalm. I just edited them.
Degica Games Turn Komodo | RPG Maker News #77

Well, rats. Was really looking forward to trying out FPS Creator, but trying to install and set it up was pretty much impossible for my tiny brain to comprehend. So much for that, then.
Ah, home once more! I think I can safely work on my games now.
Let's hope power remains on for the day

Forum statistics

Latest member