Referencing a different actor's stats in a damage formula

Hi all!


First time posting! I had a quick question about a damage formula i'm trying to write for a skill. Basic idea behind the skill is that it casts a barrier that nullifies an element and if no attack of that element is blocked for the turn, the barrier state is removed and damage is dealt. I've already got a script that will cause the damaging skill at turn's end, I just need to know how to write its damage formula.


my best attempt so far has been: $game_actors[6].params[4] * 5 - b.mdf * 2 but that consistently fails to return anything but 0.


If my attention in that (non-functioning) formula is unclear, I want to reference the MAT of actor #6 in the database who is the only possible user of the initial skill.
Just for clarification, the skill this formula is going into is not a skill Actor 6 uses, correct?
Just for clarification, the skill this formula is going into is not a skill Actor 6 uses, correct?

That's right. Unfortunately, the way the script i'm using is set up, the way the turn end skill is calculated it uses the stats of whoever has the state so the normal "a.mat" won't work.


Ideally, I'd like for it to always cast using the same character's stats which is why I would like to directly reference them in some way.
Ya, sorry you got me there. I'm not educated enough with formulas yet to help with that. If the script you are using is one that is available to everyone(as opposed to one you wrote yourself and aren't sharing publicly), I would suggest posting the download link and ask over in the scripts forums to see if anyone has had any experience with that particular script. Good luck!
Not a problem and thanks.


You raise a good point about the script, it's the script "End Turn/Action Skill v1.3" by Shad3Light (on mobile atm, so I don't have a link handy unfortunately).


The script itself does exactly what it needs to, the problem is that the skill I'm setting up to be used at turn's end treats the person with the state as the source of the attack, which I'm trying to circumvent.
You can use $game_actors[6] exactly like the attacker a. To get that actors mat, you could use either of these:


$game_actors[6].mat


$game_actors[6].param(4)


So you were almost correct there already.
You can use $game_actors[6] exactly like the attacker a. To get that actors mat, you could use either of these:


$game_actors[6].mat


$game_actors[6].param(4)


So you were almost correct there already.

D'oh! Just tested and it's working like a charm.


Problem solved!

Original thread: https://forums.rpgmakerweb.com/threads/referencing-a-different-actors-stats-in-a-damage-formula.60327/