Hello, I have a problem, I want to insert a long damage formula in the damage formula box, but it is too small.
1) Can someone give me a script that can expand this damage calculation box?
or
2) Explain me how I can insert my formula in script.
How to expand damage formula box in the database?
● ARCHIVED · READ-ONLY
-
-
You could make a new script:
class Game_Battler < Game_BattlerBase def custom_formula_name(a, b, v) #here you can add as much as you want endendthen you only need to write this in your skill formula box:
custom_formula_name(a, b, v) -
custom_formula_name(a,b,v)
What is a,b,v ??
Ok I understand now. -
How should I implement if statement??
class Game_Battler < Game_BattlerBase
def custom_formula_name(a,b,c,d)
if c > d
a+b
end
end
-
This simpel code does not work I get 0 damage :-(
In the box "a.custom_formula_name(a.atk ,a.agi ,b.agi)"
in the script
class Game_Battler < Game_BattlerBase
def custom_formula_name(a, b, c)
a+b+c
end
end
It works when I only have max 2 arguments. -
a, b and v are paramters, a is attacker b is target and v is variable.
You could make something like if a.atk > b.def.
What should your custom formula do? -
Thanks for your response.
When I restarted the game, then the formula I inserted in the script works. I did not know that restart is requried.
Now I will try to make this on my own, but if I stuck in something I will come back here. -
Restarts are usually not required, but if you were using the Test Battle functionality, that might be why it wasn't working, since only certain things are automatically saved when you start a Test Battle and I don't think the script editor changes are among those things. So you need to do a Save, then go back into the database and do a Test Battle.
-
So you need to do a Save, then go back into the database and do a Test Battle.
Thanks for this.
class Game_Battler < Game_BattlerBase
def custom_formula_name(b,c,d,a,e,f,g,h,i,j)
attack = e+rand(f-e+1)
a_speed = b+rand(c-b+1)
b_speed = d+rand(a-d+1)
b_defense = g+rand(h-g+1)
if a_speed > b_speed && attack > b_defense && i > j
attack*(50+50*(j/i))
end
if a_speed > b_speed && attack > b_defense && i < j
attack*(50+50*(i/j))
end
if a_speed > b_speed && attack > b_defense && i == j
attack
end
end
end
This is my formula after my adjustments, is this correct syntax??
It gives me 0 damage :-(
I also want to know how I can substract stats of my character after a battle, as a percentage of received damage. -
Xtreeme, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Yes, if you change scripts, you need to save before you do a battle test.
No, you can't just add heaps of arguments. a is the attacker; b is the target; v is a handle to $game_variables. That's it.
You can't use a script to change how the database behaves (your request to expand the custom formula box). Scripts affect what happens in the game, not what happens in the editor. Which is why, if you want something that won't fit into that box, you have to write your own as shown above.
Hope this clears things up a bit :)