Buff Charge based on TP

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
[solved]

The hero uses a CHARGE skill.

This skill consumes all his TP in order to add a buff state.

This Buff State power is based on how much TP he had.

Ex: Hero has 50 TP. He uses CHARGE. The buff will raises power +50%.

--------------------------------------------------------------------------------------------

Heres a walkthrough to how I simulated this effect:

1. Tskuhime's Skill Change Script - http://www.himeworks.com/2013/05/19/skill-change/

2. A CHARGE skill to add the CHARGE state.

3. Two variations of the same attack skill: Regular and Charged

4. On the regular skill notebox place

<skill change>
     id: 305
     condition: a.state?(x)
</skill change>


X = state ID

5. On the charged skill use the formulae

d="ATK formula here" + a.tp* 5; a.tp=0; a.remove_state(x);d

6. Done!

--------------------------------------------------------------------------------------------

It's a frankenstein's monster, but It works.

I rather have a script for it. A skill would consume and store the TP value in a variable and add a state. This state would multiple the skill power by the variable, then clear the variable.

I'm not good enough to handle such script though.
 
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
you can make 1 state per TP value... and use a conditional check via the damage formula for example to determine which to add...
 

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
you can make 1 state per TP value... and use a conditional check via the damage formula for example to determine which to add...
Hmm. This would take a really long time, but if I don't find any other way I think this is going to be the way.

Can you give me an example of conditional check on damage formula?
 

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
Well, I'm having a really hard time figuring this out.

I've created a skill called CHARGE. It just add a CHARGE state.

For the attack skill, I made a custom formulae that checks if the state is applied.

if a.state?(36);b.physical_attack(a, B) + a.tp * 50; else; b.physical_attack(a, B) ;end

The problem here is:

- If the CHARGE skill consume all TP, wont be possible calculate the formula.

- The attack skill can't consume all TP 'cause it can be usable without charge.

- If I add a a.tp=0 on the formulae, it will consume all TP before and wont be possible calculate the attack.

Little help here?!
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
Do something like this:

Set the CHARGE skill to require (whatever minimum TP)

Set the damage formula to:

v=a.tp;a.tp=0;v*50

This preserves the TP value in "v", clears the TP value and returns v*50 for the damage value...
 

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
Do something like this:

Set the CHARGE skill to require (whatever minimum TP)

Set the damage formula to:

v=a.tp;a.tp=0;v*50

This preserves the TP value in "v", clears the TP value and returns v*50 for the damage value...
Wow!

This was very helpful! Didn't know about this "preservation" command!

This works like a charm!

Thanks A LOT!

Edit:

For other people with the same problem, heres is the formula:

if a.state?(36);v=a.tp;a.tp=0;b.physical_attack(a, B) +v* 50; else; b.physical_attack(a, B) ;end
 
Last edited by a moderator:

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
Glad to help, Nugem.

To avoid confusion:  there is no real "preservation" command.  

I'm relying on a nifty little trick in Ruby (the scripting language which runs inside RPG Maker):

The trick is:  The last expression is always the return value for the function.  And Ruby will create a variable on demand.  And Ruby considers a semicolon the end of a statement.  So, what I'm doing is saying "Create the variable named 'v' and assign it to a.tp"  Then, when the next statement clears a.tp, the value is preserved in the just-created variable 'v'

And, the last value after the last semicolon (v*50) becomes the return value for the damage formula.

So, if you used Java, the same code would look like this:

int v=a.tp;

a.tp=0;

return v*50;
 

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
Glad to help, Nugem.

To avoid confusion:  there is no real "preservation" command.  

I'm relying on a nifty little trick in Ruby (the scripting language which runs inside RPG Maker):

The trick is:  The last expression is always the return value for the function.  And Ruby will create a variable on demand.  And Ruby considers a semicolon the end of a statement.  So, what I'm doing is saying "Create the variable named 'v' and assign it to a.tp"  Then, when the next statement clears a.tp, the value is preserved in the just-created variable 'v'

And, the last value after the last semicolon (v*50) becomes the return value for the damage formula.

So, if you used Java, the same code would look like this:

int v=a.tp;

a.tp=0;

return v*50;
I see. I realised that after analysing the code a bit.

But I really appreciate your explanation.

I'm just in my first week of game dev. school, everything I know is self taught so I'm pretty clumsy.

Thanks for your time, pal.
 

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,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top