PDA

View Full Version : [Essentials tutorial] Hansiec's Scripts, commands, and explatantion on how it works!


Umbreon
October 19th, 2010, 06:09 AM
Well anyways, I'm here to teach all that is interested in poccils starter kit how to script with it. Don't read this if you have the following: No interest in his starterkit or already know basic scripting.

Common Script commands and what they do
Scripts usally used in a conditional branch
pbAddPokemon(pokemon,level) (gives you a pokemon replace pokemon and level to the appropriate pokemon and level)
pbReceiveItem(PBItems::item) (first off if this one is wrong correct me.)(Adds an item)
pbItemBall(PBItems::item) (adds an item pokeball style.)
$Trainer.party.length==6 (sees if the trainer party is full if it is it returns true (the upper part of the conditional branch)usally used when wanting to add an egg or a foreign pokemon.)
pbAddForeignPokemon(pokemon,level,owner,nickname(optional)) (adds a pokemon owned by someone else to your party only.)
pbGenerateEgg(pokemon,level) (first off the appears when the pokemon hatched it generates an egg in your party only.)
$trainer.badges[x] (replace x with 0,1,2,3,4,5,6, or 7 (0 starts with badge 1 and 7 is badge 8))
Scripts used in script editor
Mystery Gift

def pbMysteryGift # defines call method
=begin
|
defines the passwords and stores the results in pokemon and level. v
=end
pokemon=Kernel.pbFreeText(_INTL("Enter the first part of the password"),0,100,false)level=Kernel.pbFreeText(_INTL("Enter the second part of the password"),0,100,false)pokemon*2
pokemon-4
pokemon/2
level*2
level-4
level/2
=begin
|
starts an if branch and checks to see if this is a correct code v
=end
if level>100 || pokemon>493 || level<=0 || pokemon<=0
Kernel.pbMessage(_INTL("Sorry, this code is incorrect.")) # text
return false #returns to the game and the script status is false
end # ends the if branch
pbAddPokemon(pokemon,level) #adds the pokemon with the defined texts pokemon and level
end #ends the script.


For now this is all, I will be adding more scripts,

by the time you read this whole thing, you should have atleast a little scripting knowledge, until next updat goodbye.

Stiwo's rule
October 20th, 2010, 10:32 AM
woohoo! those commands are so usefull! I didn't know hot to call events, but you explained well =D