• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: [v13+] Character Selection

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
That was the problem thanks, now i have a question how can i use the script to choose a partner? For example i define three tainers in the script and i want to choose one of them to be my partner.
Just use a simple conditional branch with my method result value:

Code:
overworld = ["trchar000","trchar001","trchar002","trchar003"]
battle = ["trainer000","trainer001","trainer002","trainer003"]
result = pbCharacterSelection(overworld,battle) 
if result==0
  pbRegisterPartner(PBTrainers::HOOPYTRAINER,"Zaphod",0)
elsif result==1
  pbRegisterPartner(PBTrainers::OTHERTRAINER,"Purple",0)
elsif result==2
  pbRegisterPartner(PBTrainers::ANOTHERTRAINER,"Gray",0)
elsif result==3
  pbRegisterPartner(PBTrainers::ONEMORETRAINER,"Brown",0)
end

Since this code is too big for a Script Event Command, I suggest you to put it above main, between a line with "def insertSomeMethodNameHere" and "end", and call it on the Event.
 

Deatheye1

Pokémon End of the World
6
Posts
6
Years
  • Age 25
  • Here
  • Seen Nov 21, 2017
Just use a simple conditional branch with my method result value:

Code:
overworld = ["trchar000","trchar001","trchar002","trchar003"]
battle = ["trainer000","trainer001","trainer002","trainer003"]
result = pbCharacterSelection(overworld,battle) 
if result==0
  pbRegisterPartner(PBTrainers::HOOPYTRAINER,"Zaphod",0)
elsif result==1
  pbRegisterPartner(PBTrainers::OTHERTRAINER,"Purple",0)
elsif result==2
  pbRegisterPartner(PBTrainers::ANOTHERTRAINER,"Gray",0)
elsif result==3
  pbRegisterPartner(PBTrainers::ONEMORETRAINER,"Brown",0)
end

Since this code is too big for a Script Event Command, I suggest you to put it above main, between a line with "def insertSomeMethodNameHere" and "end", and call it on the Event.

Ok thanks, but i see that script only work one time, for example in a future event the partners must have more level with their team and when i put again the partner selection the partner had the team in the first trainer battle, how can i change that when the player has playing?
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
Ok thanks, but i see that script only work one time, for example in a future event the partners must have more level with their team and when i put again the partner selection the partner had the team in the first trainer battle, how can i change that when the player has playing?
This was nothing to do with my script...

Anyway change the last "0" argument in partner call for a variable number that you change per moment.
 
2
Posts
6
Years
  • Age 33
  • Seen Mar 4, 2018
Hi,
I think this is an amazing addition to essentials, and I'm keen to start using it in my game.

I'd like it to be a "costume change" tool for the player, so they can change outfits, possibly bound to an item
e.g one of my player characters is misty so I'd like to be able to switch to anime, hgss, and swimsuit styles

Is that possible? If so, can this script also replace surf/bike/fish graphics?

Also, is it possible to have it be useable on NPC trainers/gymleaders via a menu or item?
tl;dr trying to make a pokemon "best of" where you can change the trainers as you see fit
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
I'd like it to be a "costume change" tool for the player, so they can change outfits, possibly bound to an item
e.g one of my player characters is misty so I'd like to be able to switch to anime, hgss, and swimsuit styles

Is that possible? If so, can this script also replace surf/bike/fish graphics?

Also, is it possible to have it be useable on NPC trainers/gymleaders via a menu or item?
tl;dr trying to make a pokemon "best of" where you can change the trainers as you see fit

You can activate the script by item. An item example:
Item data on PBS:
Code:
621,YOURITEMINTERNALNAMEHERE,YourItemNameHere,YourItemNameHere,8,0,"Description goes here",2,0,6

Item code:
Code:
ItemHandlers.addUseFromBag(:YOURITEMINTERNALNAMEHERE, proc {|item|
  overworld = ["trchar000","trchar001","trchar002","trchar003"]
  battle = ["trainer000","trainer001","trainer002","trainer003"]
  result = pbCharacterSelection(overworld,battle)
  # Do things with result. 
  next 1 # Continue
})

You can handle the result using game switches and variables to change NPCs outfits. For surf/bike/fish graphics this is a bit harder, I suggest you to set the $Trainer.outfit by result.
 
6
Posts
5
Years
  • Age 19
  • Seen Apr 13, 2021
