MV [Rpg Maker Mv] Yanfly plugin: Target dead enemies and allies.

Good day,
For a while now I have been looking and testing around with Yanfly Target Core and Selection Control to target only Dead enemies and/or allies. several help sections that I found did not do the trick. It fails to 'select' the dead enemy.

What I am looking for is a 'code' that lets me select a dead enemy or/and actor.
I tried this <Custom Select Condition> but this code resulted in an error (no crash).
I am using several of Olivia's plugins, so if we need to check the plugin list or any other info. Please ask.
Spoiler: Code
1714810721608.png
Once I have this code, I can test the rest of my... necromancy spells and see what will happen.

An example why I want this.
I have a spell that I call 'Grave'.
This spell however can be used on both dead and alive characters. (Only dead actors sadly.)
If the spell targets a living creature, the creature will be inflicted with Undeath state.
If the spell targets a Dead creature, the creature will raise from the dead and fight alongside with you for 5 turns.
Spoiler: PS off topic
If you happen to know about a plugin that allows summoning battlers to fight for the player. (not SRD summon actor. It gives me several errors when the summon is removed and dies and hime_enemyReinforcments gives me the Addchild unified error). Let me know <3.

Thank you!
1714811010979.png
_Duck
Hmmmm, selection control has the <Actor or Enemy Select> notetag. Then you can put a select condition that the target is state affected dead. Does that not work?

EDIT: I read your post like you want to target dead actors and dead enemies, but in your example it doesn't seem to be so. Then the above would have to be modified.
As far as your notetag goes, the error is fairly self-explanatory - you're using the variable foes without ever declaring it.

It's also incorrect to be looping through any entire unit in the battle, the Select Condition is evaluated on each individual battler.

I take it you partially copied the code from someplace else?

As rpgLord points out, you can probably do this with the included notetag selection conditions. But if not, this should do what you're asking:
Code:
<Custom Select Condition>
condition = target.isActor() && !target.isDead() || !target.isActor() && target.isDead();
</Custom Select Condition>
@rpgLord69
Sadly <Actor or Enemy Select> does not target a dead enemy even if I change the scope to dead ally.

@ATT_Turan
Correct I found that code on a forum, I been looking around and tried different codes.
This code that you gave me does not target dead enemies for me. It does target dead allies.
Unless I need to choose a different scope along with the code?
Unless I need to choose a different scope along with the code?
Necessarily yes. In the database, there's no selection to allow you to target a dead enemy, so you must be using Yanfly's Target Core for a custom scope.

Are you not?

I think it would work if you have your skill scope set to 1 Ally and added the Target Core notetag:
Code:
<Custom Target Eval>
targets.push($gameTroop.deadMembers());
</Custom Target Eval>

Edit: Wait, I think I misread your original post. I got confused with the "creature" and "character" terminology - is this correct? You want to be able to target:
- dead actors
- dead enemies
- living enemies

If that's correct, erase all the other stuff I gave you. Make the skill Scope 1 Ally (Dead) and add the following notetag:
Code:
<Custom Target Eval>
targets.push($gameTroop.members());
</Custom Target Eval>
I apologize for the misunderstanding.
Yes, you are correct.
- dead actors
- dead enemies
- living enemies
The main goal is to be able to target dead enemies which I am having trouble with.

Your target code only lets me target alive actor and dead actors. But not enemies.
I also tested it with <Enemy or Actor Select> which gave me the result to target Alive enemies, actors and dead actors.

It might be a plugin that is preventing me from targeting dead enemies? I will list down below a list of plugins I am using along with MANY of yanfly plugins that I won't list unless you want me to show you.
(I did put them in order according to this site Yanfly Category.)

Spoiler: Skill
1715020625730.png


Spoiler: Plugin list
Plugins.png
It may just not work without further modification to the code.

By default, there's no way the player would ever be able to target/select dead enemies, so they might not be added to the target list and there's no visual indicator of a way to select them.
It may just not work without further modification to the code.

By default, there's no way the player would ever be able to target/select dead enemies, so they might not be added to the target list and there's no visual indicator of a way to select them.
By default, yes.
That is too bad. I guess I will have to look for a plugin that might give this option.
Thank you for your help.

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mv-yanfly-plugin-target-dead-enemies-and-allies.168331/