Vampires drink blood

Aloha everyone! I was wondering if there's an effect I can do so only certain actors can benefit from a consumable. Like a Vampire consuming a blood vial for example.
Thank you for your time.
Well, you can build the effect of the item as a Common Event.
Well, what you could do, is give the blood an element, which is only used in vampire positive skills and items (so not damage skills). Now give all characters 1% sensitive to this element. But not the vampire. They should get 100%.

Add the element to all skills and items that benefit vampires.

Now healing for vampires will have very little effect on your actors, but full effect on vampires.

If a character can become a vampire later by a permanent state, then you make the state 1000% and then again 1000%. This should undo the 1% sensitive to vampire positive skills.

The reason to give other actors 1% instead of 0%, is to make this change possible by state. 1000% * 1000 * 0% is still 0%, so 0% would not work.

If the vampire is a class, then you can give the class 100% and the othe classes 0%. Now the item or skill will have 0 effect on non vampires. Since you will no longer have the sensitivity drop as a vampire, there is no reason to keep this at 1%, unless you like to have the skills do little effect to non vampires.

Edit: When using classes, there is no reason for the state. You can ignore the whole 1000% part too. When using classes you can simply change the class when a human becomes a vampire.

If you have classes like warrior, priest etc, you can make a vampire variant of each, like a vampire warrior and a vampire priest.
Or you could have it give a negative state, such as poison, disgust, etc.
Then, just give all your vampires resistance to that status.
In addition to my previous post, when you want to make special states for your vampires, positive or negative, you can simply making the other actors or classes immune to those states.

Maybe the moon gives the vampire nightvision, so it has +125 hit rate at night, or something. That would be a state you could make that only affects vampires. (Youd need a moon system for this specific idea) and another state that causes damage when the sun is out, because vampires cant be hurt by the sun. Again, make all other classes immune for those skills.

You need some kind of day/night cycle to make this work.

-----

You can easily make enemy vampires with this too. They have the exact same benefits and penalties as player vampires. Simply copy all traits of the vampire class, and paste those in all enemies that are a vampire.

Or you could have it give a negative state, such as poison, disgust, etc.
Then, just give all your vampires resistance to that status.
A negative state wouldnt effect the healing though. It might counter it, but non vampires would still heal from drinking blood first. Could be crucial at critical moments.
You can do what @pawsplay suggests and use common events - the trick, for my tastes, would be in the interface.

If I were playing a game, I would expect the game would consider the vampire an invalid target and give me the error beep if I tried to give him a healing potion (or vice versa, giving a non-vampire a bag of blood).

If that's not something that you care about, then cool. For me, I would make a few lines of code so that the interface worked in a predictable way.
If you have more than one vampire, it will take more work to make this seem as seamless as a typical item selection. If you have exactly one, it's pretty straightforward.
If you have more than one vampire, it will take more work to make this seem as seamless as a typical item selection. If you have exactly one, it's pretty straightforward.
How? I don't know of any way natively in RPG Maker to say "this item can't have this specific actor as a valid target."

If that's true, it makes zero difference how many there are, because any code you add to the item targeting can just as simply check for a <vampire> note tag or passive state as anything else.

Am I missing something?
How? I don't know of any way natively in RPG Maker to say "this item can't have this specific actor as a valid target."

If that's true, it makes zero difference how many there are, because any code you add to the item targeting can just as simply check for a <vampire> note tag or passive state as anything else.

Am I missing something?

If there's only one vampire, then you treat using the item as though the vampire was selected. If the vampire isn't eligible or isn't in the party or whatever, you just beep. You can use input choice to confirm.
But if you do this for multiple characters, it will probably look obvious you just couldn't get the standard selection system to do this.
So if it's one item, for one character, I'd be tempted to just event it. If it's any more complex than that, then it would make sense to implement something that can allow you to systematically exclude targets.
I see what you're saying, but...
If there's only one vampire, then you treat using the item as though the vampire was selected.
Again, I would consider that suboptimal UI, as presumably none of your other single-target items actually target the entire party to affect one actor. Similar items should behave the same.

