Skills behave differently against certain enemies

Zack Phoenix

Artist
Veteran
Joined
Jun 12, 2013
Messages
187
Reaction score
26
First Language
German
Primarily Uses
RMMV
I'm looking for some input here because my game uses a combat system that involves physical and verbal attacks.
If, say, the skill "Insult" is being used, enemy A is gonna answer with one message while enemy B is gonna answer with another.
(a bit like in Undertale if you're familiar with that game)

What technical solution is there to do this and draw reactions to skills based on the enemy?
 

ave36

Veteran
Veteran
Joined
Jun 23, 2019
Messages
145
Reaction score
57
First Language
Russian
Primarily Uses
RMMV
Common event that checks enemy id through script call?
 

BlackGoldSaw

Veteran
Veteran
Joined
Oct 10, 2017
Messages
61
Reaction score
32
First Language
English
Primarily Uses
RMMV
Yeah, in the damage formula you can use:

$gameVariables.setValue(1, target._enemyId); 0 (Your formula, if any. Otherwise 0)

That'll set the target's ID to (in this case) Variable 1. From there you call a common event that has conditionals set up for each enemy ID to display a message based on the variable returned.
 

Zack Phoenix

Artist
Veteran
Joined
Jun 12, 2013
Messages
187
Reaction score
26
First Language
German
Primarily Uses
RMMV
Thanks guys, I wasn't aware of that formula! That'll do exactly what I need.

edit: Is it possible to put damage calculated by a formula into the common event? I need the damage to apply after the common event passes, if I put it into the skill formula, it applies right before.
 

BlackGoldSaw

Veteran
Veteran
Joined
Oct 10, 2017
Messages
61
Reaction score
32
First Language
English
Primarily Uses
RMMV
A primitive method you could use is leave the damage formula as 0 and create a second skill with the actual damage formula and use a force action in the common event to call it after the message displays. Although, this method gets more tedious if multiple party members are capable of using this skill. If that's the case you'd have to grab the actor ID as well.

$gameVariables.setValue(60, target._actorId);

You'd do the same in the common event with the conditional checking to see which party member used the skill. None of this matters of course if this skill is exclusive to one character.

I'm confident though this can be handled much simpler using Yanfly's Action Sequences Plugins if you're using them. I'm not sure at the moment the setup for that but it'll probably look something like:

<target action>
$gameTemp.reserveCommonEvent(1);
action effect
</target action>
 

Zack Phoenix

Artist
Veteran
Joined
Jun 12, 2013
Messages
187
Reaction score
26
First Language
German
Primarily Uses
RMMV
I was planning to use Action Sequences anyway so this seems to be the best way to do it.
Thank you very much BlackGoldSaw
 

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

Latest Threads

Latest Posts

Latest Profile Posts

rux
Just 80% of my motivation on game making lmao, anyone got tips on how to not be unmotivated?
I've signed up for a job training program for people with Asperger's Syndrome. I went to a "test run" today so they could see how well I did with simple jobs, and I amazed them. Most new people do it in 30+ minutes, while I finished in a mere 15 minutes. Gives me time to work on a screenplay for Studio MDHR...
People,I have seen that Someone from China/Chile and London is doing a Vaccine Against COVID-19.
Doing anything that yield good result in the long run is like sowing seeds. With proper care, they will grow and bear fruits. I'm excited for tomorrow. :D

Forum statistics

Threads
105,454
Messages
1,013,831
Members
137,104
Latest member
sasakureman
Top