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

Mystery Gift System (Basic)

PokemonPlatnum

nomnomnom.
257
Posts
16
Years
Mystery Gift System 2.0 for Pokémon Essentials

mysterygift20.png

------------------------------------------------------------------------------------------------------------------------------------
Instructions:


  1. To use this script simply place it above main :)
  2. To call the script use Class_MysteryGift.new

If you can find some cool way you've used the script please post a screenshot :P
Any problems? Talk to me on this thread :D

-----------------------------------------------------------------------------------------------------------
Scripts
----------------------------------------------------------------------------------------------------------
Version 1.0 *OLD*
Spoiler:
Version 2.0 NEW*
Spoiler:

Credits:
-----------
CRAZYNINJAGUY : Teaching me and making the bulk of the script.
ME : I'd like to thank me fro starting this project and making version 1.0
WICHU : Giving me some scripting help :p


 
Last edited:

キラキラ

KiraKira
48
Posts
14
Years
  • Age 32
  • Seen May 17, 2011
Would it be possible to change the amount of characters needed? I can't use a 5 character password, or else it doesn't enter.
I'm fine with making the passwords have space at the end though, I'm just curious.

Thank you so much for the script, I'll be using it. :]
Credits to yourself and Wichu.
 

PokemonPlatnum

nomnomnom.
257
Posts
16
Years
Would it be possible to change the amount of characters needed? I can't use a 5 character password, or else it doesn't enter.
I'm fine with making the passwords have space at the end though, I'm just curious.

Thank you so much for the script, I'll be using it. :]
Credits to yourself and Wichu.
Simple :)
Go to this section of the script:
Code:
  password=pbEnterText(_INTL("Enter the password"),[B]8[/B],[U]8[/U])
This is what this can be translated as :)
Code:
def pbEnterText(helptext,[B]minlength[/B],[U]maxlength[/U],initialText="")
I used the underline and bold to help :)
So simply change the 8 to a 5 ;)
Like so:
Code:
  password=pbEnterText(_INTL("Enter the password"),[B]5,5[/B])
Done
-PP
 

キラキラ

KiraKira
48
Posts
14
Years
  • Age 32
  • Seen May 17, 2011
I was looking at that, wasn't sure though. Thanks! Script works wonderfully and useful for events "pbAddForeignPokemon".
 
1,748
Posts
14
Years
i cant get it 2 work with 2 or more events help. well i mean i got it to work but not with more than 2 passwords it doesnt do the 2nd 1 srry this is on a psp so im lazy on it.
 

PokemonPlatnum

nomnomnom.
257
Posts
16
Years
i cant get it 2 work with 2 or more events help. well i mean i got it to work but not with more than 2 passwords it doesnt do the 2nd 1 srry this is on a psp so im lazy on it.
Emm...make a new event above main and put this in it :) It hasn't been tested so tell me if it works :P Remember now to call Class_MysteryGift2.new, this time :)
Code:
#######################################################################
# Mystery Gift System for Pokemon Essentials                          #
# By PokemonPlatnum for the PokeCommunity                             #
# Using ALOT of help from Wichu                                       #
# 8/04/2010                                                           #
#If you are having trouble with this script contact me on my profile, #
#by pm or on the thread, thanks                                       #
#######################################################################
=begin

To call this script simply use this:
Class_MysteryGift2.new

=end
class Class_MysteryGift2
def initialize
getPassword
end

def getPassword
  password=pbEnterText(_INTL("Enter the password"),8,8)
  case password
  when "PASSWORD" #You can choose yor password on this line
    Kernel.pbMessage(_INTL("Correct password!")) #This is the text after inputting the password.
    Kernel.pbReceiveItem(PBItems::MEMBERSPASS) #You can change this item if needed.
  when "adhosdgf" #You can choose yor password on this line
    Kernel.pbMessage(_INTL("Correct password!")) #This is the text after inputting the password.
    Kernel.pbReceiveItem(PBItems::OAKSLETTER) #You can change this item if needed.
  when "adhosdgf" #You can choose yor password on this line
    #You can insert your own items and messages here
  else
    Kernel.pbMessage(_INTL("Incorrect password..."))
  end
