Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials

Notices
For all updates, view the main page.

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.



Reply
 
Thread Tools
  #1    
Old January 10th, 2012 (07:47 PM). Edited January 12th, 2012 by Ho-oh 112.
Ho-oh 112's Avatar
Ho-oh 112
Advance Scripter
 
Join Date: Feb 2011
Age: 19
Gender: Male
Nature: Hasty
Right, so you want to learn some Poke-Essentials scripting? Well, you came to the right place (sorta if you want to learn basics Medium + Advance comming soon....)

Contents


1 Contents
2 Basic Commands
3 Basic Scripts
4 Medium Commands


BEFORE YOU THINK THIS IS COMPLETE IT'S NOT!

Basic Commands
The basics are just adding elements to your game... (the pb stuff)

Kernel.pbMessage(_INTL("Message here")) - Displays a message Via Script.
pbAddPokemon(PBSpecies::PokemonNameHere, Level) - Adds a pokemon and it's level
pbReceiveItem(PBItems::ItemNameHere) - Receive Item
pbItemBall(PBItems::ItemNameHere) - Receive Item (from a pokeball thing)
pbGenerateEgg(PBSpecies::PokemonNameHere) - generates a pokemon egg (PARTY MUST HAVE LESS THAN 6 POKEMON TO RECEIVE)
pbAddForeignPokemon(species,level,ownerName,nickname), Adds a Pokemon owned by someone else

Basic Scripts:

Basic scripts are consisted of stuff you find above + a few more commands, here is a basic script with comments on how it works

def pbGenerateDebugParty # call method, (use pbGenerateDebugParty to activate)
Kernel.pbMessage(_INTL("Giving you your debug party + a random masterball...."))
pbReceiveItem(PBItems::MasterBall) # Adds a master ball
pbAddPokemon(PBSpecies::Mew, PBExperience::MAXLEVEL) # adds a mew at max level
pbAddPokemon(PBSpecies::Mewtwo, PBExperience::MAXLEVEL) # adds a mewtwo at max level
pbAddPokemon(PBSpecies::Deoxys, PBExperience::MAXLEVEL) # adds a Deoxys at max level
pbAddPokemon(PBSpecies::Jirachi, PBExperience::MAXLEVEL) # adds a Jirachi at max level
pbAddPokemon(PBSpecies::Arceus, PBExperience::MAXLEVEL) # adds an Arceus at max level
pbAddPokemon(PBSpecies::Magikarp, 1) # adds a Magikarp at level 1
# NOTE: THESE MAY NEED TO BE CAPITALIZED DEPENDING ON INTERNAL NAME OF POKEMON!!
end # Ends script so it doesn't crash game.

Calling this will give you those 6 pokemon at those levels.


Medium Commands:

Pokemon Creations:
p=PokeBattle_Pokemon.new(specieshere,levelhere,$TrainerIfOwnedByTrainer)
p.makeShiny - makes pokemon shiny
p.makeShadow - makes pokemon shadow
p.moves[0-3] - moves array (0 being first, 1 being second, ect)
p.form - current form
p.gender - current gender
p.isShiny? - returns true if the pokemon is shiny else false
p.isShadow? - returns true if the pokemon is shadow else false
p.abilityflag = 0-2 - (2 being hidden ability)
p.setNature(natureIDhere)
I can go on about the different stats, but you get the idea....

pbAddToParty(p) when you are done to add to party

downloading strings - string=pbDownloadToString(URLHERE)
downloads a string from the url to string

$Trainer - trainer fixnum
$Trainer.party - party pokemon array
$Trainer.party[0-5] - 0 being first, 1 being second, ect
$Trainer.party.length - gets the players party length
$Trainer.name = "Bob" - sets the player's name to Bob


Converting variables to files

File.open('text.txt', 'wb'){|f| - we use wb to write and rb to read....
f.write("Hello, this is a sample text file!!!") - writes what it says inside the ""
} - closes the file

Converting files to strings

File.open('text.txt', 'rb'){|f|
string=f.read - reads the WHOLE text.txt
}

p string - prints out what it says in text.txt

converting strings to variables and then back to a string....
string = "4"
string = string.to_i - .to_i is to interger
string += 50
string.to_s - .to_s is to string

array=[string, string.to_i -= 10] - writes an array
array.pack("M") - does a compile over the strings...

then we can add it to a file
File.open('text.txt', 'wb'){|f|
f.write(array)
}

just so we can load it
File.open('text.txt', 'wb'){|f|
array=f.read
}
array.unpack("M") - uncompiles array

p array - prints out the array....

Medium Scripts comming soon....
__________________
Scripting Level: Advance

RMXP Poke-Essentials MySQL Trading System Link:
http://www.pokecommunity.com/showthread.php?p=7077162#post7077162

RMXP Poke-Essentials Mystery Gift Link:
http://www.pokecommunity.com/showthread.php?t=270687

RMXP Poke-Essentials Award System Link:
http://www.pokecommunity.com/showthread.php?p=7111566
Reply With Quote
  #2    
Old January 20th, 2012 (12:47 PM).
Pia Carrot's Avatar
Pia Carrot
Gen II Hacker | PHO Enthusiast
 
Join Date: Aug 2010
Age: 19
Gender: Male
Nature: Adamant
Alright, this is really cool. I'm having trouble making a script to obtain a shiny shroomish from a NPC. I've tried using a switch but it doesn't work. So how would I make a script that is triggered by a switch to give the player a shiny shroomish, yet has a preset nickname?

Thanks,
Pia Carrot
__________________



Reply With Quote
  #3    
Old January 30th, 2012 (08:09 PM).
Ho-oh 112's Avatar
Ho-oh 112
Advance Scripter
 
Join Date: Feb 2011
Age: 19
Gender: Male
Nature: Hasty
Quote originally posted by Evil Arms:
Alright, this is really cool. I'm having trouble making a script to obtain a shiny shroomish from a NPC. I've tried using a switch but it doesn't work. So how would I make a script that is triggered by a switch to give the player a shiny shroomish, yet has a preset nickname?

Thanks,
Pia Carrot

Common event: Auto run by Switch [switch here]

Script: p = PokeBattle_Pokemon.new(PBSpecies:HROOMISH, level here)
p.name = "Nickname inside the parentheses"
p.makeShiny
pbAddToParty(p)


switch here == off
__________________
Scripting Level: Advance

RMXP Poke-Essentials MySQL Trading System Link:
http://www.pokecommunity.com/showthread.php?p=7077162#post7077162

RMXP Poke-Essentials Mystery Gift Link:
http://www.pokecommunity.com/showthread.php?t=270687

RMXP Poke-Essentials Award System Link:
http://www.pokecommunity.com/showthread.php?p=7111566
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 02:54 AM.