Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
34
Reaction score
13
First Language
English
Primarily Uses
RMVXA
I want to create a state that as long as I have it, I can convert all damage or a % (depending on the state) to HP. I know there's the yanfly element absorb plugin, but that plugin limit to absorb damage based on elements, I really wish to have states that absorb DEPENDING on if the attack was Physical or Magical.

I searched like crazy for several days already. I'm sure this can be done without scripts, but even that, I can't find a script that do it. (That's why I also believe this must be doable without script.)
 

NoPatience

Veteran
Veteran
Joined
Sep 12, 2018
Messages
66
Reaction score
21
First Language
Slovak
Primarily Uses
RMVXA
OK, so this is how I would begin. For the attack skill, I'd put something like this in the damage formula:

v[1]=b.id ; v[2]=a.atk * 4 - b.def * 2 ; v[2]

where v[1] is variable 1, which will store which actor is the target (b.id) and v[2] is variable 2, which is the damage dealt (the second v[2] is the actual damage that would be dealt, maybe it's not even necessary there). Then I'd create a common event (called by the skill), which will first check which of the actors was the target and whether they have the state, and if they do, increase this actor's HP by variable 2 or a percentage of it. You can also add a message saying that they gained his amount of HP (depending on what kind of messaging system you use).

This would be for normal attack, you can just add it to any other skill (with their own damage formulas of course). Maybe some tweaks would be needed, I didn't test it, but this is a good place to begin at. If you need any details, ask away, I'll answer if I know :LZSsmile:

Edit: I just noticed you say convert, so you'll need to cancel the damage first, which is not impossible, but I don't know how to make the damage mesage not show up. Or you could have the damage but then recover it + whatever extra you want.
 
Last edited:

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
34
Reaction score
13
First Language
English
Primarily Uses
RMVXA
OK, so this is how I would begin. For the attack skill, I'd put something like this in the damage formula:

v[1]=b.id ; v[2]=a.atk * 4 - b.def * 2 ; v[2]

where v[1] is variable 1, which will store which actor is the target (b.id) and v[2] is variable 2, which is the damage dealt (the second v[2] is the actual damage that would be dealt, maybe it's not even necessary there). Then I'd create a common event (called by the skill), which will first check which of the actors was the target and whether they have the state, and if they do, decrease this actor's HP by variable 2 or a percentage of it. You can also add a message saying that they lost his amount of HP (depending on what kind of messaging system you use).

This would be for normal attack, you can just add it to any other skill (with their own damage formulas of course). Maybe some tweaks would be needed, I didn't test it, but this is a good place to begin at. If you need any details, ask away, I'll answer if I know :LZSsmile:

Edit: I just noticed you say convert, so you'll need to cancel the damage first, which is not impossible, but I don't know how to make the damage mesage not show up. Or you could have the damage but then recover it + whatever extra you want.
Thank you for answering so fast! But, I don't think this would help with what I want to achiev. Maybe I'm dumb explaining what I want. In the RPGmakers you have 2 types of attack Physical and Magical. I want to create 2 states (or maybe I would create more but there would be basically 2 types), 1 that absorb phyisical damage, and another that absorb magical damage. Of course if I have the physical one and I'm attacked by magic, I won't absorb that damage.
There's a plugin by yanfly that absorb element damage, but that script doesn't care if the attack is magical or physical. I'm almost sure that old rpg makers like 2k3 was able to absorb damage depending on the type.
 

NoPatience

Veteran
Veteran
Joined
Sep 12, 2018
Messages
66
Reaction score
21
First Language
Slovak
Primarily Uses
RMVXA
So the problem with my (seed of a) solution is that you'd receive the damage first? Otherwise it seems to me that it could work for what you want (enemy attack skill checking if you have the state and if you do, adding HP). Or I just might have problems with reading comprehension :LZSlol:
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,318
Reaction score
9,708
First Language
German
Primarily Uses
RMMV
you'll need a script to make a state function like that.

workarounds with the damage formula or eventing will only result in similar effects with side-options that are different.

and no, I don't remember which scripts for Ace could do this, especially since half the original scripter sites are already down.
 

NoPatience

Veteran
Veteran
Joined
Sep 12, 2018
Messages
66
Reaction score
21
First Language
Slovak
Primarily Uses
RMVXA
What's wrong with workarounds? :LZSwink: Anyway, isn't physical an element also? Maybe try this - make a separate skill Attack for enemies to use, with everything like normal attack, just change element to physical. Then use <element absorb: 1> in the state's note window and try it out (using Yanfly's script you mentioned). Again, just throwing out ideas, didn't test it :cool:
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,318
Reaction score
9,708
First Language
German
Primarily Uses
RMMV
Anyway, isn't physical an element also
not in that context.
the hit types are "certain hit", "magical attack" and "physical attack" and that selection completely changes the damage process, and has nothing to do with the damage elements or that one of the damage elements is sometimes called "physical" as well.

You can check the damage flow here (VXA, MV and MZ):
 

NoPatience

Veteran
Veteran
Joined
Sep 12, 2018
Messages
66
Reaction score
21
First Language
Slovak
Primarily Uses
RMVXA
@Andar , does it matter, though? I was speaking with regards to Yanfly's element absorb script (maybe it wasn't clear) and the OP saying he wants physical attacks absorbed. I had a very brief look at the script, so maybe I'm missing something, but it's all about elements, not hit type. From the end result's point of view, it doesn't matter if the absorb function depends on hit type (as OP phrased it) or on element. The player sees enemy hit with a sword, the damage is absorbed (because of "physical" element having been set up for the skill), so they assume physical damage was absorbed. Mission accomplished, no?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,713
Reaction score
12,261
First Language
English
Primarily Uses
RMMZ
I think the only way of determining this to everyone's satisfaction is for the OP to install the script and then try it, having also created an element 'Magic'. and one 'Certain Hit'. Where I forsee an immediate problem is if the skill already has an element attached to it e.g. fire. In Ace you can't stack elements, so it wouldn't do what the OP wants.
 

NoPatience

Veteran
Veteran
Joined
Sep 12, 2018
Messages
66
Reaction score
21
First Language
Slovak
Primarily Uses
RMVXA
@Mattsuharu I tested it with Yanfly's element absorb script, if you make an attack skill for enemies, with "physical" set up as element, damage is absorbed. For magical skills, if you want to have one state for all elements, I'd just put all of them in the notetag like this <element absorb: 3, 4, 5, 6, 7, 8, 9, 10> (this is according to default database, 3 fire, 4 ice, etc). So the script should work for what you want, unless I completely misunderstand what you want :LZSlol:
 

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
34
Reaction score
13
First Language
English
Primarily Uses
RMVXA
@Mattsuharu I tested it with Yanfly's element absorb script, if you make an attack skill for enemies, with "physical" set up as element, damage is absorbed. For magical skills, if you want to have one state for all elements, I'd just put all of them in the notetag like this <element absorb: 3, 4, 5, 6, 7, 8, 9, 10> (this is according to default database, 3 fire, 4 ice, etc). So the script should work for what you want, unless I completely misunderstand what you want :LZSlol:
Yeah, I'm using Yanfly Element absortion. The problem is, in my game there's physical (fire, water, earth, etc) attacks, and magical (fire, water, earth, etc). So, if I use this script to absorb Water, it will absorb water regards if its physical or magical. This is why I'm struggling so much for this xD
Yanfly also have a script that "convert damage", but it only works the other way around I want. It convert the damage YOU DO, not the damage I receive, so that also doesn't work.
He also have script for lunatic states, and there's many MANY combinations, but there's nothing like an absortion... The only absortion script is elemental limited. But well, I guess I could work around the game without this, it's a shame but I don't see to find a solution. But it bugs me but I feel this should be a basic mechanic in any rpg maker... I can't believe they messed this up.

The only way I could think of this to work out, is if I could make the "physical Damage Rate" a negative number, but every time I try it, the program automatically set it to 0%. Having it over 100% (120% for example) make that you take extra damage, so maybe if I could turn it negative, I could heal instead of taking damage? Not sure, but the program doesn't leave me anyways.
 

NoPatience

Veteran
Veteran
Joined
Sep 12, 2018
Messages
66
Reaction score
21
First Language
Slovak
Primarily Uses
RMVXA
It's a bit too early for my brain to work properly, but would setting up new elements (fire physical, etc) help?
 

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
34
Reaction score
13
First Language
English
Primarily Uses
RMVXA
It's a bit too early for my brain to work properly, but would setting up new elements (fire physical, etc) help?
Mmm that would be the easier solution, but I'm using a special script for skills where you can equip and unequip them, and it has a filter to search easily. And it would look a little weird in the filter. But thanks for the try!
 

Latest Threads

Latest Posts

Latest Profile Posts

Spent all day writing code, only for it to result in an endless loop...sigh.:kaosigh:
So um what is the deal with rpgmakerofficial.com ,why are there two rpg maker websites now? Is it any different from the current one rpgmakerweb.com??
ScreenShot_7_1_2022_11_41_55.png
When the Panic gauge is full, Mike will turn into Omar in a state of actual panic. his move list changes and until the meter depletes completely, he'll be able make use of this alter ego.
So unbelievably excited for IGMC this year! First public game was for the original one and I'm just so pumped!!
Sometimes I am amazed at how relentless spam bots are. I would clear the que and then see 800~5k more depending on their mood.

Forum statistics

Threads
123,263
Messages
1,155,322
Members
161,645
Latest member
MercyTales
Top