Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,768
Reaction score
2,894
First Language
English
Primarily Uses
RMMZ
You could add a Custom Turn Start Effect to the state that updates the value.
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
92
Reaction score
25
First Language
Portuguese
Primarily Uses
N/A
After a few tests, here's the result.


Code:
<Custom Passive Condition>
  if ($gameParty._actors.contains(3))
  {condition = true;} else {condition = false;}
</Custom Passive Condition>

<Custom Apply Effect>
  target._IvannaAffinityBonus = ((($gameActors.actor(3).param(3) * 0.10) / 100) * $gameVariables.value(3));
  target._paramPlus[3] += target._IvannaAffinityBonus;
</Custom Apply Effect>

<Custom Remove Effect>
  target._paramPlus[3] -= target._IvannaAffinityBonus;
</Custom Remove Effect>

Runs smoothly and perfectly. Thanks a LOT!
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
92
Reaction score
25
First Language
Portuguese
Primarily Uses
N/A
So... I was trying to be polite and wait for someone else to ask for help, but both for being excited with Trihan's helpful codes and for the sake of BUMPing, I'll excuse myself and ask for some more help!

Any idea on how to make a "perfect shield" state that nullifies the next attack/spell/effect targeted into the character and then removes itself?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,768
Reaction score
2,894
First Language
English
Primarily Uses
RMMZ
So... I was trying to be polite and wait for someone else to ask for help, but both for being excited with Trihan's helpful codes and for the sake of BUMPing, I'll excuse myself and ask for some more help!

Any idea on how to make a "perfect shield" state that nullifies the next attack/spell/effect targeted into the character and then removes itself?

Code:
<custom react effect>
value = 0;
target.removeState(Id of perfect shield state);
</custom react effect>
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
92
Reaction score
25
First Language
Portuguese
Primarily Uses
N/A
by changing "value" to 0, the damage is nullfied, huh? And for the effect immunity, all i gotta do is make the "Perfect Shield" to give resistance against states, is that it?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,768
Reaction score
2,894
First Language
English
Primarily Uses
RMMZ
Ah yes, sorry. Just add 100% resistance to all negative states to the Perfect Shield state and that'll take care of that part without needing anything extra in terms of notetags.
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
92
Reaction score
25
First Language
Portuguese
Primarily Uses
N/A
I have taken the liberty of changing a few things about the Perfect Shield state, and here's the final result.

I gotta say, thanks again for being so capable and helpful!

For those interested, here's the "Perfect Shield" state, that nulifies damage and then removes itself.
Code:
<custom react effect>
  value = 0;
  target.removeState(51); //Perfect Shield's State.
  target.startAnimation(160); //Perfect Shield's Removal Animation.
</custom react effect>
 
Last edited:

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
92
Reaction score
25
First Language
Portuguese
Primarily Uses
N/A
Now for a "Element Eater" state!

How to check the element of the damage taken and, if it's a specific element, the damage gets converted into a TP gain?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,768
Reaction score
2,894
First Language
English
Primarily Uses
RMMZ
Sorry Paulo, I missed this one.

Code:
<Custom React Effect>
let eatElements = [IDs of elements to convert here];
if (this.getItemElements().some(element => eatElements.contains(element))) {
  let tpGain = value;
  value = 0;
  target.gainTp(tpGain);
}
</Custom React Effect>
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
I always struggle with checking if equipment is equipped.

Im trying to make an accessory or shield that adds effects to guard;
ex:
Shield of mockery- adds taunt state when using guard.
Holy charm- restores 5% hp when guard is used.

I dont know the script that checks the user and not actor id, is it user.equips()?
also dont know how equipment is checked at all lol.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,768
Reaction score
2,894
First Language
English
Primarily Uses
RMMZ
You're thinking of it slightly backwards: you don't check whether the equipment is equipped, you add a passive state to the equipment that checks whether Guard was used.

Put a <Passive State: X> tag on your shield and charm, where X is the ID of a state you're about to create. You'll need one for each effect; call them "mockery effect" and "holy charm effect" or whatever is most helpful for you.

For mockery effect, the notetag you want on the state is:

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.addState(ID of taunt state);
}
</Custom Initiate Effect>

For the Holy Charm, it'll be

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.gainHp(Math.floor(user.mhp * 0.05));
}
</Custom Initiate Effect>
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
You're thinking of it slightly backwards: you don't check whether the equipment is equipped, you add a passive state to the equipment that checks whether Guard was used.

Put a <Passive State: X> tag on your shield and charm, where X is the ID of a state you're about to create. You'll need one for each effect; call them "mockery effect" and "holy charm effect" or whatever is most helpful for you.

For mockery effect, the notetag you want on the state is:

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.addState(ID of taunt state);
}
</Custom Initiate Effect>

For the Holy Charm, it'll be

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.gainHp(Math.floor(user.mhp * 0.05));
}
</Custom Initiate Effect>

