Some help with Yanfly's Buff and State Core

Status
Not open for further replies.

Winek

Villager
Member
Joined
Apr 12, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hey, I think it's the proper place to post (not sure since I'm new here) but I'd need help for a lunatic mode of the said plugin.

Basically, I want to make a skill that give a poison to an enemy. If the enemy bear the poison as they die, a random foe will be chosen and given the state as well. (Think of something like infections)

So here's what I got:
<Reapply Ignore Turns>
<Custom Respond Effect>
//Check if the enemy is dead
if (user.hp <= 0) {
// Get a random enemy
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)]
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Respond Effect>

<Custom Action End Effect>
//Apply poison effect
var dmg = (115 + a.def * 90) + (a.atk * (0.50 + a.def * 0.005) + a.mat * (0.50 + a.def * 0.005)) * a.def;
user.gainHp(-Math.ceil(dmg * user.elementRate(8)));
user.startAnimation(146);
user.startDamagePopup();
//Check if the enemy is dead
if (user.hp <= 0) {
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)];
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Action End Effect>

This SHOULD be working, but I encounter two problems:

First, if I kill the foe without if falling for poison, like using a spell on it (first part), strictly nothing will happen. I'm trying to figure
out why, but can't seem to get it! I mean, it's literally the same as the second part without the poison.

Secondly, the most gruesome: in the second part, it only partly works. If an enemy dies from the poison, they will collapse and pass over the state to another enemy, sometimes even creating a chain. Sadly, there is ONE problem that pisses me off badly.
If there is only one other enemy when the infected enemy dies, this part never applies and I have no idea why.

if (member) {
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}

The one before applies, I tried putting some random stuff in it and it does apply. So basically if there's only two enemies when the infected one dies, he just stay in place, never collapse nor pass over the state.

I think it's weird because I have a similar spell that hits one enemy then another random one. If the first hit killed the first enemy,
the randomly chosen enemy will take similar damages. I'm using a lunatic code very similar to it and never ever faced this problem, as it works perfectly if there are two enemies. Have a look:

<Post-Damage Eval>
var elementId = 3;
var damage = value;
if (target.hp <= 0){
var damage = damage * 2;}
var members = this.opponentsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)];
if (member) {
member.startAnimation(141);
member.gainHp(-Math.ceil(damage * member.elementRate(elementId)));
member.startDamagePopup();
member.clearResult();
if (member.isDead()) {
member.performCollapse();}}
</Post-Damage Eval>

Could anyone look up to it? I'd really love to get some help on that.
 

EisiG.R

Villager
Member
Joined
Jan 19, 2017
Messages
11
Reaction score
13
First Language
French
Primarily Uses
N/A
hello, I think you need to put you transmition effect in your death state like yanfly do for the phoenix ring

 

Winek

Villager
Member
Joined
Apr 12, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hey, I tried that methods, but it sadly doesn't work for the only reason that other states are removed upon death, thus making it impossible for me to actually check the state and infect someone. Yanfly's video is about an item, and these stay after death... But thanks for your time anyway!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,363
Reaction score
7,673
First Language
German
Primarily Uses
RMMV
Hey, I think it's the proper place to post (not sure since I'm new here)
Unfortunately you were wrong, but that is no problem
[move]Plugin Support[/move]
Please give a link to the plugin, so that people don't need to search it for crosschecks
 

Winek

Villager
Member
Joined
Apr 12, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
i really thought i was right qq

http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
Here's Yanfly's buff and state core.

I'm still mainly trying to figure out the problem number two. The number one is probably because states are removed upon death, making it never
really check in the first place... Does anyone have an idea how to turn around that? And well I'm still struggling with my script not working if there is only 2 enemies.
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,704
Reaction score
2,208
First Language
English
Primarily Uses
RMMV
Game_Battler.prototype.die() does 3 things.
  1. Set HP to 0
  2. Removes all buffs
  3. Removes all states
You could make a plug-in that overwrites this function and comments out the remove States part. If you do though, anyone brought back to life will likely still have whatever States they had when they died. Maybe you could also overwrite the revive() function and shift the code there.
 

Winek

Villager
Member
Joined
Apr 12, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
http://yanfly.moe/2016/04/03/yep-89-state-categories/

Yanfly's State Categories plugin allows states to remain on a target even after death. Just use <Category: Bypass Death Removal> in the state and it will remain after death.
I used it, nothing happens... it's the same as before. :/

I tried with multiple Custom xx Effect and really nothing happens if the enemy doesn't die from the poison qq
<Reapply Ignore Turns>
<Category: Bypass Death Removal>
<Custom Deselect Effect>
//Check if the enemy is dead
if (user.hp <= 0) {
// Get a random enemy
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)]
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Deselect Effect>

Also, it seems that the foe won't pass over the poison if it is alone or with only one other member when it dies from the poison, not just when there are two of them... Just what is wrong with my script qq

Game_Battler.prototype.die() does 3 things.
  1. Set HP to 0
  2. Removes all buffs
  3. Removes all states
You could make a plug-in that overwrites this function and comments out the remove States part. If you do though, anyone brought back to life will likely still have whatever States they had when they died. Maybe you could also overwrite the revive() function and shift the code there.
I would just need something to be JUST before removing the state...
 

Winek

Villager
Member
Joined
Apr 12, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hey, I've given up, this is too hard for me. The <Category: Bypass Death Removal> doesn't work at all and this actually makes me block in game
since I have to do skills/state in order. I've changed it for a smaller poison with other methods of spreading other than death. Regardless, thanks to everyone that helped me!
 

Ms Littlefish

Dangerously Caffeinated
Global Mod
Joined
Jan 15, 2014
Messages
6,417
Reaction score
8,102
First Language
English
Primarily Uses
RMMV

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.

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

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,858
Messages
1,017,023
Members
137,565
Latest member
Callmelogann
Top