Turan's Terrific Tweaks

● ARCHIVED · READ-ONLY
Started by ATT_Turan 107 posts Page 3 of 6 View original ↗
  1. ATT_Turan said:
    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
  2. @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 = {};
    };
  3. @Robro33 , also make sure that TUR__YEPDeathRemoval is below YEP_BuffsStateCore and not above
    to read the values corerctly from YEP plugin.
  4. ATT_Turan said:
    @Robro33 Stick it inside a conditional to make sure the property has been initialized.
    Ah, thanks. it works like a charm!
    ShadowDragon said:
    @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
  5. Updated with a fix for Victor Engine Battle Status Window.
  6. Added a fix for incorrect level calculations in Yanfly's Class Change Core.
  7. 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
  8. @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.
  9. ATT_Turan said:
    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
  10. @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?
  11. Its 1.6.2, but also weirdly I reinstalled the rpgmaker and its working now... no clue how but yeah
  12. @Shamil0 Alright, good luck with your project!
  13. Updated with a fix for SRD's Picture Choices.
  14. Added fixes for Yanfly's Element Core's Multiplication Multi-Element Rule and Yanfly's Battle Engine Core.
  15. Found a thing

    The Buffs and States fix to allow death to trigger remove effects seems to also remove states with <Category: Bypass Death Removal> when a battler also has a state without that tag on them. it seems to be tied to the battler refreshing. i had noticed that at some point, clearStates() was being ran twice on death with the second being while $gameTemp._deathStateClear was false in some cases, resulting in states with the bypass death tag to be cleared anyways. Changing the removeState within the plugin for eraseState and not triggering the refresh seems to fix it

    -blank project-

    plugins
    1703855695804.png

    test state
    1703855715467.png
    method of killing
    1703856150676.png

    turn 1 - Apply test states to actors 1 and 3
    1703856287526.png
    turn 2 - actor 1 guards, actor 2 uses an item to kill actor 1, actor 3 uses item on self
    1703856292258.png
  16. @Robro33 The problem is that eraseStates() doesn't call the remove eval notetags, so that fix defies the point of the snippet in the first place.

    Do you have a test project you set this up with I can mess with?
  17. yeah, ill zip it and send it when it uploads to drive

    ATT_Turan said:
    The problem is that eraseStates() doesn't call the remove eval notetags, so that fix defies the point of the snippet in the first place.
    i wouldnt have even noticed that until way down the line :eek:
  18. Updated with a correction on the Yanfly Buffs & States Death Removal Effects.
  19. Added a fix for Yanfly's STB's interaction with states that have the Cannot Move restriction.
  20. Updated with another fix for Yanfly's Selection Core.