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,274
Reaction score
674
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,699
Reaction score
2,800
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,274
Reaction score
674
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 Posts

Latest Profile Posts

PSA: please stop putting the word 'Eternal' in your game titles.
RMMZ: "Simple enough for a child!"
also RMMZ: "What, you're trying to make an RPG and you didn't know about Euler angles?"
I kinda spent the day having my own little gamejam and came up with this Catastrophe!

GZOq45s.png
Have Defeated Enemy Join Party as Actor, Show Passage Status, & MZ-Chan Art | RPG Maker News #107

My outfit at Metrocon. It was fun.

Forum statistics

Threads
113,625
Messages
1,076,286
Members
147,638
Latest member
Zachimera
Top