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 Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top