Solved calling the nickname of a Pokémon doesn't work

Marina

Elite Trainer
Member
Posts
106
#1
Hello. I'm using essentials v.17.2 and I want an NPC to be able to call the players Pokemon nickname.
I tried \v[3] in a show text and it didn't work, it shows just a 0. and I also tried \v[2] and it shows a 0 too, instead of the nickname of a pokemon.
please help me I don't know why it isn't working. I'm using Following Pokemon script from Mej, Marin's DP Pause Menu. Heart Symbol. Klein Studio Gras animation, Gender Selection Script and Marins Script Utilities.

Edit: thanks poq. I made a new script before the "show text" \v[3] and paste this code inside the script:

Code:
poke=$Trainer.party[0]
pbSet(3,poke.name)
then I play test and it works!
 
Last edited:

Aki

Starry eyed
Administrator
#2
When you use \v[3] in a text box, that basically means "replace with variable 3". It's displaying as 0 because variable 3 has nothing set to it yet. You'll need to do a little work beforehand to make sure the variable you're using is set to something, like the name you want.
 

Marina

Elite Trainer
Member
Posts
106
#3
could you tell me which little work I should do, sorry for being noob but I can't find anything in the essentials docs wiki.
 

Poq

Elite Trainer
Member
Posts
111
#4
Try including a script command like this in your event right before your Show Text command:
Ruby:
poke=$Trainer.party[0]
pbSet(3,poke.name)
 

Poq

Elite Trainer
Member
Posts
111
#6
Ok, thanks Poq. I'll try it out!
it works :D ! It works!!! :D:D:D solved
I'm glad it worked! Here's the breakdown of what it does for your own future reference:
$Trainer.party[0] gives you the first pokémon in the player's party (which is a Ruby array).
pbSet(variable,value) is a method which assigns the indicated global variable to the specified value.
In this case, I assigned variable 3 to be the name (which is the nickname or species name) of the first pokémon in the player's party.
Variables are fun!
 
Top