Custom Force Action using Javascript

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
I'm trying to create a custom force action plugin command. I found this in the script list but I don't know how to use it:


$gameParty.members()[index].forceAction(skillId, targetIndex);


BattleManager.forceAction(battler);


I want to force the current actor to use skill x on target y, in the form of a plugin command like this: ForceBattle x y


I'd like y=-1 to return a random target, y=0 to return the last target, and y=1 through y=8 to return those indexes.
 
Last edited by a moderator:

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
You forgot to put this after 


BattleManager.forceAction(battler);
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
Further displaying my ignorance of how to use these.


Can you help me?
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
I guess by plugin command you mean either in a state or in a skill so


<Custom Respond Effect>


if (value >= 1) {


$gameParty.members()[X].forceAction(skillId, -1);


BattleManager.forceAction($gameParty.members()[X]); }


</Custom Respond Effect>


will force an action of the party member X when the target of the state is struck by damage
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
Not a state and not a notetag. I want a plugin command I can use in an event.


I'm updating a plugin and I want to add this functionality.


The code for the plugin command itself wouldn't be related to any other code in the plugin.


So all I need is the code to go in the plugin that would allow users to use the plugin command I described in the OP.
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
That's why you need to be more precise in your description.


battler.forceAction(this._params[2], this._params[3]);


BattleManager.forceAction(battler);
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
How could I have been more precise? I said I needed a plugin command, said what I needed it to look like, and said what I needed it to do.


How do I use that code to make a plugin command?
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
l think you're confused at what a plugin command is...
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
I'm not.


Screenshot_20161206-113144.png


I want to be able to enter "ForceBattle x y" in that box so that when the common event gets to that step, it forces the current battler to perform skill x on target y as describe in the OP.
 
Last edited by a moderator:

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
But you can't because a plugin command is usable for plugins like Yanfly using those plugin commands.


Script call basically do the same thing and is usable anywhere, plugin command is one of the worse features of MV and the only time l used it is for Gab Window because l was forced to.


What...? You want to force an action in the map? It's not at all what you asked at the beginning. You probably need a plugin for that since the only way to get skills usable is from the menu.
 
Last edited by a moderator:

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
I meant common event, not event. Sorry. I edited it.


And why can't my plugin use plugin commands? I'm pretty sure any plugin can use plugin commands. That's what they're for.


Plugin commands are a great feature for people who don't know Javascript very well.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,050
Messages
1,018,548
Members
137,835
Latest member
yetisteven
Top