Hi. I'm trying to make a state that is added to the target if it hits the user. Is there a way to make it in the damage formula?
Damage formula
RPG Maker VXAce SupportAs in if a character gets hit, the attacker gets paralyzed?
You could use this formula:
a.add_state(7); your damage formula here.
As nothing is run if a skill misses, this will only work of there is a hit. "a." refers to the user of the skill.
Don't forget the semi-colon between the 2 parts of the formula.
And now, wearing my Mod hat, please don't double post. If you want to add something, just use the Edit button on your post and type in the additional info/comment.
a.add_state(7); your damage formula here.
As nothing is run if a skill misses, this will only work of there is a hit. "a." refers to the user of the skill.
Don't forget the semi-colon between the 2 parts of the formula.
And now, wearing my Mod hat, please don't double post. If you want to add something, just use the Edit button on your post and type in the additional info/comment.
@Kes unfortunately that wasn't what the OP asked for - you ignored the "if the user is hit", it's not "if the user hits the target." like your solution assumes.
@Wisshy
If I understand you correctly (your description is short after all) you want an effect on the user that results in damage to an enemy if that enemy attacks and hits the user.
That is usually called a thorn armour effect around gamers, and it can't be done by the default engine (not without a big mess of damage coding that is much more difficult than the example above).
It is usually done with a script that creates additional code for the skill sequences. I know there were such scripts on the Ace Master Script List, but I don't have links and don't know if they are still available because a lot of the ace scripter websites have been lost.
@Wisshy
If I understand you correctly (your description is short after all) you want an effect on the user that results in damage to an enemy if that enemy attacks and hits the user.
That is usually called a thorn armour effect around gamers, and it can't be done by the default engine (not without a big mess of damage coding that is much more difficult than the example above).
It is usually done with a script that creates additional code for the skill sequences. I know there were such scripts on the Ace Master Script List, but I don't have links and don't know if they are still available because a lot of the ace scripter websites have been lost.
@Andar I get your point, but the way it is phrased in the opening post is deeply confusing, but is clarified in the second post:
"if a character gets hit, the attacker is paralyzed."
That is just a simple "if I hit you, something also happens to me."
That is not the same as your statement:
"an effect on the user that results in damage to an enemy if that enemy attacks and hits the user"
At least, I don't think it's the same, but maybe it's too early in the morning for me to be thinking clearly.
EDIT
Also Thorn damage is typically a loss of HP to the attacker. I personally have never seen a thorn script which inflicts a state, which is what the OP wants.
"if a character gets hit, the attacker is paralyzed."
That is just a simple "if I hit you, something also happens to me."
That is not the same as your statement:
"an effect on the user that results in damage to an enemy if that enemy attacks and hits the user"
At least, I don't think it's the same, but maybe it's too early in the morning for me to be thinking clearly.
EDIT
Also Thorn damage is typically a loss of HP to the attacker. I personally have never seen a thorn script which inflicts a state, which is what the OP wants.
I don't see a second post - it looks as if you've hidden it instead of merging it. I wondered about the doubleposting comment when there was no second post
@Andar Oops - I forgot to approve it, so I was the only one who could see it. Should be visible now.
The second post is not by the OP, so it's just a question/assumption.
The question doesn't make sense.
"I'm trying to make a state that is added to the target if it hits the user."
If A uses a skill on B, then B (the target) is going to get hit, not A (the user).
The only way "the user" will be hit, is if the skill has a target of "the user" (in which case the target and the user are the same person), or if the target has a state that reflects the damage back onto the user.
OP needs to clarify what the question means.
The question doesn't make sense.
"I'm trying to make a state that is added to the target if it hits the user."
If A uses a skill on B, then B (the target) is going to get hit, not A (the user).
The only way "the user" will be hit, is if the skill has a target of "the user" (in which case the target and the user are the same person), or if the target has a state that reflects the damage back onto the user.
OP needs to clarify what the question means.
Yeah! Like the ability Static, from Pokemon.
Sorry. What I mean is "An ability that add a state to the enemy if it hits the actor
So it will be as per Kes's post #3, on a skill that is used by the enemy.
Who is supposed to have that ability? That is still not clear.
If the enemy has the ability, that means the enemy is hit by the state whenever the enemy attacks anyone, no matter who. That is what the solution given by Kes in the post #3 is about.
If the target has the ability, that means any enemy using any skill gets the state when they use the skill on the specific target that has this ability. If that is the case then my answer stands and this cannot be done by damage formula (or without a plugin) because it would have to be added to all skill damage formula and would have to check if the specific target has the ability or not.
<removed - think I was right the first time>
This can be interpreted as
- The enemy is the one who acts if the enemy successfully hits the actor, it adds a state to itself. So the property "add state" is owned by the enemy in this particular skill/attack.
- The actor is the victim/target, this actor has a passive ability to add a state to the enemy if it hits the actor. So the property "add state" is owned by the actor, a passive ability. i.e, whoever hits this actor, gets the state.
should this happen only if the enemy uses the attack skill, or should this happen no matter which skill the enemy uses to attack?
will this be the only ability that triggers something on hit, or will there be other passive abilities that trigger other things on the attacker?
The problem is that the damage formulae has limited space. If it should only happen on attack and only for a single ability, then you can use the damage formulae.
If this has too many different abilities to check and too many different attack skills that need to react, then there is no way to use the damage formulae, you'll need a script to handle this.
will this be the only ability that triggers something on hit, or will there be other passive abilities that trigger other things on the attacker?
The problem is that the damage formulae has limited space. If it should only happen on attack and only for a single ability, then you can use the damage formulae.
If this has too many different abilities to check and too many different attack skills that need to react, then there is no way to use the damage formulae, you'll need a script to handle this.
I'm just now realizing there was confusion because I never set a profile pic, my bad, whole thread should be clearer now. Was trying to get clarification on OP's original post because it seemed weirdly worded (and because defensive status infliction would be a useful tool, so I was curious to see the solution as an RM noob myself).
Based on the comment about the passive Pokemon ability Static, OP is looking for a passive ability that inflicts a state like paralysis when an enemy hits the actor. Not sure if it's meant to be only on basic Attack or for all moves/attacks/skills, although Pokemon with Static did only affect enemies who used a move that made contact (i.e., affects enemies that used Tackle/Mega Punch, but not Ice Beam/Earthquake- I'm pretty sure that could be handled in RM by skill categories).
From what I've seen messing around with states and passive abilities in the database, I'm guessing this is something only achievable through plugins? @Andar, please lemme know if I'm wrong, I'm still definitely learning.
Based on the comment about the passive Pokemon ability Static, OP is looking for a passive ability that inflicts a state like paralysis when an enemy hits the actor. Not sure if it's meant to be only on basic Attack or for all moves/attacks/skills, although Pokemon with Static did only affect enemies who used a move that made contact (i.e., affects enemies that used Tackle/Mega Punch, but not Ice Beam/Earthquake- I'm pretty sure that could be handled in RM by skill categories).
From what I've seen messing around with states and passive abilities in the database, I'm guessing this is something only achievable through plugins? @Andar, please lemme know if I'm wrong, I'm still definitely learning.
@Yeseylon unfortunately, the question is posted in VXAce board (with an additional note that the OP primarily use RMXP in their profile)
Yikes, somehow I missed that entirely. Removed that part from my last post.
Original thread: https://forums.rpgmakerweb.com/threads/damage-formula.117370/