TheOnlyLlama

Villager
Member
Joined
Oct 16, 2018
Messages
10
Reaction score
33
First Language
Polish
Primarily Uses
RMMV
Hello Makers! :)

For my game, I created a state that gives complete immunity to physical attacks and skill that grants that state to allies in an area. And here comes the problem. If I set it to last 1 turn, the user loses the state after using the skill. Remove by damage doesn't work since actors don't take any damage. The most ideal situation would be that any physical attack removes the state.

I'm using Yanfly's Engine plugins and there is this plugin: Buffs and States Core. There are a few note tags that I think may help me - like Custom Turn Modifier or Custom Timing Effects, but since my JavaScript knowledge is close to zero, I can't really figure it out. Is there a way to make it work somehow?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,529
Reaction score
14,848
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.



I am not sure if your issue is happening because of a plugin, or if you need a plugin to fix it, but since you mentioned a plugin and are asking for help with it, I'll move it there.
 

TheOnlyLlama

Villager
Member
Joined
Oct 16, 2018
Messages
10
Reaction score
33
First Language
Polish
Primarily Uses
RMMV
@Shaz Sorry for the inconvenience.

I tested the skill with no plugins at all. After using the skill, the state remains until the next action, so that's ok. Then I think the problem comes from the battle system plugin or Battle Engine core?
 

frogs_r_cool

Villager
Member
Joined
May 11, 2021
Messages
16
Reaction score
8
First Language
English
Primarily Uses
RMMZ
Hi, I'm new here and with rpgmaker, but will try to help based on the little I've seen of the codebase.
Try dropping this plugin in. It's a sloppy hack, but basically it works by setting the percent chance on Remove By Damage to 0%.

//============================================================================= // RemoveOnHit.js //============================================================================= /*: * @plugindesc Hijacks Remove By Damage status removal to treat 0% chance as automatic * @author frogs * */ function removeStatesByPhysicalHit(target) { target.states().forEach(function (state) { if (state.chanceByDamage === 0) target.removeState(state.id); }); } (function overwriteApply() { Game_Action.prototype.apply = function (target) { var result = target.result(); this.subject().clearResult(); result.clear(); result.used = this.testApply(target); result.missed = result.used && Math.random() >= this.itemHit(target); result.evaded = !result.missed && Math.random() < this.itemEva(target); result.physical = this.isPhysical(); result.drain = this.isDrain(); if (result.isHit()) { if (result.physical) { removeStatesByPhysicalHit(target); } if (this.item().damage.type > 0) { result.critical = Math.random() < this.itemCri(target); var value = this.makeDamageValue(target, result.critical); this.executeDamage(target, value); } this.item().effects.forEach(function (effect) { this.applyItemEffect(target, effect); }, this); this.applyItemUserEffect(target); } }; })();
 

frogs_r_cool

Villager
Member
Joined
May 11, 2021
Messages
16
Reaction score
8
First Language
English
Primarily Uses
RMMZ
Here's an actual file
 

Attachments

  • RemoveOnHit.js
    1.4 KB · Views: 2

TheOnlyLlama

Villager
Member
Joined
Oct 16, 2018
Messages
10
Reaction score
33
First Language
Polish
Primarily Uses
RMMV
@frogs_r_cool Thank you for your help. I tested it in a few different ways. It is working in a sense that it removes the state, but some other issues appeared like the user not being affected by the skill and actors taking full damage even though they're affected by the state.
 

frogs_r_cool

Villager
Member
Joined
May 11, 2021
Messages
16
Reaction score
8
First Language
English
Primarily Uses
RMMZ
It's probably the case that the other plugins you're using are commandeering the same functions. There's probably a way to do it with some scripting but I don't know the API well yet. If you're still searching for a solution tomorrow afternoon I'll help out
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,499
Reaction score
2,615
First Language
English
Primarily Uses
RMMZ
Don't give the state any auto-removal timing. Add a <Custom React Effect> notetag to the state, and in the code for that call target.removeState(stateId).
 

TheOnlyLlama

Villager
Member
Joined
Oct 16, 2018
Messages
10
Reaction score
33
First Language
Polish
Primarily Uses
RMMV
@41728280 Thank you. That Kyrie Eleison is actually quite fun.

@Trihan That works perfectly. Thanks ^_^
 
Last edited:

Solovei

Has approximate knowledge of many things
Veteran
Joined
Apr 28, 2021
Messages
37
Reaction score
46
First Language
English
Primarily Uses
RMMV
Oooh I've been looking for something like this too, thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

Playing my game to improve my game. (Totally not procrastinating)
Hope he recovers fast :|
Looks like it's functional:
It's a common thing to forget eating &drinking while you are working concentrated, right?
If I had discovered RPG-Maker before moving together with my girlfriend, I'd have died of dehydration a long time ago.
Ami
trying to change my picture & got screwed up...

Forum statistics

Threads
112,497
Messages
1,068,693
Members
146,167
Latest member
ryweuu
Top