PDA

View Full Version : [Essentials script] Mystery Gift System (Basic)


PokemonPlatnum
April 8th, 2010, 03:11 PM
http://img404.imageshack.us/img404/8329/mysterygift20.png
------------------------------------------------------------------------------------------------------------------------------------
Instructions:



To use this script simply place it above main :)
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*

#######################################################################
# Mystery Gift System v1.0 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_MysteryGift.new

=end
class Class_MysteryGift
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
Version 2.0 NEW*
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.


#######################################################################
# 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:
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

キラキラ
April 11th, 2010, 08:12 AM
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
April 11th, 2010, 08:37 AM
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:
password=pbEnterText(_INTL("Enter the password"),8,8)This is what this can be translated as :)
def pbEnterText(helptext,minlength,maxlength,initialText="")I used the underline and bold to help :)
So simply change the 8 to a 5 ;)
Like so:
password=pbEnterText(_INTL("Enter the password"),5,5)
Done
-PP

キラキラ
April 11th, 2010, 08:45 AM
I was looking at that, wasn't sure though. Thanks! Script works wonderfully and useful for events "pbAddForeignPokemon".

PokemonPlatnum
April 11th, 2010, 08:51 AM
I was looking at that, wasn't sure though. Thanks! Script works wonderfully and useful for events "pbAddForeignPokemon".
I'm glad I helped and that you enjoy the script :)
-PP

Urugamosu
April 28th, 2010, 01:21 AM
Wow.. Amazing. Thanks to you, I can do this!

PokemonPlatnum
May 1st, 2010, 12:50 PM
Wow.. Amazing. Thanks to you, I can do this!
Glad to help :) If you need any help please reply on this thread.
-PP

Umbreon
May 5th, 2010, 02:53 PM
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
May 7th, 2010, 11:23 PM
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 :)
#######################################################################
# 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 ;)

Blinde
May 9th, 2010, 08:18 PM
how do you make it go on the start up menu?

Umbreon
May 10th, 2010, 10:10 AM
k it works, ty. oh and maki
g it on the titlescreen edit pokemonload script.

Blinde
May 10th, 2010, 11:30 AM
ok... were on pokemonload do i put it? everyplace i put it it starts Immediately when i start the game.

PokemonPlatnum
May 12th, 2010, 11:06 AM
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.


#######################################################################
# 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
May 12th, 2010, 01:07 PM
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.

Crazyninjaguy
May 12th, 2010, 01:41 PM
Yeah, i'll add that in the next version :)
Customization is always important.

PokemonPlatnum
May 12th, 2010, 01:47 PM
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

Lucario_XP
May 12th, 2010, 04:50 PM
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)

Cilerba
May 12th, 2010, 04:55 PM
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)

You shouldn't have a space between "pbEnterText" and "(_INTL"

Lucario_XP
May 12th, 2010, 05:06 PM
You shouldn't have a space between "pbEnterText" and "(_INTL"

I'm sorry, I wrote wrong in the previous message.
but in the script so I have no spaces.
what which is not the problem.

Cilerba
May 12th, 2010, 05:23 PM
I'm sorry, I wrote wrong in the previous message.
but in the script so I have no spaces.
what which is not the problem.

Hmm...well then I cannot help you. Ask Pokemon Platnum for help with the script. :\

PokemonPlatnum
May 13th, 2010, 10:47 AM
Ok, i'm also having issues with this script :) Please do NOT use this script until CNG gets home and work on this script properly :)

majorgames
May 23rd, 2010, 05:20 AM
http://img404.imageshack.us/img404/8329/mysterygift20.png
------------------------------------------------------------------------------------------------------------------------------------
Instructions:



To use this script simply place it above main :)
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*

#######################################################################
# Mystery Gift System v1.0 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_MysteryGift.new

=end
class Class_MysteryGift
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
Version 2.0 NEW*
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.

#######################################################################
# 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:
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



Thanks dude i needed mystery gift in some way shape or form and you gave it to me, i have a request for V.3 and a question

request - would it be possible for you to make it so that mystery gift works only when i start say a particular server maby via a script or program that i start. then when the people find out about the event they can go to mystery gift and access the event without pass word but rather straight from the server that i set up.

question - when is V.3 comming out

Neo-Spriteman
May 24th, 2010, 03:22 PM
What's going to be in 3.0?[/SIZE]


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:

I personally think you should allow the use of the sprites for items (ex. Enigma Crystal, Azure Flute ect.)

PokemonPlatnum
May 29th, 2010, 04:30 AM
Thanks dude i needed mystery gift in some way shape or form and you gave it to me, i have a request for V.3 and a question

request - would it be possible for you to make it so that mystery gift works only when i start say a particular server maby via a script or program that i start. then when the people find out about the event they can go to mystery gift and access the event without pass word but rather straight from the server that i set up.

question - when is V.3 comming out
1. No problem :)
2. I'll look into your request :)
3. It'll be out when it's out atm V2.0 doesn't work :L

I personally think you should allow the use of the sprites for items (ex. Enigma Crystal, Azure Flute ect.)
Yeah, good idea :) Thanks man :P