• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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

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!
 
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:
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:
 
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?
 
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 )
 
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.
 
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.

No it isn't. Why would you think that.
 
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