MV Operations on actors finding them by name

Hi!
I have a lot of actors and I need to check/change a param value of a specific actor searching him/her by name.
Impossible do this with the default CB box, too many....
How can I do these operations?

I.e. I need to check/change the Luck param of an actor called "Joe".
"Joe" is just one among other 100000etc. actors I have.
I already know how check if actually there is, in the whole party, an actor called that way but then?
There is a script that can "catch" this specific actor and store his param x value in a variable in order to be able to check it later?
There is way to "catch" this specific actor and change his param x value (+ - 1)
You can loop over all actors in the party and find one with a matching name, e.g.
Spoiler: Script call
JavaScript:
var id = 0;
$gameParty.members().some(function(a) {
  if (a.name() === 'Joe') {
    id = a.actorId();
    return true;
  }
  return false;
});
$gameVariables.setValue(1, id);
This gets the actor ID of the first party member named "Joe", then stores that ID in game variable 1 (change the number/name as needed). You can then use this for later reference, e.g.
Spoiler: Event example
Code:
◆Comment:Find actor named "Joe"
◆Script:var id = 0;
:      :$gameParty.members().some(function(actor) {
:      :  if (actor.name() === 'Joe') {
:      :    id = actor.actorId();
:      :    return true;
:      :  }
:      :  return false;
:      :});
:      :$gameVariables.setValue(1, id);
◆Comment:Give them +1 LUK
◆Change Parameter:{Variable 1}, Luck + 1
◆Text:None, Window, Bottom
:    :\N[\V[1]] gained +1 luck!
You can also use the stored actor ID to get values on that actor, e.g. what's Joe's current LUK?
JavaScript:
$gameActors.actor($gameVariables.value(1)).luk
Hope that helps! 😂

[Edit: corrected forEach -> some in event example.]
Hi!
Don't know if I really get it...
But you can a script call like this if you want to store the value in a game variable:
Or if you are talking about an actor that is in your party:
const actor = $gameParty.members().find(member => member ._name === 'Joe')
This will return to you the actor with this name in your party. SO you can do a check:
if(actor){
$gameActors.actor(actor._actorId).addParam(paramId, value);
}
I think the Luck paramId is 7.

JavaScript:
const actor = $gameParty.members().find(member => member._name === 'Joe')
if(actor){
$gameActors.actor(actor._actorId).addParam(paramId, value);
}

I don't test it yet, so maybe you can test and see if works.
You can loop over all actors in the party and find one with a matching name, e.g.
Spoiler: Script call
JavaScript:
var id = 0;[/INDENT][/INDENT]
[INDENT][INDENT]$gameParty.members().some(function(a) {[/INDENT][/INDENT]
[INDENT][INDENT]  if (a.name() === 'Joe') {[/INDENT][/INDENT]
[INDENT][INDENT]    id = a.actorId();[/INDENT][/INDENT]
[INDENT][INDENT]    return true;[/INDENT][/INDENT]
[INDENT][INDENT]  }[/INDENT][/INDENT]
[INDENT][INDENT]  return false;[/INDENT][/INDENT]
[INDENT][INDENT]});[/INDENT][/INDENT]
[INDENT][INDENT]$gameVariables.setValue(1, id);
This gets the actor ID of the first party member named "Joe", then stores that ID in game variable 1 (change the number/name as needed). You can then use this for later reference, e.g.
Spoiler: Event example
Code:
◆Comment:Find actor named "Joe"[/INDENT][/INDENT]
[INDENT][INDENT]◆Script:var id = 0;[/INDENT][/INDENT]
[INDENT][INDENT]:      :$gameParty.members().forEach(function(actor) {[/INDENT][/INDENT]
[INDENT][INDENT]:      :  if (actor.name() === 'Joe') {[/INDENT][/INDENT]
[INDENT][INDENT]:      :    id = actor.actorId();[/INDENT][/INDENT]
[INDENT][INDENT]:      :    return true;[/INDENT][/INDENT]
[INDENT][INDENT]:      :  }[/INDENT][/INDENT]
[INDENT][INDENT]:      :  return false;[/INDENT][/INDENT]
[INDENT][INDENT]:      :});[/INDENT][/INDENT]
[INDENT][INDENT]:      :$gameVariables.setValue(1, id);[/INDENT][/INDENT]
[INDENT][INDENT]◆Comment:Give them +1 LUK[/INDENT][/INDENT]
[INDENT][INDENT]◆Change Parameter:{Variable 1}, Luck + 1[/INDENT][/INDENT]
[INDENT][INDENT]◆Text:None, Window, Bottom[/INDENT][/INDENT]
[INDENT][INDENT]:    :\N[\V[1]] gained +1 luck!
You can also use the stored actor ID to get values on that actor, e.g. what's Joe's current LUK?
JavaScript:
$gameActors.actor($gameVariables.value(1)).luk
Hope that helps! 😂
This is exactly what I was searching!

I'll test also your solution Eliaquim, thanks to always help^^

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/operations-on-actors-finding-them-by-name.125822/