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,307
Reaction score
703
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,711
Reaction score
2,823
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,307
Reaction score
703
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

Let's continue making our game in MZ! Touchfuzzy is... still eventing... though this time we may be working on eventing some tutorial stuff for our players!

I work late on the game so I sleep in then I wake up late so I have to work hard to make up for sleeping in meaning I work late again and sleep in again... what a nasty cycle.
I just had my first real fire. Dad made burgers for lunch and the grill caught fire. He tried to get water but I told him you should never put water on a grease fire. So I got him the fire extinguisher under the sink and we managed to put it out. I can still smell a little of the smoke coming from the patio, but at least it's clearing. It sure was scary though.
was rendering a video and window decided to bsod on me :D fun
Could not for the life of me figure out how to implement the dual/triple techs in Touch the Stars in a player-friendly way. Was describing all the problems to my wife and just rubber-ducked a solution that should work brilliantly.

Forum statistics

Threads
113,842
Messages
1,077,894
Members
147,912
Latest member
RasenNinja
Top