Help with "protecting" mechanic in "mon" game

SirStylus

Warper
Member
Joined
Jul 18, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMZ
I'm making a "mon" game (think Pokemon, Digimon) in RMMZ where one of the major gimmicks is that the "trainers" can fight alongside their monsters. Another one of the game's mechanics is that if a trainer on either side goes down, they won't be able to command their monsters and will automatically lose the battle. To prevent players from going "straight for the commander," the first monster in a trainer's party has a "protecting" role where they protect their trainer from harm. I haven't been able to successfully pull it off, however.
I've tried the Substitute flag, but it doesn't seem to work for enemies, which is obviously a problem. I've also tried a "protected" state that reduces all damage done to a trainer to zero, but it doesn't feel realistic (when I attack an enemy trainer it reduces damage to zero, but the monster protecting the trainer doesn't take any damage either, which makes no sense) and while I've had success in doing this for enemies (I just make a battle event so that when the "protecting" monster goes down it removes the protected state on the trainer and allows them to be harmed), I'm struggling to make it work for party members. Is there any way I could make a "protecting" mechanic that works the same way for both party members and enemies?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,966
Reaction score
16,019
First Language
English
Primarily Uses
RMMV

I've moved this thread to MZ Support. Thank you.



Game Mechanics Design is for discussing and getting feedback on mechanics. The support forums are where you go to get help actually implementing a mechanic.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,393
Reaction score
5,085
First Language
English
Primarily Uses
RMMZ
Are you using the VisuStella plugins? You can accomplish this pretty easily with a passive state with a <JS Pre-Start Action> which checks whether the trainer is being targeted and the monster is alive, and if so sets the target of the action to the monster instead.
 

SirStylus

Warper
Member
Joined
Jul 18, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Are you using the VisuStella plugins? You can accomplish this pretty easily with a passive state with a <JS Pre-Start Action> which checks whether the trainer is being targeted and the monster is alive, and if so sets the target of the action to the monster instead.
I'm not very experienced with JavaScript. How would I pull this off?
More specifically, how do I make it so that this targets an actor/enemy in a certain index rather than a specific actor/enemy?
 
Last edited:

SirStylus

Warper
Member
Joined
Jul 18, 2019
Messages
4
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Are you using the VisuStella plugins? You can accomplish this pretty easily with a passive state with a <JS Pre-Start Action> which checks whether the trainer is being targeted and the monster is alive, and if so sets the target of the action to the monster instead.
I tried inputting some JavaScript code but it doesn't work at all.
if($gameParty.members()[2].isAlive()){
Game_Action.prototype.setTarget($gameParty.members()[2]);
}
It runs, but enemies can still target other party members. I also haven't figured out how to check if an enemy is targeting the trainer.
Yeah I'll admit I have no idea what I'm doing
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Thinking of getting a mechanical keyboard, eventually! Would anyone be interested in a chill keycap-painting stream?
Walked through the rain to take pictures of an 50+ year old printing press for my students. Hope they will honor that effort xD
Can I promote my %75 OFF Creator Day Sale here, or it's against forum rules as well? :kaocry:
Tests for an alert system that spawns enemy reinforcements, as a stealth game should do :kaoswt2:
playing around animations with character sprites. having parallel events playing around with variables while also having an event have that same variable does wonders.

Forum statistics

Threads
126,908
Messages
1,182,250
Members
166,713
Latest member
escuro
Top