skill targeting

Two questions:

How do I make it that a skill can be used on any target, friend or foe?

In addition, how do I make it that a skill can target anyone, except themselves?

In script, how do I get the target of the skill? 

You can use the word user to get the user of the skill, but how do I get the target?
1&2) you don't - those scopes do not exist by default, you would need a target manager plugin for them. Search what target managers exist and what options they add - and be warned that while a scope "all but user" is possible, "one ally but not user" is a lot more difficult to program.


As for the script option - where are you using that? Because in the damage formula and most parts of the scripts, you'll use a for the skill user and b for the target.
I've been doing a lot of mucking about in the Notes section of skills and whatnot to get the functionality I need. I have some very unusual game mechanics that I'm trying to implement, and none of the built in stuff (the UI) will allow me to do it. 

I need to be able to get information about the target on use of the skill (like their index if they have one (an ally)).

It seems like this targeting is going to be a challenge. What I need is: you can target any one single unit on the field of battle, friend or foe, except yourself. 

I think I'll have to look into these targeting plugins.

EDIT: I figured out how to get the target.  I am quite pleased with myself. It felt like dropping down into the rabbit hole searching through the code, looking for the links in the objects.

The user has in it the last action they used, and through that you can get its targets (plural, it returns an array).

user.inputtingAction().makeTargets()[0].name()

Will return the name of the first target (useful for single target abilities that only have one target anyway).

Original thread: https://forums.rpgmakerweb.com/threads/skill-targeting.54644/