Serene grace-like state

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello, I have a doubt

Well, I want to make a passive state (using Yanfly's script for that) to make a state like Serene grace for Pokemon, in case you don't know what I'm talking about, basically it works like this: it doubles the chance of adding a state with an attack (for example, if an attack has a 20% chance of adding x state, the chance will be increased to 40%) I actually COULD make this using the formula box, BUT I want it respects target's state rate, and that doesn't happen if I use the formula box.

Anyways, if you can solve this I'd be really grateful.

 
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
All right, I'll try it again, is there a way to make a state like that?
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA

captainproton

Dangerously Nifty
Veteran
Joined
Dec 20, 2013
Messages
1,276
Reaction score
570
First Language
english
Primarily Uses
you may want to try having the Serene Grace affect luck, as that influences the likelihood of inflicting a status. If it doubles your luck, then it should have a correlating effect on status infliction.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
you may want to try having the Serene Grace affect luck, as that influences the likelihood of inflicting a status. If it doubles your luck, then it should have a correlating effect on status infliction.
Isn't there another way? I don't want this is reflected in the stats
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
You could put this:
b.add_state(nif rand (100) * b.state_rate(n) > (b.state?(serene_grace) : (100 - state_chance) ? (100 - state_chance * 2)); damage

keep in mind I didn't test it
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
You could put this:

b.add_state(nif rand (100) * b.state_rate(n) > (b.state?(serene_grace) : (100 - state_chance) ? (100 - state_chance * 2)); damage

keep in mind I didn't test it
Hi! sorry for delay, let's see, if I want an attack has a 20% of chance to add the poison state (40% with that serene grace-like state, it'd be the state id 41 for this case) and makes 500 of damage, it'd be:

b.add_state(2if rand (100) * b.state_rate(2) > (b.state?(41) : (100 - 20) ? (100 - 20 * 2)); 500

Idk why but I'm reading that like the attack would have a 80% to add this state if it doesn't have the state (the 100 - 20 thing) but maybe I'm mistaken, could you explain the logic process behind this formula? I'm quite confused :l
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
add state 2 if random number that can reach 100 multiplied by chance of getting the effect is greater than (if in state 41 it is greater than 80 (100 - 20), else it is greater than 60 (100 - 40, since it does the multiplication before the subtraction)).
the thing you are confusing is with  the bigger than, means it will only apply the state if the random value is higher than 80, meaning 20% of chance.
 

Although now that I see it, I guess I made it a bit wrong, instead you should use

b.add_state(2if rand (100) > (b.state?(41) : (100 - 20 * b.state_rate(2)) ? (100 - 20 * 2 * b.state_rate(2))); 500

since the other way it affects the random number, making it possible to be impossible to get an effect if the rate is too low but still not zero. 50% rate, for example, would already be impossible
it is too big for the skillbox though, you'd need to make this to get it to work...
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Would it be something like that?

class Game_Battler < Game_BattlerBase

  def custom_damage_poison(a, B)

  b.add_state(2) if rand (100) > (b.state?(41) : (100 - 20 * b.state_rate(2)) ? 

  (100 - 20 * 2 * b.state_rate(2))); 500

  end

end

 

And then put that in the damage box: a.custom_damage_poison(a, B) right?
 
Last edited by a moderator:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
think so. to tell the truth I didn't try it yet, didn't make a skill that required me to use it on my game yet.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
It shows this mistake:

Formal argument cannot be a constant

 def custom_damage_poison(a, B)

What does it mean with formal argument? sorry, I'm quite dumb for this scripting part
 
Last edited by a moderator:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
you are using upper case B, you have to use lower case b. Upper case is reserved for constants, which you can't use there according to the error.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Another mistake :l



I have made damage formulas with script commands, but I have used the if x; a; else; b; end format, I don't know how to adapt this formula to this format

Again, I'm quite dumb with this
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
sorry, my fault this time, didn't even notice I inverted the ? and the :

Code:
class Game_Battler < Game_BattlerBase  def custom_damage_poison(a,   b.add_state(2) if rand (100) > (b.state?(41) ? (100 - 20 * b.state_rate(2)) :   (100 - 20 * 2 * b.state_rate(2))); 500  endend
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Well, it doesn't show mistake anymore, but skill is not working, it's not doing any damage and the test has used this attack like 15 times but it hasn't added this state (even when I put the posibility to 50%)
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
been testing it, and the problem seems to be the add_state... weird...

no, the problem was the space in rand (100), it is supposed to be rand(100), sorry.

Try this now:

class Game_Battler < Game_BattlerBase def custom_damage_poison(a, b.add_state(2) if rand(100) > (b.state?(41) ? (100 - 20 * 2 * b.state_rate(2)) : (100 - 20 * b.state_rate(2))); 500 endendYou'll notice I changed something else, the state was instead of increasing the chance of getting the state when iin Serene Grace, increasing when without. sorry again.
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
been testing it, and the problem seems to be the add_state... weird...

no, the problem was the space in rand (100), it is supposed to be rand(100), sorry.

Try this now:

class Game_Battler < Game_BattlerBase def custom_damage_poison(a, b.add_state(2) if rand(100) > (b.state?(41) ? (100 - 20 * 2 * b.state_rate(2)) : (100 - 20 * b.state_rate(2))); 500 endendYou'll notice I changed something else, the state was instead of increasing the chance of getting the state when iin Serene Grace, increasing when without. sorry again.
Tested and it works, Thank you! Just a little mistake, I almost didn't notice it, but the idea was the caster of the spell would have this state to increase the chance to add states, so it'd be a.state, no b.state, but well, it works now
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Uhhh hi again, I have been looking for this and I have another question, with this formula, the luck is irrelevant, right? I mean the luck stat normally has effect when adding a state, but with this formula it doesn't have any effect, right?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top