Psychronic

Veteran
Veteran
Joined
Aug 5, 2018
Messages
126
Reaction score
104
First Language
English
Primarily Uses
RMMV
I am having an issue in my game where I am trying to make it so that some healing items only heal certain classes (or will only heal certain characters too would work). I am wondering if there's a plugin to do this or whether it's done with common events. I've tried with common events but it has certain odd behavior. Let me use an example from my game.

My game is a sci-fi game, in the game you have human characters, alien characters, cyborgs, robots, androids.

I want to make it so that an item called "jumper battery" revives only synthetic characters, but I want an item called epinephrine shot to only work on human characters.

I tried Yanfly's "Item Restrictions" plugin, but that seems to be more geared toward restrictions USING the items rather than a restriction on who can be healed by a certain item or not.

Any Suggestions?
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
11
First Language
English
Primarily Uses
RMMV
There are two ways of going about this, using either Yanfly's Skill Core or his Selection Control (requires Target Core) plugins.

Skill Core makes use of Pre-Damage Evals:

<Pre-Damage Eval>
if (b.isClass($dataClasses[x]) || b.isClass($dataClasses[y]) || b.isClass($dataClasses[z])){
value = 0;
}
</Pre-Damage Eval>
and so on until all relevant classes are covered. "||" means Or in javascript.

Selection Control makes use of targeting:

<Custom Select Condition>
if (target.isClass($dataClasses[x]) || target.isClass($dataClasses[y]) || target.isClass($dataClasses[z])){
condition = true;
} else {
condition = false;
}
</Custom Select Condition>
and so on until all relevant classes are covered.
 

Psychronic

Veteran
Veteran
Joined
Aug 5, 2018
Messages
126
Reaction score
104
First Language
English
Primarily Uses
RMMV
There are two ways of going about this, using either Yanfly's Skill Core or his Selection Control (requires Target Core) plugins.

Skill Core makes use of Pre-Damage Evals:

<Pre-Damage Eval>
if (b.isClass($dataClasses[x]) || b.isClass($dataClasses[y]) || b.isClass($dataClasses[z])){
value = 0;
}
</Pre-Damage Eval>
and so on until all relevant classes are covered. "||" means Or in javascript.

Selection Control makes use of targeting:

<Custom Select Condition>
if (target.isClass($dataClasses[x]) || target.isClass($dataClasses[y]) || target.isClass($dataClasses[z])){
condition = true;
} else {
condition = false;
}
</Custom Select Condition>
and so on until all relevant classes are covered.

Wow you're a lifesaver. I will try this and let you know!
 

Psychronic

Veteran
Veteran
Joined
Aug 5, 2018
Messages
126
Reaction score
104
First Language
English
Primarily Uses
RMMV
It works! Thank you! The only thing I'm stuck on now is that if you try to use the item on the wrong class, nothing happens (as it should be), but one of the items is consumed anyway. I'd like to have something like you try to use the item on the wrong person and it goes "sorry, can't do that on organic characters".

Under the part where it says "else", that's where I figure I could insert a message that says that, and then adds +1 of the item into the inventory so that one item wasn't consumed. But not sure if there's a way to do that.

It's at least satisfactory now/works. But would be great to figure out the other way too. I ended up using the Custom Select Condition plugin.
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
11
First Language
English
Primarily Uses
RMMV
What I'm wondering is how you're able to use an item on an actor of an incorrect class if they're unselectable? The false result in the select condition means the actor with that class cannot be targeted by the skill or item; unless you're referring to the Pre-Damage Eval?
 

Psychronic

Veteran
Veteran
Joined
Aug 5, 2018
Messages
126
Reaction score
104
First Language
English
Primarily Uses
RMMV
I am using the <Custom Select Condition>. What happens is that every character is selectable, but if I try to use it on a character that it can't be used on, the character using the item steps forward, nothing happens, but 1 of the items is gone. But the battle continues normally after that.

If I try to use the item on a valid character, it uses the item normally without a problem. It's mostly working, just this last part I guess.

Again though, thanks for your help! I'd be further behind without it.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

0YJJJiG.gif
kkSYWES.gif
0YJJJiG.gif

Working on some fan assets! I won't share them all just yet, but it's a fun practice! (So maybe keep an eye out for a thread for them in the future?) :kaohi: These boyos are Pink Slimes and a Tabby Slime from Slime Rancher.​
Just dropped the trailer! Link to download and play is in the description!

Showcasing Plugins that Record Video, and Take Screenshots. :LZScheeze:

Forum statistics

Threads
108,928
Messages
1,040,695
Members
141,392
Latest member
lalulu
Top