MV Referencing Party Position in Formulas?

As title says.

I'm aware that it was asked before, and Shaz posted an answer to it. However hisher solution did not work for me, the question remains unsolved, and I'm not comfortable with necroing that thread.

Essentially, I'm thinking of modifying the TGR formula (via Yanfly's Special Parameters Formula) to include the position of that actor in the party (think FF1 for NES, kinda).
Code:
$gameParty.members().indexOf($gameActors.actor(id))

Above is what Shaz provided. I tested it out by putting it in the damage formula of a skill, and all 4 party members dealt 0 damage, as opposed to only the party leader doing 0 (then the next member doing 1 damage, next 1 is doing 2, etc). I didn't proceed with testing it as part of plugin formula for TGR because I got no desirable result.

I found no other thread with the same concern, and I'd be appreciative if I can get an answer for this. This is something that can prove useful for others, and I'd be using this knowledge extensively too if I get an answer.
However his solution did not work
her solution 😉

$gameParty.members().indexOf($gameActors.actor(id))
If that is exactly what you put, then no, it isn't going to work. You are meant to put the actor's id where the formula says id. It's also not meant to be used on its own - I assume you are trying to compare it to something? Why do you want to know who's in what position?

Show us your exact damage formula please. I'm sure it's a simple issue.
The YEP Special Parameter Formula plugin has a user variable available for its formulae. So you should be able use this to get their position in their unit:
JavaScript:
user.index()
This will be 0 for the leader, 1 for the first follower, etc.

Remember to save your project to apply Plugin Manager changes before testing!

If it's still not working then, like Shaz says, we'd need to see the full formula you're using.
her solution 😉
Whoops. My bad... orz
If that is exactly what you put, then no, it isn't going to work. You are meant to put the actor's id where the formula says id. It's also not meant to be used on its own - I assume you are trying to compare it to something? Why do you want to know who's in what position?
Yes, I did try to use the formula as-is. I'm intending to get that number so I can create a formula that results in a higher number depending on the actor's position in battle
1628791191176.png

The YEP Special Parameter Formula plugin has a user variable available for its formulae. So you should be able use this to get their position in their unit:
JavaScript:
user.index()
This will be 0 for the leader, 1 for the first follower, etc.

Remember to save your project to apply Plugin Manager changes before testing!
This did not work for the damage formula, but I will go ahead and try it on the plugin and report to see if it works there.

EDIT: So I did a dumb and forgot the parentheses in "user.index()". It now works in damage formulas, and after testing it in the TGR, enemies now are attacking the intended target more frequently.

Thanks for your patience, y'all.
Moved to: Plugin Support
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/referencing-party-position-in-formulas.139520/