Collecting a variable in a damage formula about the target, but do no damage to the target

Hi there,

I'm trying to collect the target's hp in a variable in the damage formula field of a skill, but I wish for this not to actually be executed as "damage" and have no damage pop-up.

So far, I just have in the damage formula box:

Spoiler
v[74] = b.hp

Of course, RMMV reads this as b.hp being the damage output, when I in fact wish for no damage pop up at all.

If not collecting this variable once this skill is executed here, how else can I feasibly do it?
$gameVariables.setValue (74, b.hp); 0

The \v stuff, just like any other escape tag, is applicable ONLY to messages.
@Poryg: nah, v[x] is perfectly well-defined in the damage formula, for both getting and setting. Your formula should work, though! 🙏

@thepsyche: the last number in the formula is taken for the result. Semi-colons are used as line-breaks, so like Poryg suggests, try this:
Code:
v[74] = b.hp; 0
Note that this will generally cause a '0' damage popup; the popup's presence is determined by the skill damage type and as far as I know you'll need a plugin to change that.

A couple of possible alternatives:
  1. A bit awkward, but no plugins: set the skill's damage type to None, apply a temporary "marker" state to the target, and add a Common Event effect to the skill (I'm guessing you already have one). In the common event, check all possible targets for the state and apply the effects as appropriate. Can get a little clunky due to the limitations the editor imposes on its "Enemy" commands... 😴
    Spoiler: Event Example
    Code:
    ◆Comment:Find target!
    ◆Control Variables:#0001 Target Var = 0
    ◆Comment:Check actors for marker state (if appropriate)
    ◆If:Harold is affected by Marker
      ◆Control Variables:#0001 Target Var = 1
      ◆
    :Else
      ◆Comment:Check enemies for marker state (if appropriate)
      ◆If:#1 is affected by Marker
        ◆Control Variables:#0001 Target Var = -1
        ◆
      :Else
        ◆If:#2 is affected by Marker
          ◆Control Variables:#0001 Target Var = -2
          ◆
        :Else
          ◆Comment:etc
          ◆
        :End
        ◆
      :End
      ◆
    :End
    ◆Comment:Use variable to determine who to affect~
    :       :Example:
    ◆If:Target Var > 0
      ◆Comment:Variable = Actor ID
      ◆Change State:{Target Var}, - Marker
      ◆Change State:{Target Var}, + Silence
      ◆Change MP:{Target Var}, + 200
      ◆
    :Else
      ◆Comment:Variable = Enemy Index
      :       :(No convenient "reference by index" options in event commands...)
      ◆If:Target Var = -1
        ◆Change Enemy State:#1, - Marker
        ◆Change Enemy State:#1, + Silence
        ◆Change Enemy MP:#1, + 200
        ◆
      :Else
        ◆If:Target Var = -2
          ◆Change Enemy State:#2, - Marker
          ◆Change Enemy State:#2, + Silence
          ◆Change Enemy MP:#2, + 200
          ◆
        :End
        ◆
      :End
      ◆
    :End

  2. Plugin options: have a look at a plugin like Yanfly's Skill Core that offers notetags to run code at given points in a skill's execution. I think this Skill Core notetag should store the target's HP in variable 74:
    Code:
    <Before Eval>
    $gameVariables.setValue(74, target.hp);
    </Before Eval>
    Then you should be able to reference that variable in an attached common event or whatever~ 😂
Thank you both for the suggestions.

Great! Your last solution is working exactly as intended, @caethyril !

Obviously the other method works as well, but this way I don't get the damage pop up.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/collecting-a-variable-in-a-damage-formula-about-the-target-but-do-no-damage-to-the-target.110151/