Yanfly Target Core/Selection Control problem

omega9380

Veteran
Veteran
Joined
Mar 24, 2013
Messages
68
Reaction score
9
First Language
English
Primarily Uses
Having a minor issue with getting my targets right.  I'm using the Undead ability that Yanfly covered in his Tips and Tricks.  What he covered is working fine, any enemy with the Undead state now takes damage when hit with a healing spell.  Here's where I'm having an issue.  I want to do a Final Fantasy-esque Life spell in the same vein as the Undead tip/trick, ie when an Undead enemy is hit with Life, he dies instantly.  I've got that part working using the following notetag using the Skills Core:


<Before Eval>
if ( target.isStateAffected(29) ) target.gainHp(-target.mhp); else if ( target.hp <=0 || target.isDead() ) target.gainHp(1);
</Before Eval>


That works great.  The problem is in the targeting.  When I set the scope of the skill to "1 Ally (Dead)", the spell revives any dead player it hits but it will only target the party.  If I change the scope to Ally, I can select all battlers (enemy and player) but if I cast on a dead character nothing happens.  I tried using the <Actor or Enemy Select> notetag from Selection Control but the same thing happens; I can target anybody including dead allies, but if the skill casts on a dead ally nothing happens.  Any ideas?  Thanks!!!
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
You still need to remove the Dead state before you heal the target.  Healing the target does nothing if the Dead state is still on the target.


Note: When the Dead state is removed, the target should heal 1 HP by default, so adding 1 HP isn't necessary.  Unless you want them to have 2 HP...
 

omega9380

Veteran
Veteran
Joined
Mar 24, 2013
Messages
68
Reaction score
9
First Language
English
Primarily Uses
Would that affect the targeting?  Like I said, that code works for reviving a dead player and killing an undead monster, it's just the targeting that's not working right.  I'll try your suggestion though.  Would you happen to know the code for removing the dead state?
 
Last edited by a moderator:

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
Under the else if statement, add the code:


target.removeState(StateID);
 

omega9380

Veteran
Veteran
Joined
Mar 24, 2013
Messages
68
Reaction score
9
First Language
English
Primarily Uses
Unfortunately this isn't solving my problem.  Restoring the dead character to life works fine, if the Scope is set for Ally (Dead).  Killing an Undead monster works fine, if the scope is set to anything BUT the dead scopes.  My issue is I need to be able to target both a dead ally or a living monster.  If the scope is set for Ally (Dead), you can only target your party.  If the scope is set for anything but Ally (Dead), you can target everyone but if you select a dead player as the target of the skill, it simply casts back on the caster.  I need to be able to set the scope to Ally (Dead) AND still be able to target enemies.  Is that possible with TargetCore?
 

omega9380

Veteran
Veteran
Joined
Mar 24, 2013
Messages
68
Reaction score
9
First Language
English
Primarily Uses
bibbidy bobbidy bump


Still having this issue.  Isn't there any way to make a skill work on a dead ally and a living enemy?
 

Nina888

Veteran
Veteran
Joined
Feb 28, 2016
Messages
79
Reaction score
0
First Language
French
Primarily Uses
I will know how kill a undead with resurection skill or object (and a way for kill stone enemis with a spell or object who cure petrification)


Can you help me please ?
 
Last edited by a moderator:

Nina888

Veteran
Veteran
Joined
Feb 28, 2016
Messages
79
Reaction score
0
First Language
French
Primarily Uses
I maybe a way for solve your request :


Create multi way with state (it solve the boss resistance to death skill for don't make a easy way for kill it)


I do make state who cause death with resistance : state dead and state life (the undead is imune of dead state but life state work on it; the living character is imune to life state but dead state work on it .)


I hope it's work , i do test my idea .
 

Jengamon

Warper
Member
Joined
Sep 4, 2012
Messages
1
Reaction score
0
First Language
English
Primarily Uses
I don't have an answer, but I've been having problems with the <Enemy or Actor Select> tag. No matter what I do, it won't allow me to select both an enemy or an ally for an item.


Situation:


I'm creating a debugging item that simply adds Knockout to whatever it selects. I add the <Enemy or Actor Select> tag to the Notes of the item, but when I go to Battle Test, the item cannot select an enemy if I set Target on the item to 1 Enemy, and it cannot select an ally if I set it to 1 Ally. I've even tried setting the target to None, but that simply uses the item to no avail.


EDIT:


This only happens in a Battle Test...


When using the item in the actual game (using "Playtest" from the "Game" Main Menu rather than "Battle Test..." from the Troop Menu in the Databse), targeting either side works fine. Would this be a bug in MV, or simply an intended feature?


EDIT:


I dunno about this, but the problem fixed itself when I ran the game once.


Reproduction steps:


Create a New MV Game.


Add plugins YEP_BattleEngineCore, YEP_TargetCore, and YEP_X_SelectionControl.


Open Database, and create an item.


Give the item an effect and then add <Actor or Enemy Select> in the Notes section.


Go to the Troop menu, then run the Battle Test with any troop. 


The item will only work on targets specified by the "Scope" field of the Database Item, rather than allowing actors and enemies to be targeted. <-- BUG?


Close the Battle Test.


Close the Database.


Run a Playtest.


Close the Playtest.


Open the Database to the Troops tab, and rerun the Battle Test.


The plugin should now work properly.


tl;dr:


Whoops, figured out what I was doing wrong. I have to save the entire project before it will use it in Battle Test. Playtest simply prompts you to save, which is why it seemed like it was the one fixing the problem, so everyone, remember to SAVE right after adding and removing plugins. It has something to do with js/plugins.js. As long as you don't save, MV won't write that file. I really wish that it asked you to save before battle testing because of this, but what it is is what it is.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top