Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
So, I have two party characters I'm trying to develop some unique abilities for. I have an idea how the traits and such work but I'm not sure I can make these abilities happen.

One character's ability needs to activate when her HP drops below 25% which will increase her defense and magic defense but will decrease attack. The other character's ability activates at random which grants her x2 attack power to whatever move she uses but at the cost of decreasing her rate for that attack.

I'm wondering how I could set this up or will I need some sort of plugin(s) to get this to work? I guess what I'm asking is how do I set these up to trigger or activate at random?
 

Zaabos

Villager
Member
Joined
Sep 16, 2019
Messages
29
Reaction score
25
First Language
English - Aeari
Primarily Uses
RMMV
This is relatively easy to do if you use Yanfy BuffState Core. For the first Ability, you can check at the beginning of the turn or after enemy attacks if the hp of your character is below 25%, if it is, activate the ability.


Same for the second ability, at the beginning of the turn (or at the end or both) do a random eval and if it checks, activate ability.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,909
Reaction score
8,602
First Language
German
Primarily Uses
RMMV
Both abilities can have their effect created by states, that is not the problem.
The difficult part is the trigger as to when the states are triggered.

This can be done either by plugins or by troop events. In case of troop events they should run every turn or every action, test for the values and then add or remove the states as required.

This can be done without plugins by simply copying the troop event into every troop, or you can add a base troop plugin that copies all that to every troop automatically.
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
This is relatively easy to do if you use Yanfy BuffState Core. For the first Ability, you can check at the beginning of the turn or after enemy attacks if the hp of your character is below 25%, if it is, activate the ability.


Same for the second ability, at the beginning of the turn (or at the end or both) do a random eval and if it checks, activate ability.

So would I want to use a custom action start effect then?
I'm still not seeing here where to apply the trigger which is when her health is below 25%
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Both abilities can have their effect created by states, that is not the problem.
The difficult part is the trigger as to when the states are triggered.

This can be done either by plugins or by troop events. In case of troop events they should run every turn or every action, test for the values and then add or remove the states as required.

This can be done without plugins by simply copying the troop event into every troop, or you can add a base troop plugin that copies all that to every troop automatically.

I was originally going to create unique states for each character to do this but like you said the trigger was the problem. I guess I would ask, what plugin would trigger the state I created ?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,909
Reaction score
8,602
First Language
German
Primarily Uses
RMMV
that would be the plugin mentioned above, and you would have to know javascript to place the condition as a notetag for the plugin to read - it's helpfile should have that somewhere as a condition for an autostate or passive state.

or if you don't want to use a plugin you can place the trigger inside a troop event like i mentioned above.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
274
Reaction score
44
First Language
English Spanish
Primarily Uses
RMMV
Regarding the buffState core mentioned above.
You need yo create a state and apply it to your actor. In the state note tag you need to place the following:

Code:
 <Custom React Effect>
  if (user.hp <= user.mhp * .25){
user.addState(X)
  }
</Custom React Effect>
X is the state that contains the ability which will increase her defense and magic defense but will decrease attack.

Now this will only trigger when an enemy deals damage on an attack. this method does not account for slip damage or any other of indirect damage. IT can be done, but you need more tags. But this will give you a basic idea of what needs to be done.
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Regarding the buffState core mentioned above.
You need yo create a state and apply it to your actor. In the state note tag you need to place the following:

Code:
 <Custom React Effect>
  if (user.hp <= user.mhp * .25){
user.addState(X)
  }
</Custom React Effect>
X is the state that contains the ability which will increase her defense and magic defense but will decrease attack.

Now this will only trigger when an enemy deals damage on an attack. this method does not account for slip damage or any other of indirect damage. IT can be done, but you need more tags. But this will give you a basic idea of what needs to be done.

Oh my gosh! This totally makes sense now. Now, what if I wanted it to trigger randomly?

Btw, thank you for confirming this because I was just reading this effect and the other custom effects lol
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
274
Reaction score
44
First Language
English Spanish
Primarily Uses
RMMV
Oh yeah, for the second ability, we just add a random number, it depends on the percentage you want.
Code:
<Custom React Effect>
randomN = Math.floor(Math.random() * 10 + 1)
  if (randomN == 10){
user.addState(X)
  }
</Custom React Effect>

In this case, you have a 10% rate of activating the skill, you just need to play with the number to increase or decrease the chance.
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Oh yeah, for the second ability, we just add a random number, it depends on the percentage you want.
Code:
<Custom React Effect>
randomN = Math.floor(Math.random() * 10 + 1)
  if (randomN == 10){
user.addState(X)
  }
</Custom React Effect>

In this case, you have a 10% rate of activating the skill, you just need to play with the number to increase or decrease the chance.
Hey there!

I know it's been awhile since I last replied to this post. I had some things to take care of and new life adjustments happening.

Anyway, coming back to this, I had another question. I got the two new states made and got the code above in each of them but how I do apply the actual effect itself to the character? I thought I knew this answer before but when I tried it, it didn't work.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
274
Reaction score
44
First Language
English Spanish
Primarily Uses
RMMV
Hi! No worries, hope those adjustments were positive =)

On my code I assumed that you apply the effects via another state, thats where " user.addState(X)" line come into effect, X is the number of the state you want to apply.