If the vampire isn't eligible or isn't in the party or whatever, you just beep.
How? The only thing I can think of is to have this in a common event which means the player would use the item, see it be successfully used (with the accompanying sound) and then the event could make it beep. I think hearing "Success! No, wait, failure!" would make it worse 😛

As I said above, I guess it depends on how professional you want your game to look.
OTOH, having an item scroll through the various actors when it only ever works for one is a kind of a reification of the interface. Like I said, if it's just one thing, Vial of Blood, and the description is something like, "Blood for Victor to drink," then I think I would just play with the commands to make it feel seamless. not necessarily trying to emulate the normal item selection process, as though I were trying to Anti-Poison someone who isn't poisoned. It's kind of a funny thing to have just one vampire, and pretend like the blood is something just anyone might drink.

Anyway, spitballing here, I think you could have it "cure" a blank status like Vampire, and then reapply it, with very minimal scripting. Maybe even with Passive States? Although I don't know how Yanfly Auto Passive States responds to treating auto states as real states.
OTOH, having an item scroll through the various actors when it only ever works for one is a kind of a reification of the interface.
I understand your point, but that's the expectation with software. Stuff functions consistently.

RPG Maker can only open one kind of file, but you still browse to a directory, see that file, and select it - it doesn't, like, automatically scan for a directory to have a rpggproject inside of it and open just from the folder.

Anyway, spitballing here
Or you can add a few words to code 😉:
Code:
Game_BattlerBase.prototype.meetsUsableItemConditions = function(item) {
    return this.canMove() && this.isOccasionOk(item) && $dataItems[item.id].meta.vampire == this.meta.vampire;
};

This means if you put the <vampire> notetag on an item, it can only be used on an actor who also has the <vampire> notetag.

If vampirism is something you contract during the game so you'd have it as a notetag on a state, that's a minor syntax change.

Although I don't know how Yanfly Auto Passive States responds to treating auto states as real states.
Yanfly has no difference, passive states are real states. But this is an MZ thread, so it would be VisuStella passive states in question.
Or you can add a few words to code 😉:
Code:
Game_BattlerBase.prototype.meetsUsableItemConditions = function(item) {
    return this.canMove() && this.isOccasionOk(item) && $dataItems[item.id].meta.vampire == this.meta.vampire;
};

This means if you put the <vampire> notetag on an item, it can only be used on an actor who also has the <vampire> notetag.

See, that is very nice. However, I'm still at a skill level where I would have to do a fair amount of research to figure out how to structure that piece of code, so I wouldn't necessarily do that unless I was dissatisfied with what I had.
I very much disagree with using common events. A common event would be way too messy, hard to event and very sensitive to bugs

Elements would definitely be my method of choice. It is easy, can be effective in waaaaaaaay more situations than just for the blood, it works on actors and enemies, without any eventing at all.

There wouldn't be a doubt in my mind, I would go for the element.
I very much disagree with using common events. A common event would be way too messy, hard to event and very sensitive to bugs

Elements would definitely be my method of choice. It is east, can be effective in wàaaaaaaaay more situations tgan the blood, it works on actors and enemies, without any eventing at all.

There wouldn't be a doubt in my mind, I would go for the element.

But you get silly situations where someone accidentally drinks human blood.
Then youre down a blood vial, but nothing else would happen.

You could give it a negative state like @TRIDIUM Said, and make the vampire imune.

Then when a hunan drinks blood, he gets sick.
But you get silly situations where someone accidentally drinks human blood
It might actually be a nice touch to give any human drinking human blood the “nauseous” state for x duration.
Oops instead of drinking a Hi-Potion or a smoothie, I drank a vial of human blood! LOL. That would be fine for some games but tonally dissonant for others.
Okay... how would a common event prevent that then?
See, that is very nice. However, I'm still at a skill level where I would have to do a fair amount of research to figure out how to structure that piece of code, so I wouldn't necessarily do that unless I was dissatisfied with what I had.
Or you could do what this user did and take one minute to post a help thread? That's kinda what the forums are for 😛

Original thread: https://forums.rpgmakerweb.com/threads/vampires-drink-blood.159497/