I have tried every variation of making this work that I can think of but nothing ever works. And the built in conditions tab doesnt have an option for enemy state. But I would like it to spawn an image when the enemy is poisoned.
Conditional Branches in Battler
RPG Maker MZ SupportFirst, "Don't run" comes from the programming term "to run a program".
It means a troop event with that setting will NEVER be executed.
You NEED a condition for any troop event to work at all.
Second, the span determines how often a troop event can be used - once per battle, once per turn, once per action (moment). With span = battle the troop event would only be processed the first time the main condition is true, no matter if the enemy is poisoned or not.
Depending on what the picture is supposed to show, the best settings would be condition Turn End and span = turn, or if it had to be a reaction then enemy HP <=100% (always true) and span = moment.
But that second variant can create the lag of hell if used wrong, I strongly advise against that.
It means a troop event with that setting will NEVER be executed.
You NEED a condition for any troop event to work at all.
Second, the span determines how often a troop event can be used - once per battle, once per turn, once per action (moment). With span = battle the troop event would only be processed the first time the main condition is true, no matter if the enemy is poisoned or not.
Depending on what the picture is supposed to show, the best settings would be condition Turn End and span = turn, or if it had to be a reaction then enemy HP <=100% (always true) and span = moment.
But that second variant can create the lag of hell if used wrong, I strongly advise against that.
The screenshot is just to show the event, I have tried every way to do it ( I mentioned that in the text ) including using common events, setting the main condition to like turn 0 so on and so forth.
The problem is that the conditional branch, where it is checking for the state to be true, does not work. Regardless of the settings. It is only when there is no conditional branch that an event takes place. IE (player health at 30%) but that is too straight forward and does not account for states.
(it also does not work for anything, play SE, show picture EXT)
Edit: or any way of getting conditional branches to work in battles would be awesome.
conditional branches DO work in troop events.
if they don't for you, then there are only two possibilities:
1) Your project's battle interpreter has been damaged or modified by a plugin or something else
2) you're using them in the wrong way
For checking 1) we would have to see screenshots of your plugin manager and other details
as for 2), there is one main problem that has caused problems in the past for people trying to use enemy-specific commands, and that is the way the indices work. You can see that especially when using enemy commands in a common event.
The EDITOR is sometimes unable to directly identify an enemy, especially when there is no specific troop connection. That is why the list of the eight enemy indexes does not always list the enemy name.
For these cases you'll need to keep in mind that the index is usually assigned in the order in which the enemies are added, and different for different troops.
In your specific case I'm wondering why you're using index 4 already despite only one enemy being visible on the screenshot. Can you explain that and give a list on all enemies in that troop?
Additionally, I forget to ask before:
where and how are you testing?
Please do NOT use the battletest of the database, but make an evented battle on your start map to test in game.
The problem here is that the database battletest skips part of the game setup to go into the battlescreen faster. And while that works perfectly without plugins, it is also known that a lot of plugins require the setup of 'new game' during playtest to function correctly.
So as soon as you use battleplugins to change the battlesystem, the database battletest has a high chance of adding bugs into your battles - simply because it skips code it should not skip for those plugins.
EDIT: So I did get it to work by having the tab condition to be activated by a switch. My only problem now is that if I try and use the "moment" span the battle wont go beyond the initial screen, it doesn't freeze, but it doesn't progress. Which isn't ideal but is probably a separate issue.
Moment span troop events are like autorun map events. As long as its condition is true, the game is running the event and only the event. It'll block every other process in the game as long as that condition is true and will only stop once it stops being true.
ahh indeed, I attached a sound effect to test that and I almost died.
I don't think what I wanted to do is very effective, it would be fine if it weren't for the wait time between turns and I'm not sure what kind of unraveling I would have to resolve it so that the state condition is checked immediately.
if you use a plugin for advanced state options, you could have the state process a notetag eval turning the switch on if it is successfully imposed on its target.
that switch would then activate the span=moment troop event, and in the troop event itself you add a control switch =off at the end to ensure the troop event runs only once instead of permanently.
that switch would then activate the span=moment troop event, and in the troop event itself you add a control switch =off at the end to ensure the troop event runs only once instead of permanently.
Original thread: https://forums.rpgmakerweb.com/threads/conditional-branches-in-battler.178990/