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

Sirius270

Veteran
Veteran
Joined
May 2, 2020
Messages
33
Reaction score
8
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
524
Reaction score
202
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

Veteran
Veteran
Joined
May 2, 2020
Messages
33
Reaction score
8
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
294
Reaction score
440
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
603
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
869
Reaction score
554
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
294
Reaction score
440
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
869
Reaction score
554
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

Veteran
Veteran
Joined
May 2, 2020
Messages
33
Reaction score
8
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
524
Reaction score
202
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
524
Reaction score
202
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

Veteran
Veteran
Joined
May 2, 2020
Messages
33
Reaction score
8
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

Veteran
Veteran
Joined
May 2, 2020
Messages
33
Reaction score
8
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: 2)

Latest Threads

Latest Profile Posts

Dad's watching a WWII documentary while I work on some cool assets for my games. I just love RPG Maker!
Also Happy Halloween! Dad's friend won't be coming unfortunately, but Dad will still be taking me to Boxi Park to have some fun tonight! I'll be posting a video on my YouTube channel of the show, and I'll be sure to post a link here.
"Nightmares exist outside of logic and there's little fun to be had in explanations. They're antithetical to the poetry of fear. In a horror story the victim keeps asking why, but there can be no explanation and there shouldn't be one..." - Stephen King
I feel people seek explanation and demand it sometimes in games, but in the horror genre, well, maybe you shouldn't have one. Silent Hill 1 comes to mind...
Managed to implement QSprite.

Always double check your plugin order.


Finally! I've been puzzling over why it wasn't working for two days now. Turns out all of my calculations were correct, I just forgot to give some events hitboxes. :kaoswt: Now my randomly generated maps check for collision errors, and move stuff around in real time if they finds any. :LZSexcite:
Ami
--- OP Candy ---

Kids: Trick Or Treat!
Hero: Alright,here's the Candies (Give A Bunch Of Candy).
Kids: Thank you,Mister! (Running)
Hero: How cute they are…
F.Archer: Did you give them a OP Candy,accidently?
Hero: Huh?

Forum statistics

Threads
104,680
Messages
1,008,062
Members
136,169
Latest member
raspudin32
Top