Status
Not open for further replies.

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
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?
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
Try:

$gameVariables.value(user.actorId);
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,575
Reaction score
1,623
First Language
Spanish
Primarily Uses
RMVXA
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.
 

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
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.
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
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)
 

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
Aand it doesn't work as well...

I've got my two actors who are on ID 2 and 3 - http://puu.sh/wte1H/0f679a729c.png
Both of them are the same class, with this notetag - http://puu.sh/wte3L/81818d71ef.png
It should return their own personal ID and use the variable in it...
I've made a small test to be sure the variables are well set, and they are - http://puu.sh/wte7f/747f310855.jpg
The result is always 1 hp no matter what - http://puu.sh/wte7M/e36cfe58d4.jpg

I really hope someone can help me, because it's a crucial aspect of my game and without it the game is nothing ;v;
But thanks to other who made efforts for me!
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,575
Reaction score
1,623
First Language
Spanish
Primarily Uses
RMVXA
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.
 

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
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!
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,364
Reaction score
9,061
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Anyone here ever confronted a never-ending loading screen? Took me 3 hours to realize the problem was the font format :yswt:
Ah, the problems a noob runs into...
WOOHOO!! FIXED A MAJOR SHOP PROBLEM I HAD FOR MONTHS, WHAT A WAY TO END MY STAY-CATION!
44 viewers at the same time!! :p That must be a personal record! ;)

1643393895196.png


I tried to make a face portrait.
it's the first ever time I try something like this, hope it came out decently even if it was my first.

Forum statistics

Threads
118,799
Messages
1,118,779
Members
155,973
Latest member
AlexeySova
Top