Ok so basically, I'm using Yanfly's extra parameter plugin, so in all I can make formulas for growth.
What I want is that specific stats will be based on a variable stocked at the same value as the actor's ID,
so for example an actor with the ID of 100 would have a certain number in the ID 100 that would affect its growth.
For now, I have set up literally everything, but only one things lacks me-
maxhp = $gameVariables.value(this.??????);
I saw Yanfly using this.name in his example, how can I get the ID of the actor?
Try:
$gameVariables.value(user.actorId);
battlemanager.actor.id
I don't remember if yanfly systems still rely on battlemanager, but battlemanager should trigger up at battle scene, still getting the actor in play, regardless of the controller for the battle.
if you're not in battle, then the user is always the player.
battles are iterations of self-contained 1v1 duels.
there's always one attacker and one defender.
the item processing is done at the defender side, "self" being the defender and "user" being the actor (friendly or enemy) who triggered the action.
I'm not sure honestly. I mean, it's a formula used in general; both in battle and out of it. I've tried multiple things like user.id, user.id(), user.actorId, none of these work. I'm really not a pro on this domain, and if I don't make a script myself I have a p hard time understand it (Yanfly's) so I'm not sure what I should be using here.
Also, I found this in the help instruction of Yanfly's plugin:
Class Notetags:
<Custom Param Formula>
if (this.name() === 'Harold') {
value = level * 30 + 300;
} else {
value = level * 25 + 250;
}
</Custom Param Formula>
I simply assumed it was this.id but it doesn't seem to work.
Oops, slight error on my part. Instead of using user.actorId, use user.actorId(); So it would look like:
$gameVariables.value(user.actorId());
This should work(or at least I don't see a reason for it not to)
When dealing with plugins, you have to know how the plugin was coded.
"user" in that context can be anything
Find the definition of "user", and you should be set.
Usually "user" is the actor that initiated the action at battle time, from the target's perspective, while applying an item effect.
I suggest you make a systematic backtrace to the definition of "user" from what you've got, which is the note tag and the parameter.
Find the code that checks for "custom param formula". That should point you to the function that handles anything that has a variable name within that declaration.
The way it is written, that block of "custom param formula" *must* be sent to an evaluation instruction and ran, as it is.
It is code... something is bound to be set to run that code and obtain a result.
Find the bit of code that deals with that process.
you can also try and sneak a print instruction within that formula, to print out "user" itself.
you should be able to see what class it is, and take it from there.
Oh my god! It finally works. Big thanks to you guys!
In the end, it was this.actorId() - This really will help me a lot in my project.
Have a marvelous day!