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
676
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,706
Reaction score
2,807
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
676
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



Here's the combat sprite of Azrael one of the main characters of our game,
with and without weapon.
https://discord.gg/Q2uS6Str
The one thing I've always struggled with is creating a story, it halts every single project I've ever worked on. We must be in the twilight zone because I've actually come up with a plot, from beginning to end (it kinda wrote itself). I may very well be on my way to creating my first proper little game, yay!
Oh, wow!
6VDEms4.png


Still need one or two "placeholder" asset things and then I'm venturing into custom windows + menus!
(I'm a little scared, lol)
In the past hour I've both joined and left the RPG Maker subreddit. So many memories were made. Power to the gam mak!

Forum statistics

Threads
113,686
Messages
1,076,657
Members
147,710
Latest member
Pichenotte3
Top