The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.


Reply
 
Thread Tools
  #1    
Old December 14th, 2012, 11:34 AM
reddevilz
Unhatched Egg
 
Join Date: Apr 2009
I am trying to add a pokemon to the player from anouther trainer.

pbAddForeignPokemon(PBSpecies:ANDSHREW,5,_I("Jake"),_I("Sorex"),0)

if i understand from the tutorial that would work but it brings up an error everytime. I would also like to make added pokemon shiny if possible too.
Reply With Quote
  #2    
Old December 14th, 2012, 05:49 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
An important thing to watch out for is how the code looks when you type it into an event. The code itself is fine, but it probably looks like this:

Code:
pbAddForeignPokemon
(PBSpecies::SANDSHREW,5,_I
("Jake"),_I("Sorex"),0)
RMXP is stupid, and thinks these are three separate and unrelated lines of code, rather than one long one. What you need to do is to tell RMXP that, when it gets to the end of the first line, that there's more of that line still to come. You do this by putting the open bracket "(" at the end of the first line rather than the beginning of the second line. You also need to do something similar with the second line, but make sure it ends on a comma (an open bracket would work as well; you'll develop your own style eventually).

What you should end up with is something that looks like this:

Code:
pbAddForeignPokemon(
PBSpecies::SANDSHREW,5,
_I("Jake"),_I("Sorex"),0)
The open bracket and the comma are useful things, because they indicate that the line hasn't finished yet, and the continuation is on the next line. There are one or two other such characters (probably), but you don't need to worry about them as the open bracket and comma will work for you just fine - they do for me.

The alternative is to use ExtendText (the .exe in the game's folder) to make the script box much wider, allowing you to fit everything on the same line. It's certainly useful, although it's probably best if you do some clever lining as I described above, if you can afford the space.



Having said all that, though, this particular script is best used as the argument of a Conditional Branch. It will return true if the Pokémon was added, and false if not. This allows you to "deactivate" the Pokémon-giving event once it's done its job (perhaps by playing with its Self Switches).

To make the Pokémon shiny, read the wiki. There's also an example of exactly what you want in the example maps (far right NPC in the Pokémon Fan Club).
__________________
Reply With Quote
  #3    
Old December 16th, 2012, 07:44 AM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by Maruno View Post
RMXP is stupid
This is a Ruby syntax problem, isn't? This language has an auto line break without use semicolon, although its support this symbol.

The big problem is that RMXP has a small box for enter script, so the alternative is ExtendText like Maruno said.
__________________
Reply With Quote
  #4    
Old December 17th, 2012, 06:03 AM
reddevilz
Unhatched Egg
 
Join Date: Apr 2009
Thank you for explaining that to me and the script works perfectly now.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 06:44 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.