[Solved]A question about force action in turn 0

● ARCHIVED · READ-ONLY
Started by jack2396 17 posts View original ↗
  1. Hi, I apply a battle event in turn 0, after it, everybody's HP restore rate / MP restore rate / TP Charge rate got triggered.
    But I don't want it got triggered.
    As far as I know, it can't be solve by event, it has to be solve by script.
    Anybody know how to fix it?
  2. *Bump*
  3. You may have to explain your issue in a more understandable way. I doubt you need javascript to "fix" it - it is most likely that you've done something wrong with the conditions or the span.

    Screenshots of your troop event would help, as well as a list of all of your active plugins.
  4. VnIOVxN.jpg
    The enemy should use a skill when battle begin.
    It did use a skill, but after that, everybody's HP restore rate / MP restore rate / TP Charge rate got triggered.
    That is, this enemy will charge TP after using the skill in turn 0.
    I guess I have to delete or rewrite some code in rpg_object.js, but I don't know where's the code I need.

    EDIT: Oh, by the way, I tried to made same situation in a completely clear project, and TP Charge rate got triggered, too.
  5. I would look at the skill that the enemy used, to see if it has any settings that cause those rates to get triggered, or if it calls a common event to do the same thing.

    If nothing turns up there ... what else is happening on the other tabs for this troop?

    What is switch 338 used for - any chance it's being used somewhere else to do the same things? Either in another troop event, or a common event that's somehow being called, or in a plugin? If you remove that command that turns on the switch, save & play again, does the same thing still happen?

    You might be able to use my cross reference plugin to do a search on one of the actors and see if you can find any commands that change those things. It won't show anything that happens via plugins though.
  6. Okay, looks like I am not good at English.
    So, I recorded a video.



    You can see, after the bat attacked (in turn 0), Harold's TP got charged.
    This project is completely clean.
  7. This is a brand new project with NO plugins? Have you made any changes to the core files or plugins in the NewData folder?

    TP increasing when attacked is default behaviour. Just not sure it should go all the way to 100.
  8. Yes, this is a brand new project.
    And no, I didn't make any changes to the core files.
  9. Would you mind zipping up your data folder and your js folder and sending to me (load to dropbox & send me a download link)? I should be able to reproduce the issue with those two folders. I won't be able to look further for another few hours though.
  10. I didn't want your NewData folder. I wanted the data folder and the js folder from your project (the new one you just created). These are not the same as NewData.

    I asked for those because they are from your actual project, and they will be small files. The NewData folder is not from your project, and is very large because it has all the audio and images, which I will already have so don't need to download.
  11. okay, I see that you are using version 1.6.0 of the core files. Unfortunately, that version was quite buggy and I do see some differences between it and the next version in relation to TP and battles (it has other differences, but I was only interested in looking for tp stuff).

    I suggest you upgrade to 1.6.1 or downgrade to the latest 1.5.? version. As part of that, you will need to replace your project's js folder with the one from NewData after you have upgraded/downgraded. When you do this, do not replace your plugins.js file or your plugins folder, but replace the libs folder and everything else in the js folder. The Update thread under the MV Releases subforum has all the steps to follow - https://forums.rpgmakerweb.com/index.php?forums/rpg-maker-mv-releases.171/.

    Alternately, after upgrading, just start another new project and see if the issue still happens there.
  12. Hmm, I downgraded my RMMV to version 1.5.1, but the problem still there......
    So, I change something in my code:

    Code:
    Game_Battler.prototype.regenerateHp = function () {
        if ($gameTroop.turnCount === 0);               // If it's not turn 0, trigger everyone's "HP regenerate every turn".
        else  {
        var value = Math.floor(this.mhp * this.hrg);
        value = Math.max(value, -this.maxSlipDamage());
        if (value !== 0) {
            this.gainHp(value);
          }
        }
    };

    But seems like it's no use, I guess I am messing around with it.
  13. This is purely a guess, but try this:

    Code:
    Game_Battler.prototype.regenerateHp = function () {
      if ($gameTroop.turnCount > 0) {               // If it's not turn 0, trigger everyone's "HP regenerate every turn".
        var value = Math.floor(this.mhp * this.hrg);
        value = Math.max(value, -this.maxSlipDamage());
        if (value !== 0) {
          this.gainHp(value);
        }
      }
    };
  14. It may sounds weird, but after I change my code to this, the problem is solved:
    Code:
    Game_Battler.prototype.regenerateHp = function () {
        var TC = $gameTroop.turnCount();
        if (TC > 0) {
        var value = Math.floor(this.mhp * this.hrg);
        value = Math.max(value, -this.maxSlipDamage());
        if (value !== 0) {
            this.gainHp(value);
        }
        }
    };

    Thanks for helping and teaching me!
  15. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.