• The Eevee Expo Game Jam #10 has concluded, congratulations to all participants! Now it's time for the judges to play through the games, and you can play along to vote who deserves the community choice spotlight.
    You can check out the submitted games here!
    Play through the games and provide some feedback to the devs while you're at it!
  • Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
[v13+] Character Selection

Resource [v13+] Character Selection 1.2

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
305
-FL- submitted a new resource:

Character Selection - Character selection screen suggested for player selection or partner selection.

gif.gif
screen.png

It's a character selection screen suggested for player selection or partner selection.

Tested on Essentials v13, v18.1 and v20.1. If this script isn't working on latest Essentials version, please inform on this thread.

Read more about this resource...
 

Westrah

Novice
Member
Joined
Nov 2, 2021
Posts
29
Thought this looked pretty neat and decided to give this resource a try. I am having issue/errors with it however and was hoping someone could tell me what I'm doing wrong:

The only thing I have changed is the color of the background image from blue to gray.
As seen in my error screen attached, I am using just the example script call. However not only are most the characters not displaying properly, when I move my cursor over to them it causes this error and crashes the application.
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    38.4 KB · Views: 178
  • Capture2.JPG
    Capture2.JPG
    104.4 KB · Views: 171
Thought this looked pretty neat and decided to give this resource a try. I am having issue/errors with it however and was hoping someone could tell me what I'm doing wrong:

The only thing I have changed is the color of the background image from blue to gray.
As seen in my error screen attached, I am using just the example script call. However not only are most the characters not displaying properly, when I move my cursor over to them it causes this error and crashes the application.
Do you have all the graphics that are being used in the call? (“trainer_POKEMONTRAINER_Leaf”, for example) This looks like an issue of a missing graphic
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
305
Instead of pasting
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)
You pasted:
Code:
Expand Collapse Copy
overworld = 
["trainer_POKEMONTRAINER_Red","traine
r_POKEMONTRAINER_Leaf","trainer_POKEM
ONTRAINER_Brendan","trainer_POKEMONTR
AINER_May"]
battle = 
["POKEMONTRAINER_Red","POKEMONTRAINER
_Leaf","POKEMONTRAINER_Brendan","POKE
MONTRAINER_May"]
result = startCharacterSelection(
overworld,battle) 
pbChangePlayer(result+1)


You can't break strings like
Code:
Expand Collapse Copy
"trainer_POKEMONTRAINER_Leaf"
Into
Code:
Expand Collapse Copy
"traine
r_POKEMONTRAINER_Leaf"


There are 3 ways to solve this. Choose one:

1. Run extendtext.exe on Essentials folder and open the event script command. The window will be bigger
2. Above main, create on a script section (this one on a new one):
Code:
Expand Collapse Copy
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
And only call 'somename' in the script event command
3. Create two script event commands, the second after the first. And put this two scripts:
Code:
Expand Collapse Copy
overworld = 
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan",
"trainer_POKEMONTRAINER_May"]
Code:
Expand Collapse Copy
battle = 
["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf",
"POKEMONTRAINER_Brendan",
"POKEMONTRAINER_May"]
result = startCharacterSelection(
 overworld,battle) 
pbChangePlayer(result+1)
 
Last edited:

Westrah

Novice
Member
Joined
Nov 2, 2021
Posts
29
Instead of pasting
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)
You pasted:
Code:
Expand Collapse Copy
overworld =
["trainer_POKEMONTRAINER_Red","traine
r_POKEMONTRAINER_Leaf","trainer_POKEM
ONTRAINER_Brendan","trainer_POKEMONTR
AINER_May"]
battle =
["POKEMONTRAINER_Red","POKEMONTRAINER
_Leaf","POKEMONTRAINER_Brendan","POKE
MONTRAINER_May"]
result = startCharacterSelection(
overworld,battle)
pbChangePlayer(result+1)


You can't break strings like
Code:
Expand Collapse Copy
"trainer_POKEMONTRAINER_Leaf"
Into
Code:
Expand Collapse Copy
"traine
r_POKEMONTRAINER_Leaf"


There are 3 ways to solve this. Choose one:

1. Run extendtext.exe on Essentials folder and open the event script command. The window will be bigger
2. Above main, create on a script section (this one on a new one):
Code:
Expand Collapse Copy
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
And only call 'somename' in the script event command
3. Create two script event commands, the second after the first. And put this two scripts:
Code:
Expand Collapse Copy
overworld =
["trainer_POKEMONTRAINER_Red",
"trainer_POKEMONTRAINER_Leaf",
"trainer_POKEMONTRAINER_Brendan",
"trainer_POKEMONTRAINER_May"]
Code:
Expand Collapse Copy
battle =
["POKEMONTRAINER_Red",
"POKEMONTRAINER_Leaf",
"POKEMONTRAINER_Brendan",
"POKEMONTRAINER_May"]
result = startCharacterSelection(
 overworld,battle)
pbChangePlayer(result+1)
thank you for the quick reply. Extendtext seems to have fixed my issue 👍
 

Westrah

Novice
Member
Joined
Nov 2, 2021
Posts
29
One final thing (sorry) and this is likely user error again. But how do I get the game to recognize the choice I've made? Everything displays properly according to the script but after "selecting a character" the player is still defaulted to the standard pokemon trainer Red. Do I need to assign values somewhere? How do I get the game to make the player play as whatever choice they make in this script?

I've attached picture examples of what I mean if that helps.
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    43 KB · Views: 158
  • Capture2.JPG
    Capture2.JPG
    48.7 KB · Views: 139
  • Capture3.JPG
    Capture3.JPG
    38.4 KB · Views: 134

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
305
One final thing (sorry) and this is likely user error again. But how do I get the game to recognize the choice I've made? Everything displays properly according to the script but after "selecting a character" the player is still defaulted to the standard pokemon trainer Red. Do I need to assign values somewhere? How do I get the game to make the player play as whatever choice they make in this script?

I've attached picture examples of what I mean if that helps.
The script returns the selected index number ('result') and you can do things with this result.

The last line on example is 'pbChangePlayer(result+1)', so you change the player based on the result. If you wish more than 2 playable trainers, you need to edit the player metadata to add more trainers in the game.
 

Westrah

Novice
Member
Joined
Nov 2, 2021
Posts
29
The script returns the selected index number ('result') and you can do things with this result.

The last line on example is 'pbChangePlayer(result+1)', so you change the player based on the result. If you wish more than 2 playable trainers, you need to edit the player metadata to add more trainers in the game.
Did this and got everything working great! Thanks so much for the explanations!
 

Westrah

Novice
Member
Joined
Nov 2, 2021
Posts
29
I'd like to make a conditional branch event happen based on what selection the player made with this script. For example:

Rough Example:
Expand Collapse Copy
ConditionalBranch: "Player Selection" = 1
#thing-A happens
else

ConditionalBranch: "Player Selection" = 2
#thing-B happens
else

#etc, etc

Do you know how I could do this? Would it be done by using the 'pbChangePlayer(result+1)' script line somehow?
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
305
I'd like to make a conditional branch event happen based on what selection the player made with this script. For example:

Rough Example:
Expand Collapse Copy
ConditionalBranch: "Player Selection" = 1
#thing-A happens
else

ConditionalBranch: "Player Selection" = 2
#thing-B happens
else

#etc, etc

Do you know how I could do this? Would it be done by using the 'pbChangePlayer(result+1)' script line somehow?
just store the result on a variable right after this code, like '$game_variables[42]=result' or '$game_variables[42]=result+1', and check the variable. You can also check '$Trainer.id' since you use it to change the player.
 

Westrah

Novice
Member
Joined
Nov 2, 2021
Posts
29
just store the result on a variable right after this code, like '$game_variables[42]=result' or '$game_variables[42]=result+1', and check the variable. You can also check '$Trainer.id' since you use it to change the player.
went the game variables route and got what I wanted to do to work perfectly. Thanks once again for the quick reply and excellent help!
 

Jou

Rookie
Member
Joined
Nov 26, 2022
Posts
5
just store the result on a variable right after this code, like '$game_variables[42]=result' or '$game_variables[42]=result+1', and check the variable. You can also check '$Trainer.id' since you use it to change the player.
Sorry, but could you explain to me where and how exactly should I do that...? (store the result of this script in a variable, I mean). Just came back to Pokemon Essentials after a few years and can't seem to remember that one... Thanks
Awesome resource, btw.
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
305
Sorry, but could you explain to me where and how exactly should I do that...? (store the result of this script in a variable, I mean). Just came back to Pokemon Essentials after a few years and can't seem to remember that one... Thanks
Awesome resource, btw.
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)
$game_variables[42]= result
After running this code, game variable 42 has the result/return, so you can use the game variable 42 at the Conditional Branch like Westrah example. Remember:
The return is the player selected index, starting at 0.
 

epicman69

Rookie
Member
Joined
Dec 20, 2022
Posts
2
Hey, for some reason this resource works fine except when you pick may or brendan. Anyone know had to fix this?
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
305
Hey, for some reason this resource works fine except when you pick may or brendan. Anyone know had to fix this?
this script is only an selection screen, that can be used for several things, like a player screen.

So, to the player select example fully works you need to add the trainer on https://essentialsdocs.fandom.com/wiki/Metadata metadata and the trainer graphics (like running and fishing) into the project.

But your question makes sense, I probably add something into script instructions in the future.
 
Back
Top