Thanks!
How to make the most of custom formulae. Part #1
RMVXAce Tutorialsgot a new question for you, how do you make an attack always be a critical one. I am creating a skill that has an MP Critical factor to it;
example
if a.mp>=100; a.mp-=100; (auto critical attack formula here); else; (a.atk*4-b.def*2)
I know about b.result.critical, just not sure how to do what I want.
example
if a.mp>=100; a.mp-=100; (auto critical attack formula here); else; (a.atk*4-b.def*2)
I know about b.result.critical, just not sure how to do what I want.
I would disable criticals for that power and then use your normal attack formula but multiple it by 3 like so
Code:
if a.mp>=100; a.mp-=100;
(a.atk*4-b.def*2) * 3
else;
(a.atk*4-b.def*2)
I wanted to let the player know that a critical attack was performed, that way just shows it as a normal attack.
Try:
Code:
if a.mp>=100;@result.critical=true;(a.atk*4-b.def*2)*3;else;(a.atk*4-b.def*2);end;
unfortunately @result.critical=true is not a valid argument, if I include it, the formula is skipped and no damage is calculated.
Okay, so I'm thinking using something like an incremental success rate calculation for attacks, affecting how much damage is dealt. With stats swapped around be Skill and Power, respectively for Atk and Def, just for clarification here...
So, does something like this look about right?
Hence, my suggested code would be to set variable "smackdown" (for lack of a better name) to (attacker skill+roll)-(defender skill+roll), then if the attack hits (by virtue of the variable being 1 or higher), deal damage equal to attacker's power plus a bonus equal to attacker's power multiplied by a tenth of the "smackdown" variable.
...A little clearer now?
*D'oh* And, as I had the tutorial printed for an even more thorough read (along with a couple others) on the bus, I finally spot the bit about $game_variables[x] or v[x]... The jury's still out on the subject of whether I drink too much at work, or not enough. >.<
So, does something like this look about right?
I'll try to clarify - it was a bit awkwardly phrased. Basically, I want to save the "attack roll" in a variable to which I can refer in the damage calculation step. I've got a background in tabletop roleplaying more than console games, so some of the terminology and even basic concepts can be... tricky to translate at times.
Hence, my suggested code would be to set variable "smackdown" (for lack of a better name) to (attacker skill+roll)-(defender skill+roll), then if the attack hits (by virtue of the variable being 1 or higher), deal damage equal to attacker's power plus a bonus equal to attacker's power multiplied by a tenth of the "smackdown" variable.
...A little clearer now?
*D'oh* And, as I had the tutorial printed for an even more thorough read (along with a couple others) on the bus, I finally spot the bit about $game_variables[x] or v[x]... The jury's still out on the subject of whether I drink too much at work, or not enough. >.<
Whoops:
Code:
if a.mp>=100;b.result.critical=true;(a.atk*4-b.def*2)*3;else;(a.atk*4-b.def*2);end;
I didn't follow that. An incremental success rate though would require some tracking of attempts. I'll do something like it in the follow up tutorial should I ever finish it.
thanks for your help,
if a.mp>=100;b.result.critical=true;(a.atk*4-b.def*2)*3;else;(a.atk*4-b.def*2);end;
works perfectly.
if a.mp>=100;b.result.critical=true;(a.atk*4-b.def*2)*3;else;(a.atk*4-b.def*2);end;
works perfectly.
Right, think I've figured out how to set up the basic attack skill as I want it... Drawing inspiration from White Wolf's Storyteller system, I figured out how to save the results of an opposed attack roll in a variable, which then gets referenced and, if one or more, gets added as a bonus to the damage roll...
v[1]=rand(a.atk)-rand(b.atk);if v[1]>=1;rand(a.def+v[1]);else;0;end
Seems to work like a charm. That leaves the relatively easy task of scaling stats down to topping out maybe somewhere in the twenties, for the sheer sake of sanity... And do similar things to all the OTHER skills for which something like this bears relevance, i.e. everything...
Perhaps I do have a masochistic streak, I dunno... 😉
v[1]=rand(a.atk)-rand(b.atk);if v[1]>=1;rand(a.def+v[1]);else;0;end
Seems to work like a charm. That leaves the relatively easy task of scaling stats down to topping out maybe somewhere in the twenties, for the sheer sake of sanity... And do similar things to all the OTHER skills for which something like this bears relevance, i.e. everything...
Perhaps I do have a masochistic streak, I dunno... 😉
Hey Fomar is it possible to have a forumla set up to give a debuff 85% of the time? Like for example this one attack I have set up, 85% of the time it'll add an ATK debuff and a DEF debuff on the enemy.
I thought you could do that with traits.
I don't think you can have a chance of it happening. It'll be 100% with the traits I think.
Wouldn't that just be setting the invocation success rate to 85%?
Or are you talking about an attack that has an 85% chance of placing a couple of debuffs in addition to the damage?
Or are you talking about an attack that has an 85% chance of placing a couple of debuffs in addition to the damage?
An attack that has 85% chance of placing a couple of debuffs in addition to damage. Despite what you two seem to think, I do know my way around the skills tab! XD I wouldn't have asked if I was 99% sure I couldn't do it normally.
You can do this normally with traits / features. When you select which debuff you add there is a box below the selection used for putting in % chance to occur.
Okay, making a bit of a wild-uh... donkeyed guess here...
Set up a skill... let's say number 500, just for the sake of picking a number. That skill inflicts the debuffs, with absolute certainty.
In the attack skill that might cause those debuffs, see if you can try
v[x]=rand(100)+1;if v[x]>=15;$data_skills[500];else;end
Bear in mind, this is a guess on my part; I'll be running a few tests along those lines now.
Set up a skill... let's say number 500, just for the sake of picking a number. That skill inflicts the debuffs, with absolute certainty.
In the attack skill that might cause those debuffs, see if you can try
v[x]=rand(100)+1;if v[x]>=15;$data_skills[500];else;end
Bear in mind, this is a guess on my part; I'll be running a few tests along those lines now.
@lohenian: No you can't. That is for states, not debuff. -- This is what the debuff window looks like: http://i1012.photobucket.com/albums/af243/earlronove/noyoucant.png - As you can see, no way to add a percentage of it happening.
@Warpmind: I don't think it worked? At least it didn't do it a total of 10 times in my test. In addition, how do I keep the how much the skill damages along with what you suggested? When I put that after what sets up the how hard the skill hits, it throws a scripting error at me, but if I take out the equation for damage, it works just fine.
@Warpmind: I don't think it worked? At least it didn't do it a total of 10 times in my test. In addition, how do I keep the how much the skill damages along with what you suggested? When I put that after what sets up the how hard the skill hits, it throws a scripting error at me, but if I take out the equation for damage, it works just fine.
Yyyeah, I get the same problem. Apparently, secondary branches don't work. -.-
Trying different approaches; working within a narrow space here, so may take time. (Long hit/damage formula already.)
Trying different approaches; working within a narrow space here, so may take time. (Long hit/damage formula already.)
not really sure if this is possible in the damage formula box, I know I can pull this off with a script (yanfly's followup attack script), but not any other way...
Edit:
my mistake it is the yanfly follow up skill script
Edit:
my mistake it is the yanfly follow up skill script
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-the-most-of-custom-formulae-part-1.1143/