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

Afaryz

Veteran
Veteran
Joined
Jun 29, 2018
Messages
57
Reaction score
14
First Language
German
Primarily Uses
RMMV
Hey there,

I just try to implement with
: my current TP Mode from
.

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
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
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()
 

Afaryz

Veteran
Veteran
Joined
Jun 29, 2018
Messages
57
Reaction score
14
First Language
German
Primarily Uses
RMMV
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
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
Please show a screenshot of what you configured and how it shows.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
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.
 

Afaryz

Veteran
Veteran
Joined
Jun 29, 2018
Messages
57
Reaction score
14
First Language
German
Primarily Uses
RMMV
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 :(
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
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.
 

Afaryz

Veteran
Veteran
Joined
Jun 29, 2018
Messages
57
Reaction score
14
First Language
German
Primarily Uses
RMMV
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
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Haired slime? Trying some different styles of art. Maybe I can make some resources with this new kind of painting.......
i love my game very much
Uh, I'm probably overthinking this, but I think that some of my music sounds kinda...bad?
The melodies are just sort of awkward, and don't flow.
I'm really not sure what to do. Why am I even worrying about this? I don't even have a battle system yet!
And the Lord said, let there be lighting effects! And there were lighting effects! And it was good...ish? Might tweak this some more.
Today was a day of good things! Thank you fate! I pray to the darkness that those that read this will enjoy a good day as well! Power to the gam mak.

Forum statistics

Threads
105,721
Messages
1,015,903
Members
137,401
Latest member
Rubbun
Top