deus69xxx

Villager
Member
Joined
Oct 13, 2013
Messages
25
Reaction score
9
First Language
English
Primarily Uses
RMMV
Additional questions:
1) How would you use a state to get an effect outside of combat? short version: poison state uses a complex formula in combat, but yanfly extended DoT doesn't do anything out of combat. i just want affected person's mhp/32 for each step.

2) in absorbtion barrier, how can i get it to grant a shield equal to .4x OVERHEALING? seems that would have been one of the first tips & tricks for that :| my tests failed miserably.

so, i have a poison state set up that looks like
Code:
<Custom Apply Effect>
// Make sure the stack count exists.
target._stackingPoison = target._stackingPoison || -1;
// Increase the stack count.
target._stackingPoison += 1;
</Custom Apply Effect>

<Custom Turn Start Effect>
target._stackingPoison += 1;
target._stackingPoison = Math.min(8, target._stackingPoison);
</Custom Turn Start Effect>

<Custom Remove Effect>
// Reset the stack count.
target._stackingPoison = 0;
</Custom Remove Effect>

<Custom DoT Formula>
value = Math.min(Math.floor((b.mhp*b.luk)/1024)+2, 255)*target._stackingPoison;
</Custom DoT Formula>
<DoT Element: 8>
<DoT Variance: 15%>

This does nothing out of combat, and i'm an old school nerd, so i want poison to remain out of combat.
i'm trying to get it to do max hp / 32 per step, but a custom damage formula didn't work with
Code:
<Damage Formula>
if (!$gameParty.inBattle()) {
value = target.mhp/32;
}
</Damage Formula>
(either custom damage formula, or damage formula).

additionally, it would be nice to reset the stackingPoison counter at the start of combat, but that's also well out of my ability to search if yanfly's stuff. it's also unnecessary. but would be nice.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,786
Reaction score
2,931
First Language
English
Primarily Uses
RMMZ
@Icenick I thought that by default when a target of a skill died it moved on to the next one anyway. How do you have this set up right now?

@41728280 This topic is just for YEP notetag setups; I'm not familiar enough with Moghunter's plugins to answer this, sorry.

@Vis_Mage

1. You'd need to use Passive Auras for this as well. Have the state that's applied to the user use the following code:

Code:
<Ally Aura: 12>
<Custom Apply Effect>
$gameTemp._recoveryBattlers = $gameTemp._recoveryBattlers || [];
$gameTemp._recoveryBattlers.push(user);
</Custom Apply Effect>
<Custom Remove Effect>
$gameTemp._recoveryBattlers = $gameTemp._recoveryBattlers || [];
$gameTemp._recoveryBattlers.splice(user);
if ($gameTemp._recoveryBattlers.length === 0) {
  delete $gameTemp._recoveryBattlers;
}
</Custom Remove Effect>

Where 12 is the ID of a new state with the code:

Code:
<Custom Respond Effect>
if (target.isDead()) {
  $gameTemp._recoveryBattlers.forEach(function(battler) {
    if (battler.isAlive()) {
      var gain = Math.floor(battler.mhp * 0.05);
      battler.gainHp(gain);
      battler.startDamagePopup();
    }
  });
}
</Custom Respond Effect>

2.

Code:
<Custom Apply Effect>
if ($gameVariables.value(1) >= $gameVariables.value(2)) {
  user._boostedMat = Math.floor(user.mat * 0.05);
  user.addParam(3, user._boostedMat);
} else {
  user._boostedMdf = Math.floor(user.mdf * 0.05);
  user.addParam(4, user._boostedMdf);
}
</Custom Apply Effect>
<Custom Remove Effect>
  if (user._boostedMat) user.addParam(3, -user._boostedMat);
  if (user._boostedMdf) user.addParam(4, -user._boostedMdf);
  delete user._boostedMat;
  delete user._boostedMdf;
</Custom Remove Effect>

3.

Code:
<Custom Apply Effect>
  user._boostedAtk = Math.floor(user.atk * (0.03 * $gameVariables.value(1)));
  user.addParam(2, user._boostedAtk);
</Custom Apply Effect>
<Custom Remove Effect>
  if (user._boostedAtk) user.addParam(2, -user._boostedAtk);
delete user._boostedAtk;
</Custom Remove Effect>

@zelanius I'm not familiar enough with the New Parameters plugin to answer you, sorry.

@deus69xxx Sounds like you want to be using a Custom Confirm Effect rather than a Custom React Effect. This triggers for the attacker rather than the defender, so value will be the damage dealt as opposed to taken.

For your outside-of-combat effect, I would probably use a parallel process common event that checks whether the player has taken a step and if so applies the damage if they have the poison state.

