Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Hi all!

I've noticed quite a few topics lately from people asking about how to achieve certain effects with Yanfly's plugins, usually involving custom effects and notetags, so I figured I would offer my services in a more centralised thread where anyone can drop in something they're trying to do and I'll see if I can come up with the effect that'll achieve it.

Doesn't necessarily have to be restricted to Yanfly plugins; if you're just struggling to come up with just the right line of code to get a value or property you need for an effect, I can help with that as well.
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,929
Reaction score
1,185
First Language
Dutch
Primarily Uses
N/A
Are you also going to do a VX Ace version, perhaps?
I find there's not a lot of info about that.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Could do actually, good shout.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,997
Reaction score
2,282
First Language
Portuguese - Br
Primarily Uses
RMMZ
That is a nice thing to do. It will be really helpful for the community. Thanks and congratulations :D
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,295
Reaction score
2,461
First Language
Dutch
Primarily Uses
RMMV
there was 1 for mirror effect to deal 2x dmg to the enemy, If I can find it, I can post a link to it,
here is the link to it that needed it

another nice suggestion is to create spoilers with the effectso they can each copy paste
Example per spoiler would be:

type notetag: item/skill, actor
type state: skill, passive etc

code here to copy paste into item, skill or actor notetag
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
105
Reaction score
32
First Language
BR Portuguese
Primarily Uses
RMMZ
Any idea on how to make a state that grants a parameter bonus based on another character's, as long as it is on the group?

