• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Pokémon Selection (similar to Stadium/Battle Tower)

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
gif.gif
screen.png

Pokémon selection system similar to Stadium/Battle Tower, where you can choose a certain number and order of pokémon.

Link

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

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
I'm glad that people will use this, despite the big instructions.
 
14
Posts
11
Years
  • Seen Oct 9, 2014
I tried to use this but when i try this script it directly goes in battle without selection.
Can you write a example script? with battle.
 

IceGod64

In the Lost & Found bin!
624
Posts
15
Years
I tried to use this but when i try this script it directly goes in battle without selection.
Can you write a example script? with battle.

Follow the instructions. Notice n the first post:

# To this script works, put it above main and use in script command # 'PokemonSelection.choose(min, max, canCancel, acceptFainted)'
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
I tried to use this but when i try this script it directly goes in battle without selection.
Can you write a example script? with battle.
Code:
PokemonSelection.choose(3,3)
pbTrainerBattle(
  PBTrainers::YOUNGSTER,"Ben",
  _I("\bAww, I lost."))
PokemonSelection.restore
 

Nickalooose

--------------------
1,309
Posts
15
Years
  • Seen Dec 28, 2023
Wow, FL . nice script... However, It's always nice to see one of my features become less of a unique feature though lol.

It's great to see you're still giving to the community too.
 
8
Posts
10
Years
  • Seen Apr 21, 2015
Little help with this...
Tried to follow instructions here but I'm getting a
'PokemonSelection' Line60:SyntaxError

I'm trying to set it up so that you can enter a 'Fighting Type' only contest, and I have put in all the species allowed to compete and placed it above Main in the scripts sections,
ADVICE PLEASE???
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
Little help with this...
Tried to follow instructions here but I'm getting a
'PokemonSelection' Line60:SyntaxError

I'm trying to set it up so that you can enter a 'Fighting Type' only contest, and I have put in all the species allowed to compete and placed it above Main in the scripts sections,
ADVICE PLEASE???
Pokécommunity is breaking my scripts. How to solve this:
Click Thread Tools, and then Show Printable Version, and copy that instead.
Or use the thread print url: http://www.pokecommunity.com/printthread.php?t=290931




How to limit selection by pokémon type

Code:
# This class uses a type array that only allows the pokémon as valid if it
# has one of these types when bannedTypes=false or the reverse 
# when bannedTypes=true
class TypeRestriction
  def initialize(types, bannedTypes=true)
    @types=types
    @bannedTypes = bannedTypes
  end

  def isValid?(pokemon)
    ret=false
    for singleType in @types
      if pokemon.hasType?(singleType)
        ret = true
        break
      end
    end
    ret = !ret if @bannedTypes
    return ret
  end
end

Copy this code after my script last line. After line 'ret.ruleset.setNumberRange(min,max)' add 'ret.addPokemonRule(TypeRestriction.new([:FIGHTING],false))'.

If you, instead of adding 'TypeRestriction.new([:FIGHTING],false))', you add 'TypeRestriction.new([:FIRE,:ICE],false))', only Fire and Ice pokémon would be allowed. If the call is 'TypeRestriction.new([:DRAGON,:FLYING],true))', Flying and Dragon pokémon will be banned.
 
8
Posts
10
Years
  • Seen Apr 21, 2015
Ah that's got rid of the error nicely! Thanks.
What script exactly would I need to use to open the battle now?

Tried the one suggested near the start of the thread but that's giving me a large error now in game
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
Ah that's got rid of the error nicely! Thanks.
What script exactly would I need to use to open the battle now?

Tried the one suggested near the start of the thread but that's giving me a large error now in game
Code:
PokemonSelection.choose(3,3)
pbTrainerBattle(
  PBTrainers::YOUNGSTER,"Ben",
  _I("\bAww, I lost."))
PokemonSelection.restore
Use extendtext.exe or, probably, the small script command window will mess the text.
 
16
Posts
11
Years
  • Seen Apr 25, 2020
Great script! I have a couple questions / issues. I am using essentials 17.2 and I have installed all scripts as instructed and everything seems to be working except one thing. Even with it set to not be able cancel the selection I am still able to do so in game. Any idea what the issue might be?

Any help would be greatly appreciated!
 
Last edited:

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
Great script! I have a couple questions / issues. I am using essentials 17.2 and I have installed all scripts as instructed and everything seems to be working except one thing. Even with it set to not be able cancel the selection I am still able to do so in game. Any idea what the issue might be?
When "canCancel" is false, the player is prompt to select the pokémon again when pressing cancel. This is happening? If so, the system was worked as should be.
 
Last edited:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
Oh God. Crash to EBS:

Spoiler:
 
15
Posts
7
Years
If i press cancel. I still have to choose pokemon?? I want that cancel button to cancel the battle.
Can anyone that has had the same problem tell me how to fix it?
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
If i press cancel. I still have to choose pokemon?? I want that cancel button to cancel the battle.
Can anyone that has had the same problem tell me how to fix it?
Pass 'canCancel' parameter as true. The method return 'false' if cancelled, use this on a conditional to skip the battle.
 
1
Posts
4
Years
  • Age 26
  • Seen May 24, 2019
Sorry, i need help... I want to make a rule in my own pokemon game, the rule is if battling mewtwo, player must be using deoxys and just deoxys. Can i using this script for it? or any script?
 
Last edited:
Back
Top