For the absorption barrier, for 4x overhealing (I'm assuming you mean 4 times more than how much it would take to heal the battler to full) it would just be (user.mhp - user.hp) * 4, would it not?
 
Last edited:

Vis_Mage

Wisp Charmer
Veteran
Joined
Jul 28, 2013
Messages
711
Reaction score
231
First Language
English
Primarily Uses
RMMV
Thank you very much for your help! Bit of a question though, how would I alter these to work as an always-applied passive state (as opposed to a state that would be applied mid-battle)? Sorry if I wasn't very clear about that in my original request.
 
Last edited:

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
@Icenick I thought that by default when a target of a skill died it moved on to the next one anyway. How do you have this set up right now?


Skill: Shockwave - Attacks 4 times all enemies in the front row, if the front row has no enemies, the remaining attacks target the next row.
Scope: 1 Enemy
Hit Type: Physical Attack
Code:
<Target: Front Enemy Row>
<Defeat Reward: Add ATK Buff, 3 Turns>
<Critical Multiplier: -25%>

<Whole Action>
move user: forward, 55, 10
wait for movement
wait: 20
motion item: user
action animation: user, mirror
wait for animation
action effect
wait: 20
motion item: user
action animation: user, mirror
wait for animation
action effect
wait: 20
motion item: user
action animation: user, mirror
wait for animation
action effect
wait: 20
motion item: user
action animation: user, mirror
wait for animation
action effect
</Whole Action>

<target action>
if target.isStateAffected(40)            // I added this because shockwave also adds a state that other skills can interact with. If the target does not have this state, it will apply, if it does it will be removed for a bonus effect.
remove state 40: target
else
add state 40: target
end
</target action>

It always just attacks the front row even if the first hit kills the enemy.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,786
Reaction score
2,931
First Language
English
Primarily Uses
RMMZ
Might be to do with the target notetag. Not sure if there's an easy way around that.
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
Might be to do with the target notetag. Not sure if there's an easy way around that.
Its not because I tried it without the target notetag.
 

41728280

Veteran
Veteran
Joined
May 31, 2020
Messages
240
Reaction score
73
First Language
Chinese
Primarily Uses
RMMV
Sorry
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,786
Reaction score
2,931
First Language
English
Primarily Uses
RMMZ
啊,对不起,我没有收到提醒。
我想问一下如何用脚本代码清除步数?
或为其分配值0

Do you mean the step counter as in how much the player has walked?

Also this is an English forum, so a moderator will probably notify you at some point that you should type in English. ^_^

If you do mean the number of steps walked, just do

Code:
$gameParty._steps = 0;
 

41728280

Veteran
Veteran
Joined
May 31, 2020
Messages
240
Reaction score
73
First Language
Chinese
Primarily Uses
RMMV
Do you mean the step counter as in how much the player has walked?

Also this is an English forum, so a moderator will probably notify you at some point that you should type in English. ^_^

If you do mean the number of steps walked, just do

Code:
$gameParty._steps = 0;
Sorry, I changed the browser to the translation mode to aid reading, and sent the post without paying attention.
Thank you very much! :LZSproud:
 

Vis_Mage

Wisp Charmer
Veteran
Joined
Jul 28, 2013
Messages
711
Reaction score
231
First Language
English
Primarily Uses
RMMV
2.

Code:
<Custom Apply Effect>
if ($gameVariables.value(1) >= $gameVariables.value(2)) {
  user._boostedMat = Math.floor(user.mat * 0.05);
  user.addParam(3, user._boostedMat);
} else {
  user._boostedMdf = Math.floor(user.mdf * 0.05);
  user.addParam(4, user._boostedMdf);
}
</Custom Apply Effect>
<Custom Remove Effect>
  if (user._boostedMat) user.addParam(3, -user._boostedMat);
  if (user._boostedMdf) user.addParam(4, -user._boostedMdf);
  delete user._boostedMat;
  delete user._boostedMdf;
</Custom Remove Effect>

3.

Code:
<Custom Apply Effect>
  user._boostedAtk = Math.floor(user.atk * (0.03 * $gameVariables.value(1)));
  user.addParam(2, user._boostedAtk);
</Custom Apply Effect>
<Custom Remove Effect>
  if (user._boostedAtk) user.addParam(2, -user._boostedAtk);
delete user._boostedAtk;
</Custom Remove Effect>

Hey, after a bit more testing with these two states, I've seemed to run into a bit of an issue. They both perform the boost in stats properly, however the delete user._boostedSTAT; line doesn't seem to be working, and the stat is staying permanently boosted, even after battle.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,786
Reaction score
2,931
First Language
English
Primarily Uses
RMMZ
Hmm. Try a Custom Leave Effect?
 

boikish

Always trying to help :)
Veteran
Joined
Sep 8, 2016
Messages
170
Reaction score
49
First Language
English
Primarily Uses
N/A
@Trihan

