XthenewB

Villager
Member
Joined
Apr 5, 2020
Messages
9
Reaction score
0
First Language
german
Primarily Uses
RMMV
Hi all.

I want to make a skill that only aim one enemy which has a certain state.
But if the enemy with the state is already dead, and there are no potential enemies, it should aim itself instead.

So, the skill checks out if one of the targets have the state, if not it targets the user.

I have used SelectionControl by Yanfly to create the target condition for the skill, to aim only the enemy with the state.
The Problem is, I don't know how to make the skill target the user, if the enemy with the state is dead.

(btw. this will be an enemy skill and the targets are the actors)

Is it possible to do this at all? Maybe with Custom Select Conditions?

THX
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,282
Reaction score
682
First Language
English
Primarily Uses
RMMV
You could try:
Code:
<Custom Select Condition>
if (target.isStateAffected(stateID) || target==user)
    condition=true;
else
    condition=false;
</Custom Select Condition>
where "stateID" is the ID they need to be affected with.

However, I'm not sure it will work because I don't see a way to set the scope to allow an enemy to target an ally as well as an enemy.
 

XthenewB

Villager
Member
Joined
Apr 5, 2020
Messages
9
Reaction score
0
First Language
german
Primarily Uses
RMMV
Hey, thx for the answer @ATT_Turan !
I've tried the code out. Unfortunately it doesn't work correctly.
It hits the enemy with the state, but if the mentioned enemy is dead, it just do nothing.

Btw. does this (target.isStateAffected(stateID) || target==user) mean, that the target is the user and the target the same time?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,707
Reaction score
2,808
First Language
English
Primarily Uses
RMMZ
Hey, thx for the answer @ATT_Turan !
I've tried the code out. Unfortunately it doesn't work correctly.
It hits the enemy with the state, but if the mentioned enemy is dead, it just do nothing.

Btw. does this (target.isStateAffected(stateID) || target==user) mean, that the target is the user and the target the same time?
|| is "or", so read it as "if the target is affected by the state with ID X OR if the target is the user of the skill"
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,282
Reaction score
682
First Language
English
Primarily Uses
RMMV
It hits the enemy with the state, but if the mentioned enemy is dead, it just do nothing.
That's what I thought. That's because the scope of the skill can only be set to some number of enemies or some number of allies, and the Yanfly plugins don't provide any way to change that - so it will never consider allies and enemies as targets for the same skill.

You might be able to code it in with a possibly convoluted Action Sequence.
 

Latest Threads

Latest Profile Posts

I got the pause Icon to use 6 frames instead of 4, PLUS it goes: top 1-2-3, bottom 1-2-3. And everything just by playing around with the code & i think i've figured the important parts out now <3
eUuH09A.gif

ps. the animation isn't as "wonky" in RL, stupid recording -.-
Friendly reminder: Make a back up of your project! ;3 I just did one and recognized I would have lost a week worth of work.
Why is there undo but not a redo like every other software in existence? :blink:
Chili: Evolved to taste spicy so no animal would eat them.

Humans: "Jokes on you ..."

Forum statistics

Threads
113,717
Messages
1,076,890
Members
147,746
Latest member
Sattakingcompany
Top