Sorry to bump such an old thread! I get this error when trying to use the script:
WsJIzpr.png
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
Sorry to bump such an old thread! I get this error when trying to use the script:
WsJIzpr.png
I tested with 17.2 right now and is working. Did you correctly follow the instructions and these four images ("trchar000","trchar001","trainer000" and "trainer001") were in the right folders?
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
Yep, still didn't work
Sorry, I never tested this script with only two characters. I updated this script for working with 2 characters.
 
Last edited:

Chaotik IE

RPG Maker User
6
Posts
4
Years
Hi! I have a question:

I wanna know how can I set custom mugshots or color text for each character I pick up. For example, if I pick up the 1st one, I would use a specific mugshot for his dialogues. If I pick up the 2nd one, another mugshot. Help!😅
 
Last edited:

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
Hi! I have a question:

I wanna know how can I set custom mugshots or color text for each character I pick up. For example, if I pick up the 1st one, I would use a specific mugshot for his dialogues. If I pick up the 2nd one, another mugshot. Help!😅
This script only returns a number, right? Store this number in a variable and checks this variable using event command conditional branch. For each branch, call a different mugshot.

If you use this ofter, you can create a script who does this, so you only need to call the same method.

For text, setting the player gender and using '/pg' or '/pog' may solve your issue.
 
153
Posts
4
Years
  • Age 36
  • Seen Feb 4, 2020
Hey thx for this content.
I've been trying to change the color of the text depending on a variable but \C[pbGet(60)] doesn't work. Is it possible to do that with what you suggested above? /pg or /pog?
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
Hey thx for this content.
I've been trying to change the color of the text depending on a variable but \C[pbGet(60)] doesn't work. Is it possible to do that with what you suggested above? /pg or /pog?
Yes, but /pg and /pog only uses red/blue colors based on player gender. To use more:

Code:
$game_variables[99] = [
"ff00ff",
"ff0000",
"00ffff",
"0000ff"][pbGet(60)]

And use the message:
Code:
<c=\v[99]>Hello World!</c>
 
Last edited:
153
Posts
4
Years
  • Age 36
  • Seen Feb 4, 2020
thx for your answer I solved it by adding this in message script

Code:
  text.gsub!(/\\[Hh]/,"\\C[1]") if pbGet(60)==1
  text.gsub!(/\\[Hh]/,"\\C[3]") if pbGet(60)==3
  text.gsub!(/\\[Hh]/,"\\C[5]") if pbGet(60)==5
  text.gsub!(/\\[Hh]/,"\\C[6]") if pbGet(60)==6

but your solution is maybe even cleaner. However this is easier to use as it only needs a \h to start changing the color
 
Last edited:
5
Posts
4
Years
  • Age 29
  • Seen Sep 27, 2019
I get the following error.

[Pokémon Essentials version 17.2]
Exception: RuntimeError
Message: Script error within event 1 (coords 0,0), map 1 (Intro):
Exception: SyntaxError
Message: (eval):9:in `pbExecuteScript'compile error
(eval):8: syntax error
***Line '(overworld,battle)' shouldn't begin with '('. Try
putting the '(' at the end of the previous line instead,
or using 'extendtext.exe'.
***Full script:
overworld =
["trchar000","trchar001","trchar002","trcha
r003"]
battle =
["trainer000","trainer001","trainer002","tr
ainer003"]
result = pbCharacterSelection
(overworld,battle)
pbChangePlayer(result)


Interpreter:276:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:163:in `update'
Scene_Map:161:in `loop'
Scene_Map:170:in `update'
Scene_Map:234:in `main'
 
153
Posts
4
Years
  • Age 36
  • Seen Feb 4, 2020
the interpreter says you should put the "(" on the previous line
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen yesterday
Updated for Essentials v20.1.

I also made improvements on character alignment and speed.
 
7
Posts
1
Years
  • Age 23
  • Seen Oct 23, 2022
I have an error with this script :(

---------------------------
Pokémon Essentials Esp v16.3
---------------------------
Excepción: RuntimeError

Mensaje: Script error within event 2, map 1 (Intro):

Exception: NoMethodError

Message: (eval):3:in `pbExecuteScript'undefined method `pbCharacterSelection' for #<Interpreter:0x1328ad20>

***Full script:

overworld = ["trchar000", "trchar001", "trchar002", "trchar003"]
battle = ["trainer000", "trainer001", "trainer002", "trainer003"]
result = pbCharacterSelection(overworld,battle)
pbChangePlayer(result)


Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'
 
Back
Top