How to make the most of custom formulae. Part #1

A question if i put a condition to haves state to cause damage (correct my syntax if wrong) b.state=="X" ?  1000 : 100

"X" begin the state id

its can work whit states that are used as passive states (that can only begin set by script like yanfly passive states)?
b.state?(X) ? 1000 : 100
Tanks
Many years later and this thread still kicks butt. Thanks for this!

I'm trying to make a skill that has an increased effect when under the effects of a state (increased effect should be +50% damage & a longer version of the applied state).

a.state?(47)? b.add_state(4); a.mat + a.mat / 2 : b.add_state(76); a.mat

I've tried different variations of that and either get 'null' or one of two error messages. What am I doing wrong?
Try this

a.state?(47)? b.add_state(4); a.mat * 1.5 : b.add_state(76); a.mat

You don't state what the error messages were.  If this doesn't work, could you give us that info, it might help identify what needs to change.
Try this

a.state?(47)? b.add_state(4); a.mat * 1.5 : b.add_state(76); a.mat

You don't state what the error messages were.  If this doesn't work, could you give us that info, it might help identify what needs to change.
Yeah, sorry--was hoping whatever issue I had in my formula would be obvious enough. The error I get now is:

Script 'Game_Batter' line 352: Syntax error occurred.

unexpected ';', expecting ':'

(formula)

Which is one of the two I was getting before. I use a similar (functioning) formula in other skills, but they don't add states, so I'm inclined to think the problem lies with the adding of a choice of states. But I know very little of this kind of stuff (for example, I've looked at line 352 and it didn't clear anything up for me).
Code:
a.state?(47) ? (b.add_state(4); a.mat * 1.5) : (b.add_state(76); a.mat)
Ah yes, of course, the brackets!
a.state?(47) ? (b.add_state(4); a.mat * 1.5) : (b.add_state(76); a.mat)
Nice one, thank you!
Is there a way to make my character's normal attacks add a value to a variable based on what type of weapon they have equipped? It seems like doing it via the damage formula box would require too much space, but perhaps there's a way to extend it? Or maybe there's another script that can accomplish this?
If it doesny fit the box, you can always create your formula in a method on the scripts editor then just call your method in the damage formula
Is there anyway you could use the custom formulas in order to set a speed priority for the skill?
@SumRndmDde

Is there a reason you cannot use the 'Speed' box on the skill itself?  I mean the one in the middle of the screen.  You can adjust the speed priority there to whatever you want for the skill.
How would I add a check to this to add 20 damage if switch 132 is true (and 0 bonus if false)?
a.armors.include?($data_armors[2])?(a.atk*4-b.def*2)*1.2 : (a.atk*4 - b.def*2)

Thanks in advance ^-^
Code:
c=a.atk*4-b.def*2;c*=a.armors.include?($data_armors[2]) ? 1.2 : 1;c+=$game_switches[132] ? 20 : 0;c
Hi, thought I'm better off asking here:


I've been making up some new skills, but there's one skill idea of which I'm not sure how to do.


Basically, I have a skill that randomly attacks foes, but the amount of attacks is determined by the users' mana. Each 20% mana is one hit, so 100% of mana should amount to 5 hits. How would I code that?
If it will hit a single target, you can use my Custom Repeat script, if it needs targets to be randomized each hit you will need to find something else...

Dealing damage to random enemies can be done in damage formula, but if you want to show things like animations per hit and damage messages or pop ups then it will surely not fit in that boz
If it will hit a single target, you can use my Custom Repeat script, if it needs targets to be randomized each hit you will need to find something else...


Dealing damage to random enemies can be done in damage formula, but if you want to show things like animations per hit and damage messages or pop ups then it will surely not fit in that boz
I'll be using a scriplet for it, I figure I'll have to anyway 🙂 and I have a script (from yami) that has the <hits random foes> option, afaik, but I need to determine the amount of hits in some way..


What is your Custom Repeat script? I can't seem to find it.
Try looking here: www.lescripts.wordpress.com/rgss3

PS: cant get you a direcr link for now, sorry
I already took a peek there before I posted, but I couldn't find it.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-the-most-of-custom-formulae-part-1.1143/