Enhanced TP - Help getting the eval for Srdudes Menu Status Customizer

Hey there,

I just try to implement with
Spoiler: SRdudes Menu Status Customizer
: my current TP Mode from
Spoiler: Enhanced TP Mode - Yanfly
.

I need the actual eval for the TP Mode. With: actor._tpMode i can atleast show the number of the actual Tp Mode.

Now is the question how I can display the name?

If I use actor.tpMode (Yanfly help file suggests battler.tpMode() but obviously doesnt work because we are in a menu not a battle)

He always shows me this function:

Game_BattlerBase.prototype.tpMode = function() {
if (!this._tpMode) this.initTpMode();
return $dataTpModes[this._tpMode];


May anybody help me with this?


regards Afaryz
You don't want to write the function itself, you want to call the function.

In Javascript you call functions by using parentheses, and any parameters to the function you pass inside the parenthesis. If there's no parameters to pass, you just use an empty parenthesis.

Note the Yanfly help file shows this with the empty parenthesis to call the function. Try this:

Code:
actor.tpMode()
You don't want to write the function itself, you want to call the function.

In Javascript you call functions by using parentheses, and any parameters to the function you pass inside the parenthesis. If there's no parameters to pass, you just use an empty parenthesis.

Note the Yanfly help file shows this with the empty parenthesis to call the function. Try this:

Code:
actor.tpMode()
I already did, and then it displays always this:
function() {
if (!this._tpMode) this.initTpMode();
return $dataTpModes[this._tpMode];

(As i mentioned before, just forgot the brackets here) maybe it is not possible to show name with srdudes menu customizer
Please show a screenshot of what you configured and how it shows.
Please show a screenshot of what you configured and how it shows.

Sure!

Here we go:

Spoiler: Screenshots
y62xad7t.png


xy745pa5.png
Ok I see now --> using the actor.tpMode() returns the entire TP mode object including name, icon, ID, description, etc.

I always tell people to test it in the console first, you can easily see what you're dealing with. For example, for Harold with all the default settings, in the console type
Code:
$gameActors.actor(1).tpMode()

Then you can actually see what it is instead of guessing.

upload_2019-7-27_9-16-27.png


To access the "name" of the TP Mode inside the menu status customizer, just do:
Code:
actor.tpMode().name

To access the "description" of the TP Mode, do:
Code:
actor.tpMode().description

And so on, for any other property you want to show.
Ok I see now --> using the actor.tpMode() returns the entire TP mode object including name, icon, ID, description, etc.

I always tell people to test it in the console first, you can easily see what you're dealing with. For example, for Harold with all the default settings, in the console type
Code:
$gameActors.actor(1).tpMode()

Then you can actually see what it is instead of guessing.

View attachment 120138

To access the "name" of the TP Mode inside the menu status customizer, just do:
Code:
actor.tpMode().name

To access the "description" of the TP Mode, do:
Code:
actor.tpMode().description

And so on, for any other property you want to show.
Wow thanks! This will also help me in the future too, thanks your fast reply and help.

Works perfectly 🙂

Is it also possible somehow to get the icon on this way? I just getting the .iconIndex 🙁
You can get the Icon Index (the Icon Index is a number) for the TP Mode using the same strategy as above.

Drawing the icon in the status window is a slightly different question. It depends if the SRD plugin has the ability to draw icons, like how in the Show Text event command you can write "\i[4]" to draw icon #4. If the SRD plugin allows that (it might say in the help file), then you could draw the icon using the Icon Index of the TP Mode.
You can get the Icon Index (the Icon Index is a number) for the TP Mode using the same strategy as above.

Drawing the icon in the status window is a slightly different question. It depends if the SRD plugin has the ability to draw icons, like how in the Show Text event command you can write "\i[4]" to draw icon #4. If the SRD plugin allows that (it might say in the help file), then you could draw the icon using the Icon Index of the TP Mode.
Yes i can draw icon with "\\i[x]" but it seems that he can't read the index out of actor.tpMode().iconIndex when i use it like this "\\i[actor.tpMode().iconIndex]"'
Can i store it maybe through the eval into a variable? 🙂 Because actor.tpMode().iconIndex works flawless and shows the right number

Original thread: https://forums.rpgmakerweb.com/threads/enhanced-tp-help-getting-the-eval-for-srdudes-menu-status-customizer.111489/