skill help

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
263
Reaction score
218
First Language
English
Primarily Uses
RMVXA
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
263
Reaction score
218
First Language
English
Primarily Uses
RMVXA
I just got it to work after a long string of conditional branches.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Mithran

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
404
Reaction score
217
First Language
English
Primarily Uses
Reopened at request of original poster.
 

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
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
 

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
263
Reaction score
218
First Language
English
Primarily Uses
RMVXA
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?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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...
 
Last edited by a moderator:

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
263
Reaction score
218
First Language
English
Primarily Uses
RMVXA
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 
Last edited by a moderator:

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
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
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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...
 

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
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
 

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
263
Reaction score
218
First Language
English
Primarily Uses
RMVXA
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?
 

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
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
 

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
263
Reaction score
218
First Language
English
Primarily Uses
RMVXA
Is there a topic that has the custom formula scripting on it, in case I want to make my own in the future?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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/
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
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'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top