Appreciate you doing this. Very helpful, and I've learned a fair bit just from reading the thread.

Wondering how to make a passive state that increases Critical Hit Damage and Critical Hit Rate by user.killCount()/1000 with a clamp of (0,400). So at most, both params are boosted by 40% when 400 enemies are killed.

Yanfly has a tips and trick video about a weapon that does something similar, but I'm unsure how to apply it to a state (see below).

Code:
<Custom Parameters>
var glory = 0;
glory += user.killCount() * 4;
glory += user.assistCount() * 2;
glory -= user.deathCount() * 10;
glory = glory.clamp(0, 25);
mat = glory * 5;
if (glory >= 15) {
  agi = user.paramBase(6) * 0.10;
}
</Custom Parameters>


Going to edit here with a second question:

Looking for a passive state that at the end of battle drains TP and increases HP based on the percentage of TP drained. For example, if a character has 25/50 HP Remaining, and has 100 TP (base amount), after battle, their TP will decrease to 50 to recover 50% of their HP. Also, would do nothing if they are dead.

Hope that makes sense.

Double Edit:
Figured out how to do the second request using Yanfly's utility plugins and running the event after battle. Still wondering if it's possible to do it with a state though, as the common event would require a check for every party member, which can get cumbersome.


Triple Edit:

Figured out the second request on my own. Here's the code that I use in my game if anyone is curious:
Code:
<Custom Victory Effect>
// Check if the user is not dead
if (!user.isStateAffected(2)) {
    // Store current hp/tp in variables, and set the boost rate to 100
    var currentHp = user.hp;
    var currentTp = user.tp;
    var boost = 100;
    // Check if the user is affected with Vit. Booster
    if (user.isStateAffected(273))
        // If so, subtract 50 from boost value
        boost -= 50;
    // Calculate the TP charge rate
    var chargeRate = Math.max(Math.round(user.mhp/boost), 1);
    // Check if the user has more than 0 tp and their HP Rate is less than 1
    if (currentTp > 0 && user.hpRate() < 1) {
        // Gain HP equal to the charge rate * current TP
        user.gainHp(chargeRate * currentTp);
        // Lose TP equal to the difference between stored HP and max divided by charge rate
        user.gainTp(((user.mhp - currentHp) / chargeRate) * -1);
    }
}
</Custom Victory Effect>
 
Last edited:

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
Hey Trihan, I know this isnt necessarily a notetag request but I been stumped on this for the last few hours.

Im using YF Visual State FX and YF STB. I have visual states for each "ROW" and I have some skills that force a row change but will not refresh until the end of TURN instead I need a refresh to happen end of battler ACTION.

I tried notetags in skills <After Eval> and on the States for each row <Custom Turn End Effect> user.refresh();

But it does not work, Im not sure how to refresh the battle_scene and im stuck. If I open another scene for example the "Formation" from YF Row Plugin, at the battle screen, once I exit it does a refresh and the states properly show.
I hope this makes sense.

Edit: upon further testing and inspecting I'm trying to refresh the battle scene not the actor and I have no idea how if possible to do it in notetags.
 
Last edited:

41728280

Veteran
Veteran
Joined
May 31, 2020
Messages
240
Reaction score
73
First Language
Chinese
Primarily Uses
RMMV
Hi Trihan, hope to get your help.
I want to call an event in an action sequence. First assign actorId to game variable X in <setup action>, then call this event in <target action>, because the variable of this event needs the actorId of the current action, how should I write it? I found the command code by searching
$gameVariables.value(X) This is the game variable
BattleManager. actor().actorId() This is to return the actorId value
But I write $gameVariables.value(1) = BattleManager. actor().actorId();
Did not get the value or is wrong, can you tell me what to do?:awat:
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
144
Reaction score
42
First Language
English
Primarily Uses
RMMV
@Trihan thanks for the reply on YR's plugins. One other question on YEP Row Formation. I tried looking through the forum but could not find any help on this. Is there a way to limit the number of battlers per row? Example, I want to only allow 4 actors on the front row, maybe 2 actors each on the 2nd and 3rd row, and only 1 "support" character on the 4th row, is there a way? Please advise.
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
@Trihan thanks for the reply on YR's plugins. One other question on YEP Row Formation. I tried looking through the forum but could not find any help on this. Is there a way to limit the number of battlers per row? Example, I want to only allow 4 actors on the front row, maybe 2 actors each on the 2nd and 3rd row, and only 1 "support" character on the 4th row, is there a way? Please advise.

