yes it would (read comment above the one i quoted, important info [took me forever to type])
Stats increase as certain attacks are successful
RGSS3 Script RequestsYou don't put the 1121 there... copy paste my code directly and don't edit the def addstat(user,target,paramid,bonus) line...
You put the values only when you're calling the method...
Like, on the damage formula:
addstat(a,b,2,1)
Also, I forgot to write it down but the whole code should be inside Class_GameBattler
so the custom code should look like this
class Game_Battler < Game_BattlerBase
Paste code here
end
btw, you should probably get yanfly's anti-fail script so that when you use skills that deal no damage but uses the formula bar, it won't show a fail message
You put the values only when you're calling the method...
Like, on the damage formula:
addstat(a,b,2,1)
Also, I forgot to write it down but the whole code should be inside Class_GameBattler
so the custom code should look like this
class Game_Battler < Game_BattlerBase
Paste code here
end
btw, you should probably get yanfly's anti-fail script so that when you use skills that deal no damage but uses the formula bar, it won't show a fail message
Okay ill be sure to get the yanfly script (later today or tonight or tomorrow), also i'm probably being an idiot right now but where Exactly do i put it (iv'e put it at the start and end, the end is what most concerns me it gives an error saying...\

You forgot a comma at the last line inside the hash, it should be 3 => 0,}
when working with hashes, always put a comma at the last line, else it will error
and you don't really need to put it inside the default Game_Battler script you know...
you could, and I suggest that you do create a new script then put this:
class Game_Battler < Game_BattlerBase
then paste your code
then type end
when working with hashes, always put a comma at the last line, else it will error
and you don't really need to put it inside the default Game_Battler script you know...
you could, and I suggest that you do create a new script then put this:
class Game_Battler < Game_BattlerBase
then paste your code
then type end
i thought you meant put it in the game_battler script (shows you my knoledge in a nutshelll)
it's fine to do it, but it's better to just do it in another script... XD...
well it works, or well runs without popping an error at my face every 5 seconds (welcome to errorville, population: me)
and i had an error with the end thing i had to type 4 to get it to stop but now i put in the dammage formula 'customattack (a, b, 2, 1)' correct? and if so the script will function or was that a different script?
you put:
addstat(a,b,2,1)
addstat(a,b,2,1)
ok so id put addstat(a,b,2,1); a.atk * 4 - b.def * 2 or is the add stat thing why you wanted me to get the anti-fail script in the first place?
Ah... You only need the anti-fail script if you have a skill that would use the addstat but has no damage... if it deals damage, then you don't need it...
Umm using either the add stat alone or the formula i wrote addstat(a, b, 2, 1); a.atk * 4 - b.def * 2 dont deal dammage to either party (party being anyone/anything in battle)
Edit: dont get confused i mean it doesnt deal dammage but uses the addstat for some random reason so it sais slime took no dammage instead of
slime took 217 dammage (yes slimes are weak, problem?)
but it doesn't give an error? hmmmm...
I can't really test it now, but I can test when I get home this evening and try to find a fix and get back to you tomorrow...
I can't really test it now, but I can test when I get home this evening and try to find a fix and get back to you tomorrow...
: is used for the ? conditionals...
try this
def addstat(user,target,paramid,bonus,dam="0")
if user.actor?
if target.enemy?
chance = 75
gap = $rank - target.EN_RANKS[target.enemy.id]
if gap > 0
chance += 5*gap
else
chance -= 10*gap
end
if rand(100) <= chance
user.add_param(paramid, bonus)
end
end
eval(dam)
end
end
then on the formula bar:
addstat(a,b,2,1,"a.atk*4 - b.def-2")
try this
def addstat(user,target,paramid,bonus,dam="0")
if user.actor?
if target.enemy?
chance = 75
gap = $rank - target.EN_RANKS[target.enemy.id]
if gap > 0
chance += 5*gap
else
chance -= 10*gap
end
if rand(100) <= chance
user.add_param(paramid, bonus)
end
end
eval(dam)
end
end
then on the formula bar:
addstat(a,b,2,1,"a.atk*4 - b.def-2")
Drum roll please, http://www.youtube.com/watch?v=t925JwYXhVA It DOESNT do dammage
i copy/pasted the script (the part knew i was gonna replace i deleted ) and replaced it and the did the same for the formula (just my average sunday my modays are better) also you need a third end there bud otherwise you will get errors. (am i just prone to finding bugs can someone else please test this to confirm my supisions as correct? i might just be [or am] a complete idiot) :headshake:oh wait, I placed the eval part on the wrong spot... also, the end number is right, unless you deleted the end for Game_Battler too when you deleted the def...
end
eval(dam)
end
end
this should be
end
end
eval(dam)
end
if it still won't do damage, then I need to test it first myself later... so we cannot continue until tomorrow...
end
eval(dam)
end
end
this should be
end
end
eval(dam)
end
if it still won't do damage, then I need to test it first myself later... so we cannot continue until tomorrow...
yes 4 for the def, but I didn't add the first one since it's already above the line that you need to edit anyway... there will be 5 in total though because of the "end" for the class itself
the eval part should be between end 3 and end 4, because end 4 is the end keyword for the method (def), so since you placed eval after that, the eval was already outside of the method
the script should look like
class Game_Battler < Game_BattlerBase
#the rank hash and variable here
def addstat(user,target,paramid,bonus,dam="0")
if user.actor?
if target.enemy?
chance = 75
gap = $rank - target.EN_RANKS[target.enemy.id]
if gap > 0
chance += 5*gap
else
chance -= 10*gap
end
if rand(100) <= chance
user.add_param(paramid, bonus)
end
end
end
eval(dam)
end
end
the eval part should be between end 3 and end 4, because end 4 is the end keyword for the method (def), so since you placed eval after that, the eval was already outside of the method
the script should look like
class Game_Battler < Game_BattlerBase
#the rank hash and variable here
def addstat(user,target,paramid,bonus,dam="0")
if user.actor?
if target.enemy?
chance = 75
gap = $rank - target.EN_RANKS[target.enemy.id]
if gap > 0
chance += 5*gap
else
chance -= 10*gap
end
if rand(100) <= chance
user.add_param(paramid, bonus)
end
end
end
eval(dam)
end
end
I think i see the problem because of my flaming eye, the damage value (dam) has ="0" which sets all damage dealt to 0 correct? and because of this said reason it always does NO damage to enemies or characters or do the quotations cancel that out (i don't know i'm not a scripter i'm just sometimes good at pointing out peoples mistakes) but i'm pretty sure you've tested this at least once with this and got damage but i get none:
here's proof im not yanking your chain:

I currently have 7 images of this problem specifically saved
nope, it only sets it to zero if you don't put a value for it in the call
if you do addstat(a,b,2,1), then it sets dam to 0
but if you do addstat(a,b,2,1,"100"), then it sets dam to 100
if I only did it like
def addstat(a,b,2,1,dam)
#things here
end
then doing addstat(a,b,2,1) in the formula bar will throw you an argument count error saying you only sent 4 parameters instead of 5...
so if the new code still returns no damage, then it might mean that the argument you sent isn't evaluated...
you can also try using
addstat(a,b,2,1,"user.atk*4-target.def*2")
instead of
addstat(a,b,2,1,"a.atk*4-b.def*2")
if you do addstat(a,b,2,1), then it sets dam to 0
but if you do addstat(a,b,2,1,"100"), then it sets dam to 100
if I only did it like
def addstat(a,b,2,1,dam)
#things here
end
then doing addstat(a,b,2,1) in the formula bar will throw you an argument count error saying you only sent 4 parameters instead of 5...
so if the new code still returns no damage, then it might mean that the argument you sent isn't evaluated...
you can also try using
addstat(a,b,2,1,"user.atk*4-target.def*2")
instead of
addstat(a,b,2,1,"a.atk*4-b.def*2")
Original thread: https://forums.rpgmakerweb.com/threads/stats-increase-as-certain-attacks-are-successful.17346/


