• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
[v13+] Character Selection

Resource [v13+] Character Selection 1.2

taku

Novice
Member
Joined
Feb 5, 2024
Posts
11
Hello I start on pokémon essentials and I would like to know where to put the code I have and or please
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
Hello I start on pokémon essentials and I would like to know where to put the code I have and or please
Press F11 in RPG Maker XP to open script editor. Then, create a new script section above main (preferably, right above), then paste the script in the new empty section. You can also copy and past the script right in the Main section start, but I don't recommend this.
 

Barral

Rookie
Member
Joined
Jul 2, 2024
Posts
8
i tried to figure out how to use your puglin but i dont understand nothing, i tried to use as plugin but the console dont identify the puglin, then i tried put it above main but the call function all says erro, its confusing for me
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
i tried to figure out how to use your puglin but i dont understand nothing, i tried to use as plugin but the console dont identify the puglin, then i tried put it above main but the call function all says erro, its confusing for me
What was your error when putting above main?

See here how to convert it into a detectable plugin, if you prefer this way.

For calling it, just copy the example and put into the script call (without the '#') and try choosing Red of Leaf.
 

Barral

Rookie
Member
Joined
Jul 2, 2024
Posts
8
overworld = ["trainer_POKEMONTRAINER_Red","trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan","trainer_POKEMONTRAINER_May"]
battle = ["POKEMONTRAINER_Red","POKEMONTRAINER_Leaf",
"POKEMONTRAINER_Brendan","POKEMONTRAINER_May"]
result = startCharacterSelection(overworld,battle)
pbChangePlayer(result+1)

this is the example, its to many characters, the function to call the script dont allow me to put that many,

is to put these overworld and battle and replace in this function startCharacterSelection(overworld,battle) like:

startCharacterSelection(
["trainer_POKEMONTRAINER_Red","trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan","trainer_POKEMONTRAINER_May"]
,
["POKEMONTRAINER_Red","POKEMONTRAINER_Leaf",
"POKEMONTRAINER_Brendan","POKEMONTRAINER_May"]
)

i dont get it, sorry.
then i dont need to change anything in the script? add more ow and battle choices and where i can put?

the result and pbChangePlayer(result+1) are to call both on the same script? im asking all this because i trid a lot of thing and none of them worked
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
Code:
Expand Collapse Copy
overworld = ["trainer_POKEMONTRAINER_Red","trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan","trainer_POKEMONTRAINER_May"]
battle = ["POKEMONTRAINER_Red","POKEMONTRAINER_Leaf",
 "POKEMONTRAINER_Brendan","POKEMONTRAINER_May"]
result = startCharacterSelection(overworld,battle) 
pbChangePlayer(result+1)

this is the example, its to many characters, the function to call the script dont allow me to put that many,
You can run extendtext.exe ()look at your project folder) to raise this limit, create a def above main (a bit more complex) or use your other example with some changes

Code:
Expand Collapse Copy
startCharacterSelection(
["trainer_POKEMONTRAINER_Red","trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan","trainer_POKEMONTRAINER_May"]
,
 ["POKEMONTRAINER_Red","POKEMONTRAINER_Leaf",
 "POKEMONTRAINER_Brendan","POKEMONTRAINER_May"]
)
The 'startCharacterSelection' just return you the index choosed (i.e. 0 for Red, 1 for Leaf). If you want to use it to change your character, you need to store the result and call pbChangePlayer. This way:

Code:
Expand Collapse Copy
r = startCharacterSelection(
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf"]
,
 ["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf"]
)
pbChangePlayer(r+1)
(I also removed Brendan and May to make things simpler and shorter).

After this worked, you can change the sprites. Let me know if this doesn't work!
 

Barral

Rookie
Member
Joined
Jul 2, 2024
Posts
8
r = startCharacterSelection(
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf"]
,
["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf"]
)
pbChangePlayer(r+1)

this worked but it change to a complete black screen with nothing
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
r = startCharacterSelection(
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf"]
,
["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf"]
)
pbChangePlayer(r+1)

this worked but it change to a complete black screen with nothing
Where did you called the event script? I used a random NPC in Lappet to test it. What was your essentials version?
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
There is a mistake in my example. Change
Code:
Expand Collapse Copy
r = startCharacterSelection(
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf"]
,
 ["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf"]
)
pbChangePlayer(r+1)
to
Code:
Expand Collapse Copy
r = startCharacterSelection(
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf"],
 ["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf"]
)
pbChangePlayer(r+1)
I tested here in v21.1 and it was working, only arrows didn't appears but I gonna fix this soon. If the black screen continues, try using it in a vanilla v21.1.
 

The_Bird_King

Rookie
Member
Joined
Sep 3, 2024
Posts
9
I have a question: I put this above main:

First i have the code for character selection, that part works.

Below it I have this:

def somename
overworld = ["trainer_POKEMONTRAINER_Red","trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan","trainer_POKEMONTRAINER_May"]
battle = ["POKEMONTRAINER_Red","POKEMONTRAINER_Leaf",
"POKEMONTRAINER_Brendan","POKEMONTRAINER_May"]
result = startCharacterSelection(overworld,battle)
pbChangePlayer(result+1)
end

Then in the event I have this:

Script: somename
Script: pbChangePlayer(result+1)

I then get a crash after picking the trainer, removing the change player line results in the game continuing to run but with the default character regardless of choice. Any ideas? Also for the surfing and fishing animation, can i just add those to this list?
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
I have a question: I put this above main:

First i have the code for character selection, that part works.

Below it I have this:

def somename
overworld = ["trainer_POKEMONTRAINER_Red","trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan","trainer_POKEMONTRAINER_May"]
battle = ["POKEMONTRAINER_Red","POKEMONTRAINER_Leaf",
"POKEMONTRAINER_Brendan","POKEMONTRAINER_May"]
result = startCharacterSelection(overworld,battle)
pbChangePlayer(result+1)
end

Then in the event I have this:

Script: somename
Script: pbChangePlayer(result+1)

I then get a crash after picking the trainer, removing the change player line results in the game continuing to run but with the default character regardless of choice. Any ideas? Also for the surfing and fishing animation, can i just add those to this list?
The line 'pbChangePlayer(result+1)' after 'somename' will crash the game, since game doesn't know what is 'result', so remove this line at this place. After this change, did you can at least change between first and second player? This should be working.
 

The_Bird_King

Rookie
Member
Joined
Sep 3, 2024
Posts
9
The line 'pbChangePlayer(result+1)' after 'somename' will crash the game, since game doesn't know what is 'result', so remove this line at this place. After this change, did you can at least change between first and second player? This should be working.
I did that and after picking any of the characters, it just gives me the default male character.
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
306
I did that and after picking any of the characters, it just gives me the default male character.
I tested right now at a clear v21.1 in a NPC at Lappet Town and when I select (and confirm) Leaf (the female character), I changed into Leaf. This should be working, looks like something that you changed. I suggest testing in a vanilla v21.1.
 

The_Bird_King

Rookie
Member
Joined
Sep 3, 2024
Posts
9
I was able to figure out what I was missing (not updating the metadata). Everything is good now, I just wish Essentials included the full sprite sheets for Brenden and May :/
 
Back
Top