First off I find YEP Row Formation so frustrating I feel it needs its own perma-topic. So I have nowhere the skill of the great Trihan but I have a solution for you.

Code:
<Custom Action End Effect>
if ($gameParty.rowAliveSize(2) >= 2) {
user.setRow(1);
 } else {
}
</Custom Action End Effect>

Put this in each of your rows, this example is for the 2nd row, it works that if 2 or more party members are in row 2, at the end of their action/turn that user will move up to row 1.

Alternatively you can use action start if you want to bump the oldest user in the row (or quickest depends your system). Using Action End makes sure whoever enters the row after the limit will move up to first row. Its not perfect but it works. Can be kinda fun too like you can get 1 turn in that row and forced to move, combines well with row change CD.

On that note I really miss Trihan, guess he's busy hes such an amazing member to help so many users. I find the community is really lack luster when it comes to support.
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
144
Reaction score
42
First Language
English
Primarily Uses
RMMV
First off I find YEP Row Formation so frustrating I feel it needs its own perma-topic. So I have nowhere the skill of the great Trihan but I have a solution for you.

Code:
<Custom Action End Effect>
if ($gameParty.rowAliveSize(2) >= 2) {
user.setRow(1);
} else {
}
</Custom Action End Effect>

Put this in each of your rows, this example is for the 2nd row, it works that if 2 or more party members are in row 2, at the end of their action/turn that user will move up to row 1.

Alternatively you can use action start if you want to bump the oldest user in the row (or quickest depends your system). Using Action End makes sure whoever enters the row after the limit will move up to first row. Its not perfect but it works. Can be kinda fun too like you can get 1 turn in that row and forced to move, combines well with row change CD.

On that note I really miss Trihan, guess he's busy hes such an amazing member to help so many users. I find the community is really lack luster when it comes to support.

Hi Icenick, thanks for the code and advise. I am actually looking for a way to prevent the gamer from exiting the menu when using the Row function within the main menu itself, but I guess that is not possible. In any case, thanks again!
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
647
Reaction score
899
First Language
German
Primarily Uses
RMMV
@Trihan or @ anyone who knows how to do this.
Heya again.

Using BuffsStatesCore, is it possible to check for a characters elemental resistance and deal damage accordingly, on a state?
For example, if you have a burning state and want it to deal firedamage.

Like if I have this formula for example:

<Custom Regenerate Effect>
target.gainHp(target.atk * 2 * -1);
</Custom Regenerate Effect>

Is it possible to check for fire resistance before applying the damage?


Also: Maybe I have overlooked something, but is it possible to call parameters from the character where the state originated from?
By that I mean, a state that deals damage to a target depending on YOUR attack and THEIR defense?
 
Last edited:

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
418
Reaction score
64
First Language
English
Primarily Uses
@Trihan or @ anyone who knows how to do this.
Heya again.

Using BuffsStatesCore, is it possible to check for a characters elemental resistance and deal damage accordingly, on a state?
For example, if you have a burning state and want it to deal firedamage.

Like if I have this formula for example:

<Custom Regenerate Effect>
target.gainHp(target.atk * 2 * -1);
</Custom Regenerate Effect>

Is it possible to check for fire resistance before applying the damage?


Also: Maybe I have overlooked something, but is it possible to call parameters from the character where the state originated from?
By that I mean, a state that deals damage to a target depending on YOUR attack and THEIR defense?

Hey, I use something similar for my burn state.
Code:
user.elementRate(x)   // x being the element id.

var burn = Math.ceil(user.elementRate(2) * origin.atk);  // this uses the caster's ATK stat vs Users Fire Res
<Custom Regenerate Effect>
   target.gainHp(burn * -1);
</Custom Regenerate Effect>

I also answered your next question in my example that is to use origin.atk or def or wtv will use the origin caster's stats.
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
647
Reaction score
899
First Language
German
Primarily Uses
RMMV
@Icenick That does work! Thank you very much, friend!
 

Latest Threads

Latest Profile Posts

unintentionally made a track that sounds straight out of Yume Nikki
Revisiting one of my older projects in a long time to work some more on the mechanics. I've been working on- and off-again for about a year now on recreating the Force and Mystic systems from Wild ARMs. And I think I've finally made some good breakthroughs on that!

Still, it is not perfect and I may post my thoughts at a later time to see if there are any other suggestions or alternatives I've missed.
actor name string, why you gotta be case sensitive like that?
Doing RPG Maker News for 26th October 2021

My entire world, full of monsters and treasures, will likely be done by the end of the year. After that it's all NPCs and side quests... then done. I'm never making an open world game again xD

Forum statistics

Threads
116,107
Messages
1,095,862
Members
151,511
Latest member
jjjjjamjam
Top