e.g.: Markus and Paul are on the group. Paul has a passive state that grants (((Markus' Defense × 0.05)/100) × VariableValue) bonus on his defense when they fight together.

I'm working on a "Affinity System" between my character's, and this is the final step that needs to be implemented.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Any idea on how to make a state that grants a parameter bonus based on another character's, as long as it is on the group?

e.g.: Markus and Paul are on the group. Paul has a passive state that grants (((Markus' Defense × 0.05)/100) × VariableValue) bonus on his defense when they fight together.

I'm working on a "Affinity System" between my character's, and this is the final step that needs to be implemented.

Yep, you can absolutely do that. Does it need to detect which character's parameters to use, or will it just always use Markus'?
 

Yegitu

artistic goofball
Veteran
Joined
May 7, 2020
Messages
43
Reaction score
73
First Language
German
Primarily Uses
RMMV
Is there a way to make the Guard state, or any state really, wear off as soon as the user's next turn begins?
I am using Yanflys Buffs&States Core. Probably super easy but yesterday I just gave up because I had no idea how to do it.

The vanilla options for when states wear off aren't able to do that either. Dx
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Is there a way to make the Guard state, or any state really, wear off as soon as the user's next turn begins?
I am using Yanflys Buffs&States Core. Probably super easy but yesterday I just gave up because I had no idea how to do it.

The vanilla options for when states wear off aren't able to do that either. Dx

Doesn't it already? The way Guard is set up in the default system, it's applied when using the Guard command and is set to be removed on action end, so as soon as you choose your action on the turn after it's applied it wears off. Is that not what you're looking for?
 

Yegitu

artistic goofball
Veteran
Joined
May 7, 2020
Messages
43
Reaction score
73
First Language
German
Primarily Uses
RMMV
Doesn't it already? The way Guard is set up in the default system, it's applied when using the Guard command and is set to be removed on action end, so as soon as you choose your action on the turn after it's applied it wears off. Is that not what you're looking for?
This is how it works, though from the players perspective this is just bad game design, because why would the guard state still be there on the users next turn and then wear off AFTER he uses something else?
I don't know if I'm too nitpicky with my own game, but it just makes me feel weird. The option to just not show the Guard state applied as a state (like it is vanilla) is weird too for me. qUq
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
105
Reaction score
32
First Language
BR Portuguese
Primarily Uses
RMMZ
I believe there's a notetag for the states that is triggered at the turn's end, I just don't know which one (might take a look as soon as I sit in front of my computer), but you could use this to make the state remove itself.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Code:
<Custom Turn End Effect>

target.removeState(2);

</Custom Turn End Effect>

That should work. (where 2 is the ID of the state you're adding the tag to)
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
105
Reaction score
32
First Language
BR Portuguese
Primarily Uses
RMMZ
Yep, you can absolutely do that. Does it need to detect which character's parameters to use, or will it just always use Markus'?
I believe that "Always Markus" will suffice for the system :)
 

Yegitu

artistic goofball
Veteran
Joined
May 7, 2020
Messages
43
Reaction score
73
First Language
German
Primarily Uses
RMMV
I believe there's a notetag for the states that is triggered at the turn's end, I just don't know which one (might take a look as soon as I sit in front of my computer), but you could use this to make the state remove itself.
For the sake of "fine tuning" and making it feel right, it would need to be on the next turn's beginning, not the end.

But either way! Thanks for the quick help @Trihan !
Works as I want it to. :D
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
For the sake of "fine tuning" and making it feel right, it would need to be on the next turn's beginning, not the end.

But either way! Thanks for the quick help @Trihan !
Works as I want it to. :D

Unfortunately using a "Custom Turn Start Effect" doesn't work because it activates literally when the turn actually begins, which is *after* you've chosen your party actions for the turn. Custom Turn End is pretty much the only one that does what you're asking for (though you could theoretically add your own notetag that comes in between if you wanted to fine-tune it)

I believe that "Always Markus" will suffice for the system :)

Code:
<Custom Passive Condition>
if ($gameParty._actors.contains(id of Markus)) {
  condition = true;
else {
  condition = false;
}
</Custom Passive Condition>
<Custom Apply Effect>
target._paramPlus[3] += ((($gameActors.actor(id of Markus).param(3) * 0.05) / 100) * $gameVariables.value(id of variable));
</Custom Apply Effect>
<Custom Remove Effect>
target._paramPlus[3] -= ((($gameActors.actor(id of Markus).param(3) * 0.05) / 100) * $gameVariables.value(id of variable));
</Custom Remove Effect>

That will do what you're asking for, but are you sure you want to multiply by 0.05 and THEN divide by 100? Multiplying by 0.05 is already giving you 5% of his def, dividing by 100 makes it 0.05% which will barely scratch adding an integer to the stat.
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
105
Reaction score
32
First Language
BR Portuguese
Primarily Uses
RMMZ
Unfortunately using a "Custom Turn Start Effect" doesn't work because it activates literally when the turn actually begins, which is *after* you've chosen your party actions for the turn. Custom Turn End is pretty much the only one that does what you're asking for (though you could theoretically add your own notetag that comes in between if you wanted to fine-tune it)



Code:
<Custom Passive Condition>
if ($gameParty._actors.contains(id of Markus)) {
  condition = true;
else {
  condition = false;
}
</Custom Passive Condition>
<Custom Apply Effect>
target._paramPlus[3] += ((($gameActors.actor(id of Markus).param(3) * 0.05) / 100) * $gameVariables.value(id of variable));
</Custom Apply Effect>
<Custom Remove Effect>
target._paramPlus[3] -= ((($gameActors.actor(id of Markus).param(3) * 0.05) / 100) * $gameVariables.value(id of variable));
</Custom Remove Effect>

That will do what you're asking for, but are you sure you want to multiply by 0.05 and THEN divide by 100? Multiplying by 0.05 is already giving you 5% of his def, dividing by 100 makes it 0.05% which will barely scratch adding an integer to the stat.
Thanks A LOT for this, you are a life saver!

About the value, yes, I'm sure. The affinity variable goes from 0 to 100, and since Markus' defense (in this example) revolves around the 600s, 5% of his defense with 100 affinity results in a +30 bonus in Paul's Defense. Extrapolate this to every member of the party and you see that this system not only is mathematically relevant, but also robust.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Thanks A LOT for this, you are a life saver!

About the value, yes, I'm sure. The affinity variable goes from 0 to 100, and since Markus' defense (in this example) revolves around the 600s, 5% of his defense with 100 affinity results in a +30 bonus in Paul's Defense. Extrapolate this to every member of the party and you see that this system not only is mathematically relevant, but also robust.

Ah, fair. I wasn't factoring in the effect the variable would have. :)

One thing that may need tweaked: you might have to assign the value to target._markusAffinityBonus or something and use that in the += or -=, or you might end up removing more from the bonus than you added.
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
105
Reaction score
32
First Language
BR Portuguese
Primarily Uses
RMMZ
Ah, fair. I wasn't factoring in the effect the variable would have. :)

One thing that may need tweaked: you might have to assign the value to target._markusAffinityBonus or something and use that in the += or -=, or you might end up removing more from the bonus than you added.
Oh, I see, just in case the Affinity grows while that passive is in effect. In this case, the removing value could be bigger than the applying value, is that it?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,069
Reaction score
4,698
First Language
English
Primarily Uses
RMMZ
Exactly, yeah. Having a think just now to see what the best way would be to keep that updated.
 

PauloHPBender

Delirious Storyteller
Veteran
Joined
Oct 16, 2015
Messages
105
Reaction score
32
First Language
BR Portuguese
Primarily Uses
RMMZ
Assuming affinities are update only outside of battles, I don't think that would be an issue, but the parameter "provider" could have it's own parameters changed midfight, and THAT could be troublesome. I'm gonna make a few tests and keep the value attached into a handle variable.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've been working on plugins to make it easier to incorporate Persona 3's Once More batsys into MV games. One makes it so you can have states automatically applied to the target and/or user when their hit crits or targets a weakness... I could use testers for it, though. Maybe I'll make a thread in the JS Plugins In Development board about it?
Whenever I'm feeling down I like to watch Bardic Inspiration by Deerstalker Pictures
on youtube. Because 'my mockery is Vicious.' It's funny and catchy like the flu.
Knew this hurricane was coming for me, because it got my name on it! See you humans and non-humans in a few days if not a few weeks. Now go work on yo games!
ScreenShot_9_27_2022_6_54_39.png
New enemy finished today... Century Owl.
bandicam 2022-09-27 22-40-47-956.png

Forum statistics

Threads
125,604
Messages
1,172,247
Members
164,718
Latest member
kingbet86mobi
Top