Wow, thanks. I did not think of it lol, guess im going to have lots of passive states :)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,768
Reaction score
2,894
First Language
English
Primarily Uses
RMMZ
Alternatively, you could put passive states on the actors that do all the equipment checks, but that might get a bit wordy in the notebox.
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
Hey Trihan,
Been trying to figure something out with no success.
I'm trying to make a multi hit skill that if defeats an enemy will continue on to the next "proper" target if any.

I have an attack that hits 4 times the front row enemies, if on the second hit all enemies in the front row are dead the remaining two hits will continue on enemies in the second row.
 

41728280

Veteran
Veteran
Joined
May 31, 2020
Messages
240
Reaction score
73
First Language
Chinese
Primarily Uses
RMMV
Hello Trihan, I want to add a function to display the SV battle graph of party members in the MOG_SceneMenu plug-in code.
What should I do?
 

Vis_Mage

Wisp Charmer
Veteran
Joined
Jul 28, 2013
Messages
705
Reaction score
228
First Language
English
Primarily Uses
RMMV
Hey,

If you are still accepting requests, could you help me out with a few passive state notetags? (I'm using Yanfly's Auto Passive States, as well as Buff and State Core, if that would help as well)

1. A state that recovers the owner's HP by 5% each time a party member is defeated in battle.
2. A state that, if variable 1 is greater than or equal to variable 2, grants a 5% MAT boost, otherwise grants a 5% MDF boost.
3. A state that boosts ATK by (Variable 1 multiplied by 3)%.
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
144
Reaction score
42
First Language
English
Primarily Uses
RMMV
Hi Trihan, thanks for starting this thread. A question on "integrating" Yanfly's plugin with non-YEP plugins. I am currently using YoraeRasante/Waterguy's New Parameters plugin to create custom parameters (e.g. "skill", "dexterity", etc). However, I am not sure how to add them to YEP Stat Allocation. Not sure if this is even possible though?
 
Last edited:

deus69xxx

Villager
Member
Joined
Oct 13, 2013
Messages
25
Reaction score
9
First Language
English
Primarily Uses
RMMV
I have a question similar to Vis_Mage: is there a way to have a state increase the damage dealt by the character by a %?

working on an 'offense/defense' state swap via skill. defense reduces damage taken and dealt, offense increases damage taken and dealt. i can increase damage taken, but i can't seem to figure a way to increase damage dealt.

Code:
<Custom React Effect>
value *= 1.25;
</Custom React Effect>

i would assume it looks similar to that, but i haven't found a listing for states that works on an action step by the user with the state.
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
I have a question similar to Vis_Mage: is there a way to have a state increase the damage dealt by the character by a %?

working on an 'offense/defense' state swap via skill. defense reduces damage taken and dealt, offense increases damage taken and dealt. i can increase damage taken, but i can't seem to figure a way to increase damage dealt.

Code:
<Custom React Effect>
value *= 1.25;
</Custom React Effect>

i would assume it looks similar to that, but i haven't found a listing for states that works on an action step by the user with the state.

Have you tried:
<Custom Confirm Effect>
value *= 1.25;
</Custom Confirm Effect>
This effect will run when the battler connects a hit and before damage
execution occurs. This effect will run after <Custom Initiate Effect> and
<Custom Select Effect> and before everything else.

React is for when you are the source of damage.
<Custom React Effect>
value -= 100;
value -= user.def;
</Custom React Effect>
This effect will run when the battler is selected as a target. This will
occur only if the action connects and will occur before damage execution.
This effect will run before damage calculation occurs and will return the
'value' variable as a damage modifier. After <Custom Confirm Effect>, this
effect will run.
 

deus69xxx

Villager
Member
Joined
Oct 13, 2013
Messages
25
Reaction score
9
First Language
English
Primarily Uses
RMMV
@Icenick Thank you! i wasn't sure confirm effect was even available for states xD

EDIT: there is a problem. This effect is adding an additional damage step, doing another set of damage. that's not a good thing xD
EDIT 2: Now it is working. Sometimes I don't understand MV... changed to value = Math.ceil(value*x.x);
 
Last edited:

Latest Threads

Latest Profile Posts

I have a really hard time keeping all these goodies secret til December... but I swear, it is worth the wait!
Working on a Premium version of my minimap plugin that will have advanced functionalities such as drawing a Terrain map based completely on the users tilesets, whatever they may be, and drawing minimap radar icons automatically based on texture of the event the note is applied to.
Psttt come look, this is the secret technique to tenderizing steaks, it makes it extra beefy. :rwink:

pixeldailyaxemeatsheild.gif
#screenshotsaturday update, featuring vaporwave angels lol

Forum statistics

Threads
115,856
Messages
1,093,489
Members
151,069
Latest member
hoodieraady
Top