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
321
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,293
Reaction score
4,246
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
321
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,293
Reaction score
4,246
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
321
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,293
Reaction score
4,246
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
321
Reaction score
135
First Language
Indonesian
Primarily Uses
RMMZ

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,293
Reaction score
4,246
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
321
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,293
Reaction score
4,246
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,841
Reaction score
5,890
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

KDS
Hey guys! Iam currently updating my free digital art shop , let me know if you need anything done :) https://forums.rpgmakerweb.com/index.php?threads/kds-free-open-digital-art-shop.17097/
Hello! I’d like to ask where is a good place to start logging about my game dev progress as production of my game goes forth
In one of our campus classrooms was a bag full of stuff people forgot there... my bag. That I forgot there xD
You know your room is too tiny for how much stuff you have when it gives you literal insomnia. I just cleared a bunch of stuff out and man it feels good!
1670381555475.png
Meet the Kernel. You encounter him in cyberspace. He's important!

Forum statistics

Threads
127,099
Messages
1,183,967
Members
167,028
Latest member
Edujandro
Top