Skills behave differently against certain enemies

Discussion in 'RPG Maker MV' started by Zack Phoenix, Jul 19, 2019.

  1. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    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?
     
    #1
  2. ave36

    ave36 Veteran Veteran

    Messages:
    90
    Likes Received:
    32
    First Language:
    Russian
    Primarily Uses:
    RMMV
    Common event that checks enemy id through script call?
     
    #2
    Zack Phoenix likes this.
  3. BlackGoldSaw

    BlackGoldSaw Veteran Veteran

    Messages:
    61
    Likes Received:
    31
    Location:
    New York City
    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.
     
    #3
    Zack Phoenix likes this.
  4. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    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.
     
    #4
  5. BlackGoldSaw

    BlackGoldSaw Veteran Veteran

    Messages:
    61
    Likes Received:
    31
    Location:
    New York City
    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>
     
    #5
    Zack Phoenix likes this.
  6. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    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
     
    #6

Share This Page