Evaluate target incoming hit

Ok in hope, Im in the right place tuto or support,

so here is my problem im trying to make a skill that evaluate the incoming hit direction and to put a +- to damage depending on var
so i try common event that call a force action but it seem to complex when it could be easier and does not do what i want
so i try [damage formula] under damage core from yanfly and that what i came to so far
my variable 4 is = to random

that was a common event with force action that was returning the use of a skill with a different damage formula end up with 2
action and on top of it no damage...
example if skill call random 0 call skill 1... if random 1 call skill 2 ect...

control variable random
0-4 (so 0=front hit and 1= flank hit)
if { ( \V[4]===0);a.atk+a.agi*4}
if { (\V[4]===1);a.atk+a.agi*5}

this is just an exemple and was probably not be Writen the right way
----------------------------------------------------------------------------------------------------------------

my first problem was that it does not hit, i understood that i can call an event without a damage formulae..
so i look under Damage core from yanfly

In which i can call a damage formulae in skill notetag but aint sure of the proper way to write it down 20180310103052_1.jpg
so that my example of damage formula probably not written correctly,
first i would need to change the common event evaluation to be first in line and not last but that aside

my second problem was to evaluate the var[4] which is my random variable,
so that i could say you hit front rear flank...
20180310102925_1.jpg

so maybe if i write something like

if someone could confirm my java...

<damage formula>
random_variable[4](0,1,2,3,4)
if {(var[4]===0);a.atk+a.agi*4,call_event[5])}
if{(var[4]===1);a.atk+a.agi*5,call_event [5])}
etc....
<damage formula>

or am i in the dark...
'Tutorials' is where people who have made a tutorial they want to share with others can post them.

Moved to: RPGMaker MV
I'm not sure if it would work with quotes in your damage notetag cause i use the same plugin and write skills without them (if it does work with them you are missing a final quote).
well im aint sure myself, im not really good at writing java, and less to write damage formulae so when you say : quote should they be double or single, and where in the formulae would they be...you look little more experienced in that matter, so maybe you could gimme example...
cause im a total newbie in new damage formula...

i try to add \v do damage and in the end the troop didnt want to die, even with 10000 damage and 100 hp, like i was just showing the number
on the monster with no effect...

so ya any helping hand to understand that would be more than apreciate, <

tell a story : A+ using event and variable : B custom music and vid : A+++ battle flow : if there a letter after z it that one...lol
oh i just saw that...k
The common event in your skill is listed under effects meaning it happens when you land the skill.
you can put the entirety of your formula in the damage notetag there is no need for an common event in this case.
<damage formula>

Spoiler: code
v[180] = Math.randomInt(4)+1;

if(v[180] == 1)

{value = 1;}

if(v[180] == 2)

{value = 2;}

if(v[180] == 3)

{value = 3;}

if(v[180] == 4)

{value = 4;}

</damage formula>
You can copy it into your damage notetag replace the numbers after "value =" with your damage formula.
Also keep in mind which variable you use.
This might help you as well.
Wow you are a lifesaver today, big ty, owe you one, ill be sure to check that damage 101, seem reaaly complex but...where the a will their a way...
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/evaluate-target-incoming-hit.92448/