Damage formula

Wisshy

Villager
Member
Joined
Jan 16, 2019
Messages
8
Reaction score
0
First Language
Português
Primarily Uses
RMXP
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?
 

Yeseylon

King Of The Wastes
Member
Joined
Jan 12, 2020
Messages
19
Reaction score
31
First Language
English
Primarily Uses
RMMV
As in if a character gets hit, the attacker gets paralyzed?
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,592
Reaction score
10,918
First Language
English
Primarily Uses
RMVXA
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,209
Reaction score
6,762
First Language
German
Primarily Uses
RMMV
@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.
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,592
Reaction score
10,918
First Language
English
Primarily Uses
RMVXA
@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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,209
Reaction score
6,762
First Language
German
Primarily Uses
RMMV
but is clarified in the second post:
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
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,592
Reaction score
10,918
First Language
English
Primarily Uses
RMVXA
@Andar Oops - I forgot to approve it, so I was the only one who could see it. Should be visible now.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,462
Reaction score
12,015
First Language
English
Primarily Uses
RMMV
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.
 

Wisshy

Villager
Member
Joined
Jan 16, 2019
Messages
8
Reaction score
0
First Language
Português
Primarily Uses
RMXP
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.
Sorry. What I mean is "An ability that add a state to the enemy if it hits the actor
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,462
Reaction score
12,015
First Language
English
Primarily Uses
RMMV
So it will be as per Kes's post #3, on a skill that is used by the enemy.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,209
Reaction score
6,762
First Language
German
Primarily Uses
RMMV
Sorry. What I mean is "An ability that add a state to the enemy if it hits the actor
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,462
Reaction score
12,015
First Language
English
Primarily Uses
RMMV
<removed - think I was right the first time>
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,693
Reaction score
5,363
First Language
Indonesian
Primarily Uses
RMVXA
Sorry. What I mean is "An ability that add a state to the enemy if it hits the actor
This can be interpreted as
  1. 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.
  2. 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.
 

Yeseylon

King Of The Wastes
Member
Joined
Jan 12, 2020
Messages
19
Reaction score
31
First Language
English
Primarily Uses
RMMV
Yeah! Like the ability Static, from Pokemon.
Translates to

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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,209
Reaction score
6,762
First Language
German
Primarily Uses
RMMV
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.
 

Yeseylon

King Of The Wastes
Member
Joined
Jan 12, 2020
Messages
19
Reaction score
31
First Language
English
Primarily Uses
RMMV
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.
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,693
Reaction score
5,363
First Language
Indonesian
Primarily Uses
RMVXA
@Yeseylon unfortunately, the question is posted in VXAce board (with an additional note that the OP primarily use RMXP in their profile)
 

Yeseylon

King Of The Wastes
Member
Joined
Jan 12, 2020
Messages
19
Reaction score
31
First Language
English
Primarily Uses
RMMV
Yikes, somehow I missed that entirely. Removed that part from my last post.
 

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

Latest Threads

Latest Profile Posts

I am feeling better about my update schedule, I feel like I am actually getting consistent work done even if it isn’t big updates.
It's a joy to work on a well-made map. I am not regretting this commission in the least!
I'm currently being attacked by the RPG Maker Hydra: fixing one problem only to have two more rise to take its place.
Hey you! Yeah YOU! Whatcha doin' not backing up your projects? You a masochist or sumthin'? GO BACK UP YOUR PROJECTS! Sheeesh... Didn't think I'd hafta spell it out for yas.
now I need to determine, how MV determines if an auto tile is complete or not.
Edit:From what I can tell it uses Autotile kinds to do that.
Edit 2: The editor determines it and packs picture data for the engine....

Forum statistics

Threads
94,296
Messages
919,749
Members
124,042
Latest member
mintypatronus
Top