Changing the way items heal based on a skill/state - Healing an actor with poison

Sirius270

Villager
Member
Joined
May 2, 2020
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hello! I'm using Yanfly's Passive States to give myself a passive state from a skill that allows you to heal when you consume poison, rather than taking damage. I'm curious about what I'm doing wrong here, though.
1597016840505.png
1597072829867.png
 
Last edited:

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
417
Reaction score
165
First Language
english
Primarily Uses
RMMV
the note section is for <note tags> added from plugins.
what you have in the notes section should be in damage formula.
b.isStateAffected(X) ? b.gainHp(50) : 50; 0
change X to the ID of the poison absorb state
no passive states required

another way of doing this is if you have element absorb plugins. then you just make poison into an element type and if they have something (like a passive state or equipment) on them that gives element rate into the negative (absorb) it would heal instead of hurt. by default the element rate doesn't go lower then 0 (immune)

edit: you mentioned using passive states plugin but didn't post a screenshot of the state in question or mention how the state is being put on the actor
 
Last edited:

Sirius270

Villager
Member
Joined
May 2, 2020
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
the note section is for <note tags> added from plugins.
what you have in the notes section should be in damage formula.
b.isStateAffected(X) ? b.gainHp(50) : 50; 0
change X to the ID of the poison absorb state
no passive states required

another way of doing this is if you have element absorb plugins. then you just make poison into an element type and if they have something (like a passive state or equipment) on them that gives element rate into the negative (absorb) it would heal instead of hurt. by default the element rate doesn't go lower then 0 (immune)

edit: you mentioned using passive states plugin but didn't post a screenshot of the state in question or mention how the state is being put on the actor
Hello! I tried what you suggested (I've actually done it before, but changed it before posting this question, but I tried it again anyways), and it did not help at all. Now, instead of just taking 50 damage, it shows 0 damage taken, and only does that in the battle screen, the Goblin Meat goes unused in the menu screen.
I did update the original post with a screenshot for where I'm using the Auto Passive States plugin (so that a specific, passive skill gives me the state 159, Iron Stomach).
I tried putting all that script into the damage formula bar, and there was no effect, during the menu screen it just stops at the selection portion and won't use the food. I tried changing "b" to "a" and still nothing. I feel like this should be simple, but it's apparently not. lol. Images in spoiler:
1597073328433.png
1597073532606.png
1597073751755.png
I also tried putting "50" in the damage bar under "HP Damage" and it did nothing, as well (last image in spoiler).
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
241
Reaction score
389
First Language
German
Primarily Uses
RMMV
the damage formula as shown in your looks good, hmm.
Did you try copy-pasting the formula @Tiamat-86 suggested?

b.isStateAffected(X) ? b.gainHp(50) : 50; 0

If that does not work, try this:

if (b.isStateAffected(159)) { b.gainHp(-50); } else { 50 }
(^ that's the one you have, right?)
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
601
First Language
English
Primarily Uses
RMMV
it shows 0 damage taken
If it's coming up as 0 it's either because the syntax is incorrect or because the formula is giving a 0 for the outcome.
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
852
Reaction score
536
First Language
English
Primarily Uses
RMMV
The problem is the 0 at the end. You should instead do this:
JavaScript:
b.isStateAffected(X) ? b.gainHp(50) : 50
And that should work a bit better.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
241
Reaction score
389
First Language
German
Primarily Uses
RMMV
@Doktor_Q you forgot the semicolon after the gainHp(); command

I believe it should look like this:
b.isStateAffected(X) ? b.gainHp(50); : 50
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
852
Reaction score
536
First Language
English
Primarily Uses
RMMV
@Doktor_Q you forgot the semicolon after the gainHp(); command

I believe it should look like this:
b.isStateAffected(X) ? b.gainHp(50); : 50
There is no need for a semicolon after gainHp(), and it could cause other problems potentially. b.gainHp(50) should return no value, ensuring that no damage is dealt.
 

Sirius270

Villager
Member
Joined
May 2, 2020
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
There is no need for a semicolon after gainHp(), and it could cause other problems potentially. b.gainHp(50) should return no value, ensuring that no damage is dealt.
Hello! I copy/pasted the code you instructed into the damage formula and it still did nothing, as before. I then tried it with the semicolon, and that also did nothing. lol.
1597121257546.png
Also, here is a list of my plugins, if that helps:
1597121711972.png
 
Last edited:

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
417
Reaction score
165
First Language
english
Primarily Uses
RMMV
your plugins are no where near being in the correct order.
all yanfly plugins should be in the same order that you see them on yanfly's website.
and plugins made by other people will sometimes also break yanflys plugins so make sure all the plugins you have are compatible
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
417
Reaction score
165
First Language
english
Primarily Uses
RMMV
passive skills shouldnt have a seperate type. if they do have a type that means your character also needs to have that type. but adding skill types to characters gives them extra commands in combat (unless plugin changing the battle commands list)

an easy way to know if you are even gaining the passive state is give it a icon and high priority.
no icon on your character means the passive state isnt being added and its not an issue with the formula
 

Sirius270

Villager
Member
Joined
May 2, 2020
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
passive skills shouldnt have a seperate type. if they do have a type that means your character also needs to have that type. but adding skill types to characters gives them extra commands in combat (unless plugin changing the battle commands list)

an easy way to know if you are even gaining the passive state is give it a icon and high priority.
no icon on your character means the passive state isnt being added and its not an issue with the formula
Hello! I have previously tested the Plug-in order and this is the one that works with all of the different plugins. I have turned each one on and off in different orders to figure it out. All the passive states work, as well. I have tested them. So the game realizes that I have them when the skill is present. I know that I'm getting the passive state.

Edit: I went and added/altered my plugins and put them also in the order suggested by Yanfly. They did not work, even when I turned off the "not Yanfly" plugins. Images of my current setup after turning the non-Yanfly plugins back on:
1597443032787.png
1597443070949.png
 
Last edited:

Sirius270

Villager
Member
Joined
May 2, 2020
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
Any chance I could get some help with this? Really not sure what's going wrong....
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Hello I buyed RPG Maker VX Ace a long ago and I want to use it again but in the meantime I changed my pc but I lost the paper with my product key on so I can't use RPG maker again... someone can help me please ? or there is no hopes ?:'( ( I have a bad english I'm sorry )
I was away this days here in the forum but it was for a good cause!
The trailer of the demo of Luke Inn is on youtube and I am so happy!
I need to see the bugs of the game but I am happy that I have new content to show!

The last part of the modern interior will be ready soon. This will be a B-tile. With interior items for the kitchen, bathroom, toilet and storage room.
This frantic shooting ARPG plugin for MZ looks really great. Here is the link to a post from the official Japanese RPG Maker forum.

Forum statistics

Threads
102,941
Messages
996,122
Members
134,394
Latest member
tp0000
Top