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

Lately when I listen to 1970s songs, I always think that the "real world" is still at mid 70s. What we experience now is a futuristic dream. With this point of view, even 80s and 90s looks super futuristic. :D

The GIF of this seemed too cool to bury in replies. :LZSwink:
You may have slept with my aunt... but, given the circumstances, cheers.

- Professor Ian Duncan, 2013
Ami
--- Swimming ---

F.Knight: This Shrine always Flood. We don't have a choice,we have to Swimming in this place
F.Healer: That Insane!
F.Mage: We can use…Boat,rather than Swimming
F.Knight: You guys…Can't Swim?
F.Healer & F.Mage: (Shocked) Eehh??

Forum statistics

Threads
105,527
Messages
1,014,420
Members
137,211
Latest member
RikuTales
Top