RMMV A way to target both Dead and Alive characters in Battle

Status
Not open for further replies.

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
I have a skill I want to make that will use a part of the user's HP to bring a character to life and give them that much HP as well... But I also want it to do the same, minus the bringing to life part, for alive characters as well. Essentially the user uses his life to save his allies.

I used YEP_SkillCore and it works great when used on dead allies... But only if the scope is "1 ally (Dead)", which doesn't allow it to work on alive allies - It works great when used the other way, but can't be used to bring the character to life anymore.

Essentially I need the skill to work on an ally whether that ally is dead or alive.

Is there a way to do this? I've looked through YEP_TargetCore and YEP_SelectionCore and I wasn't able to find the way to do this... Or I should say I thought I did, but it didn't work.

Help Please...
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
in ACE we have used to have Tsukihime Scope Manager for that...

i do some quick search and apparently Tsukihime port 'partial part' of the manager to MV.

and this too (there's a link there to other version):

but i think one ally except self (both dead and alive) is not default scope provided..... you might need to add it yourself.

hope this help though.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
840
Reaction score
470
First Language
Poland
Primarily Uses
RMMV
If you have yanflys plugin and you want to aim at both dead and alive enemies then this should work
Code:
  <Select Conditions>

   condition = target.isEnemy() && target.isDead() || target.isAlive();

  </Select Conditions>
and set scope for that skill "All enemies"
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
@estriole Unfortunately, that's not going to work for me since I'm using MV... But thanks for the reply.

@Soulrender How would I change that so it only affects allies? Or is changing the scope from "All Enemies" to "All Allies" the solution? I'll try it and see.... Thanks.

UPDATE: I tried Sourender's suggestion... I had to change "isEnemy" to "isActor", but it worked - kind of.
I have to still make the skil have a scope of "1 Ally (Dead)" for it to work on the dead guy. I f I set it up for "All Allies" then nothing happens. Also, if I set it up for "1 Ally (Dead)" then is it will target the alive guy, but it won't activate the skill effect on him... nothing happens.

I'm beginning to think that it's not possible to do... I might have to just work on a workaround and hope it comes out with a good result.

How do you retain the target of one skill and automatically use it for another?
 
Last edited:

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
840
Reaction score
470
First Language
Poland
Primarily Uses
RMMV
To target allies you need to negate condition, like this:
Code:
 <Select Conditions>

   condition = !target.isEnemy() && target.isDead() || target.isAlive();

  </Select Conditions>
if you don't see the difference then negating condition is done by adding exclamation mark at the begining of statement:

target.isEnemy() and !target.isEnemy()
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
To target allies you need to negate condition, like this:
Code:
<Select Conditions>

   condition = !target.isEnemy() && target.isDead() || target.isAlive();

  </Select Conditions>
if you don't see the difference then negating condition is done by adding exclamation mark at the begining of statement:

target.isEnemy() and !target.isEnemy()
I tried this and though the effect is that I can now select dead and alive characters, the result is the same. Nothing happens when I try to do the opposite of the scope. If I try to raise a character from the dead without using the "(Dead)" scope then nothing happens. if I try to heal an alive character while using the "(Dead)" scope nothing happens.

It seems to be something in the native code of MV. Something hard wired into it. If the character is dead then only the "(Dead)" scope can target them and only the skill/item with that scope can activate and heal them.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
840
Reaction score
470
First Language
Poland
Primarily Uses
RMMV
Lemme check it in my project. Even though I use these plugins I don't use them in very expert way.
(I prefer as simplest as possible solutions, nothing extravaganza :))

Edit:
Ok, I did some analises of behaviour battle, scope and plugin YEP_X_SelectionControl.js. Main issue is here:
https://prnt.sc/uwlhul - scope of spell's target. Yanfly's plugin allows to select target and my code works, because conditions are met - target is not an enemy, target is alive or target is dead - so selection is valid, but when skill is trying to execute see the scope "Aah, player want's to use spell X on ally, but must be alive". I changed scope to dead ally and goes the same, but spell affects dead friend. So concluding... Some changes in that scope code need to be modified to work it properly.

Perhaps I might be mistaken, because I'm not that much JS coder, but my guess is to edit scope code (just like I fixed items scope function in some of my previous topics.)

Edit2:
Another thing we might check is to use lunatic mode from YEP_TargetCore.js plugin and take this example as pattern
Code:
  <Custom Target Eval>
  for (var i = 0; i < foes.aliveMembers().length; ++i) {
    var member = foes.aliveMembers()[i];
    if (member.level % 3 === 0) targets.push(member);
  }
  </Custom Target Eval>
@firestalker Final EDIT!
This works perfectly:


Code:
<Custom Target Eval>
    $gameParty.members().forEach(function(m){
        if (m.isAlive() || m.isStateAffected(1)){
            targets.push(m);
        }
    });
</Custom Target Eval>
and if you wish to aim at enemies then replace $gameParty with $gameTroop.
 
Last edited:

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
@Soulrender You are my hero! Thank you so much. Just what I was looking for!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top