Drago the Shinigami

The KING of the Shinigami!
Member
Joined
Sep 28, 2016
Messages
25
Reaction score
1
First Language
English
Primarily Uses
RMMV
Umm, I'm having trouble creating a move that damages the user an equal amount as the target, can anyone help me with this? I don't know how to do this. :frown:
 

Drago the Shinigami

The KING of the Shinigami!
Member
Joined
Sep 28, 2016
Messages
25
Reaction score
1
First Language
English
Primarily Uses
RMMV
I just took a look at it, and I'm not sure if that would help, because the damage taken isn't a fixed number or percentage. The formula is
(a.atk * 4 - b.def * 2) * a.level.
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,737
Reaction score
1,206
First Language
Greek
Primarily Uses
RMMV
I'm not sure if what I'm thinking matches with what you want, but from what I understand you want the skill to return back the same damage the skill deals as a recoil damage. I think that there is a way, but I'll need to do some research on this.
 

Drago the Shinigami

The KING of the Shinigami!
Member
Joined
Sep 28, 2016
Messages
25
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you. Don't worry, I'm not in a huge rush.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,763
Reaction score
8,973
First Language
German
Primarily Uses
RMMV
there is absolutely no need for a script or plugin here, just use direct damage coding.

Code:
r=(damage formula); a.hp-=r; r
untested, so the syntax for MV might be something slightly different

r defines a new temporary variable named r to store the damage number of whatever formula you want
a.hp-=r reduces the hp of the skill user by r
and you need to set r again as the number for the damage.

This does not reduce damage in case that the target has less HP left, that would make the damage formula a bit more complex by adding a few more commands for comparison and checks.
 

Drago the Shinigami

The KING of the Shinigami!
Member
Joined
Sep 28, 2016
Messages
25
Reaction score
1
First Language
English
Primarily Uses
RMMV
there is absolutely no need for a script or plugin here, just use direct damage coding.

Code:
r=(damage formula); a.hp-=r; r
untested, so the syntax for MV might be something slightly different

r defines a new temporary variable named r to store the damage number of whatever formula you want
a.hp-=r reduces the hp of the skill user by r
and you need to set r again as the number for the damage.

This does not reduce damage in case that the target has less HP left, that would make the damage formula a bit more complex by adding a few more commands for comparison and checks.

Ummm... sorry, I'm new to this. Where do I put the code?
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,737
Reaction score
1,206
First Language
Greek
Primarily Uses
RMMV
I think you place this to the damage formula box. Make sure to place your current formula between the ().
 

Drago the Shinigami

The KING of the Shinigami!
Member
Joined
Sep 28, 2016
Messages
25
Reaction score
1
First Language
English
Primarily Uses
RMMV
I put the code in the damage box, and it isn't working. Any other ideas on where to put it?
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
You could post what you put in the damage box so we could tell if you put anything wrong.

On another note, if you're using Yanfly's Skill Core, you can use this notetag on the skill (no need to replace anything):

<Post-Damage Eval>
user.gainHp(-value);
user.startDamagePopup();
user.clearResult();
if (user.isDead()) user.performCollapse();
</Post-Damage Eval>
 

Latest Threads

Latest Profile Posts

Well, I'm quickly recovering from Covid, but I'm still broke and injured lol. I miss working on my game! I think I've figured out a lore-friendly way to do a tutorial section separate from the main gameplay, but it'll take some scripting know-how. Which I don't have. And can't afford. :p
I think Kipling said it best.

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
⁠And never breathe a word about your loss,
(...)
Yours is the Earth and everything that's in it,
⁠And—which is more—you'll be a Man, my son!


Do you feel like your modern cities are too clean? I made some dumpsters and trash variations. Visit my MZ resource thread (link in signature).

Forum statistics

Threads
118,580
Messages
1,117,118
Members
155,648
Latest member
SatansTeaParty
Top