skill help

I was wondering how to make a skill that has an effect where it will either do it's normal effect or it will do a different effect based on whether an enemy has a certain state on them. Here's an example: I have a skill called water burst. Water burst applies the state soaked. I have another skill called flash freeze. Flash freeze will either "freeze" the target for 1 turn or will "freeze" the target for 2 turns if they currently are affected by the state soaked.
well you need two states for that since a state by default can only have one duration...

then you can just do the state application via the damage formula bar...
I think you'd have to have your skill call a common event, where you could do some testing on the target and apply different states based on the result.
I just got it to work after a long string of conditional branches.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Reopened at request of original poster.
dont know why this was reopened but since it was.

you can use the damage formula to do this without common events.

b.state?(soaked id) ? b.add_state(2 turn freeze id) : b.add_state(1 turn freeze id);b.remove_state(soaked id);damage formula
I actually spoke too soon, as the conditional branches didn't work as expected. I can't figure out how to test certain enemies, as said by shaz. How would I implement the formula? Do I put it before or after the damage calculation?
Uhm, the answer to your question is already in his post

b.state?(soaked id) ? b.add_state(2 turn freeze id) : b.add_state(1 turn freeze id);b.remove_state(soaked id);damage formula
He already placed the phrase damage formula at the end... 🙂

And as per the basics of the damage formula, the damage returning value should always be the last line...
I tried to post the custom formula in the damage formula box, but it got cut off. Am I supposed to put it somewhere else?
well, if you can't fit it, then you will just need to put it into a custom method inside the Game_Battler class, then call that method on the damage formula

so something like:

class Game_Battler < Game_BattlerBase

    def state_formula(a,b )

      b.state?(soaked id) ? b.add_state(2 turn freeze id) : b.add_state(1 turn freeze id)

      b.remove_state(soaked id)

    end

end

then on the damage formula:

state_formula( a,b );damage formula here
just an example formula

b.state?(100) ? b.add_state(102) : b.add_state(101);b.remove_state(100);4 * a.mat - b.mdf

you need to change the 100, 101, 102 to the ids of your states and the 4 * a.mat - b.mdf to what you want your damage formula to reflect
have you tried putting it there, coz as he said, it doesn't fit in the box... if it fits on you, then maybe he's just doing something wrong...
it didnt fit before because soaked id, 1/2 turn freeze were taking up too many characters, it will fit once they are replaced by ids
It fits now because I didn't finish putting in the ids.

It works! Thanks so much. Can you explain how you made the custom formula?
b.state?(soaked id) ?

checks if the target has the soaked state on them

b.add_state(2 turn freeze id) : b.add_state(1 turn freeze id)

adds the 2 turn freeze on the target if the target is soaked, otherwise adds the 1 turn freeze

b.remove_state(soaked id)

removes the soaked state

damage formula

self explanatory
Is there a topic that has the custom formula scripting on it, in case I want to make my own in the future?
well, you can check the basic tutorials for scripting... formulas are easy to make once you know the methods available in RGSS3... once you know the capabilities of RGSS3, all you need is quite a bit of logic to make the right formula
Is there a topic that has the custom formula scripting on it, in case I want to make my own in the future?
The damage formula is basically a single line of RGSS-Code that gets evaluated when calculating the damage. It uses the same commands as available for scripting - that's why there are no specific tutorials for that box.
However, there is a topic for listing and asking specific commands to be used in the formula:


http://forums.rpgmakerweb.com/index.php?/topic/1143-how-to-make-the-most-of-custom-formulae-part-1/

Original thread: https://forums.rpgmakerweb.com/threads/skill-help.18080/