• 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.

Custom trainer battles

1
Posts
8
Years
  • Age 31
  • Seen Feb 17, 2016
Hi, after upgrading to essentials v16 I'm receiving this error every time i use the script:
*new user (cannot display links)*
In the essentials wiki it sais that it's due to a spelling mistake but the script worked perfectly with v15.

Hey buddy, same trouble as you. Since I have no idea what the whole code does, not even the essential because there is no information where I can find each part of the essential code to learn what the whole scripts do.

I suggest you go to "Custom Trainers" which is the one you created, according to your image and as your debugger says in the image you attached, line 180. There you have 7 arguments, the sky and inverse (I am an old pokemon player, from first generations so I have no idea what these battle modes are) and since for Essentials v16 it only accepts 5 arguments, erase the last two I told you.

Cheers!
 
45
Posts
9
Years
Does the script's page need to be put in any particular location, or just make a new page and go?

Nevermind, this was a dumb question.
 
Last edited by a moderator:
46
Posts
7
Years
I'm having trouble with applying the canlose feature into the custom script. The code I have is below and if possible can someone please tell me if I've done something wrong.

Spoiler:
 
58
Posts
6
Years
  • Age 25
  • Seen Jan 30, 2021
Thanks man.
Everything worked for me but can you tell me how to give an item to a Pokemon?
Thanks for the help mate.
 
Last edited:
15
Posts
5
Years
  • Age 28
  • Seen Apr 13, 2019
I?m having a problem with it!
It shows this, "Error in the script Custom Script, in 60 in line 'SyntaxError' "
What can I do?
 

Braze

TQ Supremacy
138
Posts
6
Years
I´m having a problem with it!
It shows this, "Error in the script Custom Script, in 60 in line 'SyntaxError' "
What can I do?

Are you still there? Can you please look at those scripts where you pasted this?

When you have opened the section in which they are, Press CTRL + G and type 60 then Press Enter, Now, Just Type # in the first of that line. Save it, It should work now. (Cuz it also happened with me. :D )
 

Juno and Ice

Developer of Pokémon Floral Tempus
150
Posts
5
Years
  • Age 25
  • Seen Apr 19, 2024
Is there anyway to change Pokémon forms with this script?
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
There is this neat feature in base essentials that allows you to clone the players party to a switch/variable. Could we use that to make a trainer battle?
 
55
Posts
6
Years
  • Age 37
  • Seen Nov 24, 2023
Sorry for the bump maybe, but will this script be made compatible with V18? I tried porting it, but I get errors. This is a way better way to configure battles then with PBS.
 
12
Posts
4
Years
  • Age 29
  • Seen Jun 26, 2022
Sure, it's not hard. Insert this method in the script.

Code:
# ------------------------------------------------------------------------------
# Returns a random element from a given array.
# ------------------------------------------------------------------------------
def randomElement(array)
  i = rand(array.length)
  return array[i]
end

Then, in the event, instead of writing createPokemon("PIKACHU", 13) you can write
createPokemon(randomElement(SomePool), 13), and you'll need to define 'SomePool',
either in the event script or in a global script (such as CustomTrainers) as,
Code:
SomePool = ["PIKACHU", "BULBASAUR", "SOME_OTHER_POKEMON"]

If instead of returning only a single Pokemon from a predefined pool, what if I want them to use a party of variable length which I can set pre-execution?
 
Back
Top