So to summarize, you need to apply a permanent state that contains my code. And you need to create another state where you put your effects (more strength, less speed, etc etc).

In the state that contains my code, change the X value for the number of the state that contains your effects. And it should work!
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi! No worries, hope those adjustments were positive =)

On my code I assumed that you apply the effects via another state, thats where " user.addState(X)" line come into effect, X is the number of the state you want to apply.

So to summarize, you need to apply a permanent state that contains my code. And you need to create another state where you put your effects (more strength, less speed, etc etc).

In the state that contains my code, change the X value for the number of the state that contains your effects. And it should work!
Oh okay I didn't realize that part. I'm glad you mentioned that because I was about to do this wrong then. But how I do apply the state with the code to my specific character?
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
274
Reaction score
44
First Language
English Spanish
Primarily Uses
RMMV
Ok, You need to create a state, lets call it "Enabler" and lets place it on the Id 10 on the state Database.

That state will have the code:
Code:
<Custom React Effect>
  if (user.hp <= user.mhp * .25){
user.addState(11)
  }
</Custom React Effect>
That state must be applied ALWAYS to your character, in battle it must have it at all times. Now, you see how the code contains "user.addState(11)" ??

So we need to create another state, lets call it "Ability" ( it will contain the buffs) and we will place it under the ID 11 on the state database.

So, when the character receives damage from an enemy and the character is under 25% of HP, the code will activate and will place the state 11 on your character.
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ok, You need to create a state, lets call it "Enabler" and lets place it on the Id 10 on the state Database.

That state will have the code:
Code:
<Custom React Effect>
  if (user.hp <= user.mhp * .25){
user.addState(11)
  }
</Custom React Effect>
That state must be applied ALWAYS to your character, in battle it must have it at all times. Now, you see how the code contains "user.addState(11)" ??

So we need to create another state, lets call it "Ability" ( it will contain the buffs) and we will place it under the ID 11 on the state database.

So, when the character receives damage from an enemy and the character is under 25% of HP, the code will activate and will place the state 11 on your character.
Okay I got that but I want this ability to pertain to one character in particular. So, how would I make my main character only have this enabler state?

Sorry, looking back at my previous post I realize didn't really reach this question.

My apologies.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
274
Reaction score
44
First Language
English Spanish
Primarily Uses
RMMV
Mmm...I dont quite understand your question. If you want a specific character with the enabler state, you apply that state only to the character you want. in this case, your main character.

So you have Yanfly auto passive states?
Place: <Passive State: X> on the actor (main character) notetag.
where X is the Id of the enabler state.

This answers your question? Im a bit confused he he
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Oh yes I do have this plugin but not turned on yet. I downloaded it the other day thinking it could solve my problem. I'll try it and get back with you.
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Mmm...I dont quite understand your question. If you want a specific character with the enabler state, you apply that state only to the character you want. in this case, your main character.

So you have Yanfly auto passive states?
Place: <Passive State: X> on the actor (main character) notetag.
where X is the Id of the enabler state.

This answers your question? Im a bit confused he he
Okay it partially worked.

States are showing except the effects are not happening.

I attached some screenshots of all my code, states, characters, and such. Perhaps you might can spot my problem.
 

Attachments

  • Iris1.PNG
    Iris1.PNG
    120.2 KB · Views: 3
  • Iris2.PNG
    Iris2.PNG
    154.5 KB · Views: 3
  • Iris3.PNG
    Iris3.PNG
    152.2 KB · Views: 2
  • Trish1.PNG
    Trish1.PNG
    117.3 KB · Views: 3
  • Trish2.PNG
    Trish2.PNG
    159.8 KB · Views: 4
  • Trish3.PNG
    Trish3.PNG
    148.6 KB · Views: 4

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
274
Reaction score
44
First Language
English Spanish
Primarily Uses
RMMV
Ok. Just for easier testing, add an Icon for State 41 and 43, that way if you see it applied, it means the effect is triggering.

Now, the effects for Iris should apply when she gets hit and her hp is under 25%. The effect for Trish will never happen, the way it is setup right now. Im ssuming you want a 50% chance? in that case use this code on state 42:
Code:
<Custom React Effect>
randomN = Math.floor((Math.random() * 2) + 1)
  if (randomN == 1){
user.addState(43)
  }
</Custom React Effect>

Everything else is setup properly =)
 
Joined
Apr 13, 2020
Messages
34
Reaction score
0
First Language
English
Primarily Uses
RMMV
Okay that worked but here is the problem now lol

The enemies are getting the states when I hit them lol
 

Latest Threads

Latest Posts

Latest Profile Posts

To be released 2021/10/21
Now that I made this "What the MZ RTP is missing" spreadsheet it's itching me to fill some the gaps D:
Aaaaand I completely forgot about the RMMV Chicken Rave my brother decided to implement in a parody of my VERY FIRST UNFINISHED project. We could not escape the chicken rave... The chickens would block the ladder...
I love how I can look up a problem I'm having with my game, find a post from like six years ago that addresses the issue, and the solution provided still works in RPG Maker.
It's times like those that my life feels really easy XD
Change costumes with equipment!

Forum statistics

Threads
115,949
Messages
1,094,267
Members
151,205
Latest member
Vertette
Top