Robro33

Weeb Cringe Incarnate
Regular
Joined
Oct 15, 2022
Messages
251
Reaction score
211
First Language
English
Primarily Uses
RMMV
By default, Custom Remove Effects do not trigger when the states are removed by death. If you would like them to, save a plugin with the following code and put it above all Yanfly plugins in your plugin manager.
Code:
Game_BattlerBase.prototype.clearStates = function() {
for (let i=0; i<this._states.length; i++)
{
if (Imported.YEP_X_StateCategories && this.isCustomClearStates() && (($gameTemp._deathStateClear && $dataStates[this._states[i]].category.contains('BYPASS DEATH REMOVAL')) || ($gameTemp._recoverAllClear && $dataStates[this._states[i]].category.contains('BYPASS RECOVER ALL REMOVAL'))))
continue;

this.removeState(this._states[i]);
}
this._states = [];
this._stateTurns = {};
};
Having a little trouble with this one. I made a fresh project to make sure it wasnt my plugins and checked all the versions to make sure i dont have some old copies somehow but it still doesnt work. Console says that this._states.length on line 2 is undefined even though its correct and works without the plugin? This happens at the start of any play test

1693917682655.png1693917707064.png
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
@Robro33 Stick it inside a conditional to make sure the property has been initialized.
Code:
Game_BattlerBase.prototype.clearStates = function() 
{
  if (this._states)
  {
    for (let i=0; i<this._states.length; i++)
    {
        if (Imported.YEP_X_StateCategories && this.isCustomClearStates() && (($gameTemp._deathStateClear && $dataStates[this._states[i]].category.contains('BYPASS DEATH REMOVAL')) || ($gameTemp._recoverAllClear && $dataStates[this._states[i]].category.contains('BYPASS RECOVER ALL REMOVAL'))))
            continue;
 
        this.removeState(this._states[i]);
    }
  }
    this._states = [];
    this._stateTurns = {};
};
 

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
8,231
Reaction score
3,505
First Language
Dutch
Primarily Uses
RMMV
@Robro33 , also make sure that TUR__YEPDeathRemoval is below YEP_BuffsStateCore and not above
to read the values corerctly from YEP plugin.
 

Robro33

Weeb Cringe Incarnate
Regular
Joined
Oct 15, 2022
Messages
251
Reaction score
211
First Language
English
Primarily Uses
RMMV
@Robro33 Stick it inside a conditional to make sure the property has been initialized.
Ah, thanks. it works like a charm!
@Robro33 , also make sure that TUR__YEPDeathRemoval is below YEP_BuffsStateCore and not above
to read the values corerctly from YEP plugin.
was just following the instructions, but when I had the error the first time, shifting around the plugin's placement was one of the first things i did. no position prevented the crash
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
Updated with a fix for Victor Engine Battle Status Window.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
Added a fix for incorrect level calculations in Yanfly's Class Change Core.
 

Shamil0

Warper
Member
Joined
Mar 20, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I don't get what i'm doing wrong, i've added the DeathRemoval thing for the yanfly buffstatescore plugin, however even when dying it doesn't work, am i doing something wrong?
<Custom Apply Effect> user._holyguidance = user.def - user.mdf; user.addMdf(user._holyguidance); </Custom Apply Effect> <Custom Remove Effect> user.minusMdf(user._holyguidance); user._holyguidance = undefined; </Custom Remove Effect>

1696348312707.png
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
@Shamil0 I don't know. I used a basic setup and it works for me.

I put the notetag:
Code:
<Custom Remove Effect>
console.log("Executed!");
</Custom Remove Effect>

and it produced the expected result when the actor died in battle:

1696349213172.png
Try pressing F8, go to the Console tab, see if there are any errors in there indicating the plugin code isn't loading or your code isn't running.

You're using script calls from Yanfly's Base Parameter Control, which I don't see in your plugin manager above.

Additionally, if it is there but off the screen, that's in the wrong place. It should be immediately beneath the Core Engine.

Double check the order of plugins on the Yanfly Engine Web page, make sure yours are exactly in that order. Not following it can cause random bugs.
 

Shamil0

Warper
Member
Joined
Mar 20, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Try pressing F8, go to the Console tab, see if there are any errors in there indicating the plugin code isn't loading or your code isn't running.
This is what im getting, idk what it means im honestly not the smartest person ever lol.
1696350804982.png
Also i just changed the plugins in the correct order, still have to fix the rest in order but ye
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
@Shamil0 Are you using an outdated version of MV? That syntax is in ES6 which MV supports as of...I think, like, version 1.4.

If you open your rpg_core.js file, what does it say at the top?
 

Shamil0

Warper
Member
Joined
Mar 20, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Its 1.6.2, but also weirdly I reinstalled the rpgmaker and its working now... no clue how but yeah
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
@Shamil0 Alright, good luck with your project!
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
Updated with a fix for SRD's Picture Choices.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
Added fixes for Yanfly's Element Core's Multiplication Multi-Element Rule and Yanfly's Battle Engine Core.
 
Last edited:

Latest Posts

Latest Profile Posts

Help, I can't stop! :kaohi:

alice_ornament.png
I'm happy to join this community.
about this argument. I expressed myself badly, I did it on my own, my English was mixed with Google Translate. And I believe chatGPT didn't even exist in 2016
I have to take sleeping pills :rtear:

Forum statistics

Threads
136,812
Messages
1,270,316
Members
180,574
Latest member
PastorGary
Top