end
end
emm...might update this soon ;)
 
19
Posts
13
Years
  • Seen Jan 1, 2011
how do you make it go on the start up menu?
 
Last edited:
19
Posts
13
Years
  • Seen Jan 1, 2011
ok... were on pokemonload do i put it? everyplace i put it it starts Immediately when i start the game.
 

PokemonPlatnum

nomnomnom.
257
Posts
16
Years
It's here.
Mystery Gift System 2.0
Whats New:


  • You can select between different items which is then followed by a password unlock.
  • Slightly easier to add more than 2 items.

Code:
#######################################################################
# Mystery Gift System 2.0                                             #
# For Pokemon Essentials                                              #
# By PokemonPlatnum and Crazyninjaguy(Most by him :L)                 #
# Using ALOT of help from Wichu                                       #
# http://www.planetdev.net                                            #
# 12/05/2010                                                          #
#If you are having trouble with this script contact me on my profile, #
#by pm or on the thread, thanks                                       #
#######################################################################
=begin

To call this script simply use this:
Class_MysteryGift.new

=end
class MysteryGift
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @sprites={}
    @sprites["spriteset"]=Spriteset_Map.new
  end
  def main
    commands=[
      _INTL("Potion"),
      _INTL("Elixir"),
      _INTL("Ether"),
      _INTL("Exit")
    ]
    @command = Window_CommandPokemon.new(commands, 160)
    @text = Window_UnformattedTextPokemon.new("Which gift would you   like?")
    @text.y = Graphics.height - @text.height
    @command.x = Graphics.width - @command.width
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    pbDisposeSpriteHash(@sprites)
  end
  def update
    @command.update
    if @command.active
      update_command
    end
  end
  def update_command
    if Input.trigger?(Input::B)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::C)
    case @command.index
    when 0
      password=pbEnterText(_INTL("Enter the password"),8,8)
      case password
      when "PASSWORD"
        Kernel.pbMessage(_INTL("Correct password!"))
        Kernel.pbReceiveItem(PBItems::POTION)
      else
        Kernel.pbMessage(_INTL("Incorrect password..."))
      end
      end
    when 1
      password=pbEnterText(_INTL("Enter the password"),8,8)
      case password
      when "adhosdgf"
        Kernel.pbMessage(_INTL("Correct password!"))
        Kernel.pbReceiveItem(PBItems::ELIXIR)
      else
        Kernel.pbMessage(_INTL("Incorrect password..."))
      end
      end
    when 2
      password=pbEnterText(_INTL("Enter the password"),8,8)
      case password
      when "pwnage91"
        Kernel.pbMessage(_INTL("Correct password!"))
        Kernel.pbReceiveItem(PBItems::ETHER)
      else
        Kernel.pbMessage(_INTL("Incorrect password..."))
      end
      end
    when 3
      $scene = Scene_Map.new
    end
  end
end

What's going to be in 3.0?


  • Mystery gift background image.
  • Mystery gift BGM Audio.
  • Access from the 'New Game' screen :)
  • If you would personally like any features to be added reply on this thread :P

REMEMBER TO CREDIT CRAZYNINJAGUY, ME AND WICHU FOR THIS SCRIPT.
Thank you :cool:
 

Cilerba

the hearts of lonely people
1,162
Posts
14
Years
Wow. This is really good ^_^
I had a script similar to this a while back, but your script is a lot better then mine. However, you should add comments in the lines just to maybe help people if they want to add new passwords, add new gifts, etc.
 

PokemonPlatnum

nomnomnom.
257
Posts
16
Years
Wow. This is really good ^_^
I had a script similar to this a while back, but your script is a lot better then mine. However, you should add comments in the lines just to maybe help people if they want to add new passwords, add new gifts, etc.
Thanks :)
Yeah I did that for Version 1 and I must of forgot :O
 
Last edited:
10
Posts
15
Years
  • Seen Jan 22, 2013
I get error:
? 62? SyntaxError ??????
in line 62 where it says:
When 1 #on this is the line error
password = pbEnterText (_INTL ("Enter the password"), 8,8)
 
Back
Top