RMMZ How to make that you can't use this skill unless enemy have "X" state ID

Status
Not open for further replies.

Jrrkein

Drago Royale
Veteran
Joined
Apr 20, 2014
Messages
320
Reaction score
135
First Language
Indonesian
Primarily Uses
RMMZ
I'm using VISUAL Stella skillstate core and I want accomplish this.

I want to make certain skill can't be used unless enemy have like poison state. I'm no JS expert. Would anyone mind helping me to accomplish this.
 

FarOutFighter

Veteran
Veteran
Joined
Sep 20, 2021
Messages
138
Reaction score
88
First Language
English
Primarily Uses
RMMZ
You can mostly do this within the damage formula. This is a very helpful guide. It would make it so that a skill only does damage (and other things that can be done within the damage formula) if the target has x state, whichever state you want.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,216
Reaction score
4,195
First Language
English
Primarily Uses
RMMV
You can mostly do this within the damage formula.
The problem with that idea - it doesn't stop the enemy from using the skill, it just stops/changes the damage being dealt.

And if there are other effects attached to the skill, such as applying states, a common event, it can't prevent any of those from within the damage formula.

I want to make certain skill can't be used unless enemy have like poison state.
One solution for you is to use VisuStella's Battle Core. It has the JS Targets notetag. So you could do:
Code:
<JS Targets>
targets=$gameParty.aliveMembers().filter(member => member.isStateAffected(X));
</JS Targets>
where X is the ID of your poison state.

If you want to get a bit more sophisticated, you could see if Yanfly's Battle A.I. Core is compatible with FOSSIL, as it lets you get much more in detail with what enemies do under which conditions.
 

Jrrkein

Drago Royale
Veteran
Joined
Apr 20, 2014
Messages
320
Reaction score
135
First Language
Indonesian
Primarily Uses
RMMZ
How about enemies? I want the skills for actor unable to target the enemy unless enemy have state like poison
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,216
Reaction score
4,195
First Language
English
Primarily Uses
RMMV
How about enemies? I want the skills for actor unable to target the enemy unless enemy have state like poison
Just replace $gameParty with user.opponentsUnit() and then it works for actors and enemies.
 

Jrrkein

Drago Royale
Veteran
Joined
Apr 20, 2014
Messages
320
Reaction score
135
First Language
Indonesian
Primarily Uses
RMMZ
Somehow it still targets even enemy without the state
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,216
Reaction score
4,195
First Language
English
Primarily Uses
RMMV
Are you testing in a new game? Using the editor's Battle Test or loading a save game may not work correctly.

Otherwise, post screenshots of your skill in the database.
 

Jrrkein

Drago Royale
Veteran
Joined
Apr 20, 2014
Messages
320
Reaction score
135
First Language
Indonesian
Primarily Uses
RMMZ

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,216
Reaction score
4,195
First Language
English
Primarily Uses
RMMV
For future reference, that's pretty hard to read. I appreciate you wanted to show what the entire line of code says, but chopping up these tiny segments instead of just posting an actual screenshot makes it impossible to see if there's some other setting in the skill that might be affecting it.

And you have the Battle Core plugin installed? I don't know what else to say...someone else more familiar with the plugin might have a better idea.
 
Last edited:

Jrrkein

Drago Royale
Veteran
Joined
Apr 20, 2014
Messages
320
Reaction score
135
First Language
Indonesian
Primarily Uses
RMMZ
For future reference, that's pretty hard to read. I appreciate you wanted to show what the entire line of code says, but chopping up these tiny segments instead of just posting an actual screenshot makes it impossible to see if there's some other setting in the skill that might be affecting it.

And you have the Battle Core plugin installed? I don't know what else to say...someone else more familiar with the plugin might have a better idea. Am I doing something wrong @Arthran, @Trihan?
yes I have it installed.

<JS Targets>
targets=user.opponentsUnit().filter(member => member.isStateAffected(4));
</JS Targets>
<BTB BP Cost: 2>
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,216
Reaction score
4,195
First Language
English
Primarily Uses
RMMV
targets=user.opponentsUnit().filter(member => member.isStateAffected(4));
This is incorrect - you took away the aliveMembers() portion.

It should read targets=user.opponentsUnit().aliveMembers().filter(member => member.isStateAffected(4));
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,840
Reaction score
5,877
First Language
english
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

no longer using rm2k3
Don't you hate when you're trying to sleep and suddenly the smoke detector needs batteries? That's exactly what happened to me. Now I'm sluggish and tired after that darn thing started chirping at 11:30 at night. Man I wish I had one of those smart smoke detectors that sends a message to your phone way before it starts chirping.
Interior of a bus, may do more vehicle interiors :kaoswt2:
1670089782219.png
I can hardly believe it is the third day of Christmas and I have yet to put up decorations! Spending my morning cooking breakfast and getting them up.
https://itch.io/s/83641/1-week-sale Do you want a Roguelike game like a turn-based Hades? Get Zodiac Hunters now while it's on sale!

Forum statistics

Threads
127,013
Messages
1,183,192
Members
166,875
Latest member
LottaSpice
Top