Checking for Status Condition in Battle

Hello, I am requesting help resolving an issue with a troop event.

To explain: I have one troop event that applies a specific state when actor 3 reaches 0 HP to switch his status to a custom one (undying) and turn on a switch; this part is working fine.

I then have a second event that checks to see if he still has that status. If no, the switch is turned off. If Yes it then checks to see if the rest of the party is dead. If Yes, Game Over. If no it should end the loop.

That end loop is the issue; in testing the event just keeps running forever and locks up. I have tried using both the break loop and exit event processing commands with no change. Switching from "moment" to "turn" caused the event to not run at all for some reason. Here is the page at present:
RPGcodehelp.PNG


if anyone can provide help or has a suggestion for an alternate way to accomplish this, I would appreciate it.

Quick note: I have no budget for paid plugins so please avoid recommending those. I keep seeing recommendations for plugins by Yanfly on here, but that site appears to be down and most of their content was paid.
Just a small aside: it's best to use the same terminology that RPG Maker does. It's not a huge matter, but I had a little bit of confusion over a few things in your post - I gather "status" is "state" and "flag" is supposed to be "switch."

in testing the event just keeps running forever and locks up. I have tried using both the break loop and exit event processing commands with no change. Switching from "moment" to "turn" caused the event to not run at all for some reason.
Moment means the event will run continuously while its conditions are met. It's not a loop internally in the event, so neither Break Loop nor Exit Event Processing will have any effect, because the actual event will entirely restart.

You can see why this would happen if you follow the logic - if the Bones is Dead switch is ON, the event will activate. If Bones has the Undying state, but MC doesn't have the Yield state, there isn't anything there - you have an empty Else branch.

So the event will end and immediately restart because Bones is Dead is still ON.

You might find your own method to change this, but you could turn Bones is Dead OFF inside of that Else branch, and then have another troop event that runs at the end of each turn that checks him to have Undying and turns the switch back on? Your options are a little limited using just troop events.

Quick note:I keep seeing recommendations for plugins by Yanfly on here, but that site appears to be down and most of their content was paid.
I'm not sure how you've looked, but Yanfly's site (both the personal one yanfly.moe and the itch.io page) work perfectly. There's a substantial chunk of Yanfly plugins that are free, and those are the most basic ones for interacting with things like skills and states, which would be useful to you here.

Intentionally ignoring your request (for the sake of helping you), here's a method to do what you're trying to do using Yanfly's free and available Buffs & States Core.

Give your Undying state the notetag:
Code:
<Custom Apply Effect>
if ($gameActors.actor(2).isStateAffected(42))
    SceneManager.goto(Scene_Gameover);
</Custom Apply Effect>

where 2 is the ID of MC and 42 is the ID of Yield.

Similarly, put into Yield:
Code:
<Custom Apply Effect>
if ($gameActors.actor(1).isStateAffected(69))
    SceneManager.goto(Scene_Gameover);
</Custom Apply Effect>

where 1 is the ID of Bones and 69 is the ID of Undying.

That will make it so that whenever one of them gets their state, if the other actor has their state, the game will immediately go to game over. This would allow you to not have to use any troop events.
I'm not sure how you've looked, but Yanfly's site (both the personal one yanfly.moe and the itch.io page) work perfectly. There's a substantial chunk of Yanfly plugins that are free, and those are the most basic ones for interacting with things like skills and states, which would be useful to you here.

yanfly.PNG


This is what i get when trying to go to yanfly.moe. Likewise; all of the links I keep finding for Yanfly redirect to 404 pages.
You appear to be missing the www in the URL.

If you Google "yanfly buffs states" you should find this page, which works just now for me:

And the top of that page links to the plugin's free download on itch, which also works just now for me:
View attachment 303640

This is what i get when trying to go to yanfly.moe. Likewise; all of the links I keep finding for Yanfly redirect to 404 pages.
Be sure to use http instead of https - I believe there is no https certificate re-route so you need to use the regular http - also check to make sure your browser doesn't automatically use https for sites. You may have to manually type out the website with http.

Edit: rpglord is correct - use MZ stuff - I was just correcting the website issue and didn't realize this was for MZ. Haha.
Thank you; I have the plugins now and will attempt to utilize them. It is nice that this can be accomplished using the free plugins.
Hmmm, this is MZ support. Get the VisuStella ones.
Hmmm, this is MZ support. Get the VisuStella ones.
OOPS! I was going off of the OP talking about Yanfly plugins, but those are not the correct plugins for their RPG Maker at all.

You could use VisuStella, or for something lighter weight my Eval Tags plugin - available from the link in my signature.

The code would be the same, you'd just rename the notetags to State Apply Eval.
Oh; that explains why it's not working. I wasn't aware that Yanfly wouldn't work in MZ since both MZ and MV use JS coding.

I'll check these out.
And it seems to only want to let me download some sample game project? Not the actual plugins.

You could use VisuStella, or for something lighter weight my Eval Tags plugin - available from the link in my signature.
If I were to make use of your Eval Tags plugin; what credit requirements and terms apply? Disregard, I found your terms of use.
And it seems to only want to let me download some sample game project? Not the actual plugins.
If I were to make use of your Eval Tags plugin; what credit requirements and terms apply?
I know you're anxious to get this working, but I kindly suggest you try to slow down, calm down, and read.

The download page where you found the VisuStella demo project says the plugin files are in that project - that's how it can demonstrate their features. You'd simply copy the appropriate files and paste them into your own plugins folder.

And the terms for my plugin are written in the first post of the thread.
Yes, you are correct. I was very hasty in that last reply.

I will check out that sample game if I need the other resources, but for now your plugin should be sufficient if I can get it to work. However, I seem to be doing something wrong with it. I have your tag Eval plugin imported and on and have the following in the notes:


Code:
<State Apply Eval>
if ($gameActors.actor(2).isStateAffected(1))
    SceneManager.goto(Scene_Gameover);
</State Apply Eval>
<--This is in the Undying state refencing MC (actor 2) and Yield (state 1).


Code:
<State Apply Eval>
if ($gameActors.actor(3).isStateAffected(31))
    SceneManager.goto(Scene_Gameover);
</State Apply Eval>
<-- This is in the Yield State referencing Bones (actor 3) and Undying (state 31).


The effect doesn't seem to be working however, so I'm sure I've done something wrong in this code segment. If it matters, the undying state is still being applied by a troop level effect that triggers when Bones (actor 3) reaches 0 HP.


Disregard: it didn't occur to me that restarting the program was a needed step. It works now, thank you.
Disregard: it didn't occur to me that restarting the program was a needed step. It works now, thank you.
saving your project really. all your plugin config changes and notetag edits dont actually take effect until the project has been saved. no need to close the program every time
You do, however, need to start a new play test. Loading a save game after installing plugins or adding notetags won't work correctly.

You may also find that the battle test doesn't work correctly with some plugins.
This thread is being closed due to being reported as solved. If you need it reopened, let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/checking-for-status-condition-in-battle.168208/