The PokéCommunity Forums  

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

Notices

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.


Advertise here

Reply
 
Thread Tools
  #1    
Old March 12th, 2012, 08:36 AM
pokemonmasteraaron's Avatar
pokemonmasteraaron
The blind Pokémon Master!
 
Join Date: Jan 2011
Location: In the forest of an undiscovered region
Age: 18
Gender: Male
Nature: Relaxed
Send a message via Skype™ to pokemonmasteraaron

Advertise here
This tutorial is for Pokémon Essentials RMXP.
There is atleast one script equivilant to this tutorial.
Don't want to add or modify scripts?
Want to have a password system like Pokémon Rumble, and so many more?
Read on!
This isn't the best way, but it is the simplest way, and it is very powerful.
This will be using event commands.
I recommend doing this in a common event if you are going to have multiple places in your game where you can enter passwords.
Now, let's begin.
First, for safety, insert a control variables 001 operation is set. set it to zero.
Next, you are going to insert a show text command.
You need to expand it.
Use Extendtext.exe (it comes with essentials).
Now, copy & paste this in the show text box.
Please enter a password?\ch[1,9,1,2,3,4,5,6,7,8,9,0]
What we're doing is showing them ten options.
0-9.
So, next we need to define conditional branches which contents will be activated when the player hits an option.
Conditional branch: variable 001 is equal to 0.
Conditional branch: variable 001 is equal to 1.
Conditional branch: variable 001 is equal to 2.
Conditional branch: variable 001 is equal to 3.
etc.
etc.
Note that conditional branch: variable 001 is equal to 0 will be activated when the player hits one.
conditional branch: variable 001 is equal to 1, is activated when the player hits two, etc.
So when you have all of this set up, your going to want to copy it all.
Paste it in another common event.
Edit the show text to say something like:
next?\ch[1,9,1,2,3,4,5,6,7,8,9,0]
(remember to extend it again.)
Now cut this from the common event event and paste it at the end of our old common event, nine times, or however many numbers a password will be.
Great, we're done setting up the base.
Now, for the actual password setup.
Make a new variable and call it something like "Master ball code."
Now, at the beginning of the event, where you have control variables 001 set to 0, put a variables 060 (or whatever) master ball code set to 0.
This is to prevent people from entering parts of the correct code over and over until they actually get it (with out actually entering the code).
Now, let's open notepad or whatever.
Anything that can write text, I suppose.
Write your password.
Just make it up.
5999810293
Now, save this document as mypassword.txt or something so you can test out your code.
Starting at the beginning, find a conditional branch that is variable 060 is equal to (one less number than what they have to press).
Than, put a control variables 060 operation plus one
Example
I'm going to find conditional branch: variables 060 is equal to 4 and place control variables 060 plus 1.
Than, I'm going to navigate to the next text and find conditional branch: variables 060 is equal to eight and place control variables 060 plus 1.
Make sure to not place to of the variables on the same set of choices.
What I mean is, make sure to navigate to the next list before placing another control variables.
If so, for example, the player could hit both 5 and nine and get it right, but since we only have ten numbers, the password would be impossible to enter!
Now, at the very end of the event, we are going to place a conditional branch if variables 060 is equal to ten.
If true, put another conditional branch which checks to see if they have already obtained the prise.
Conditional branch: Switch 050 is off, than give them the prise.
In this example, you would give them a master ball
Conditional branch script: Kernel.pbReceiveItem(PBItems::MASTERBALL)
control switches: 050 operation on.
If the switch is on, which would be the false section, put a message like this
text: You have already obtained this prise.
It was a Masterball.
Insert an Exit event processing after the text (this is important!)
In the false for the conditional branch: variables 060 is equal to ten, put nothing at all (also very important!
Do this over and over until you have all the passwords you want.
Note that you don't have to redo the base for every password!
Note the base is the ten choices.
Infact, don't redo them for every password, it wouldn't work.
At the very end of the event, you need to do something like this
play se: buzzer 100 100
text: You have entered an incorrect password!
Questions:
q: Why don't we just put this in the false section of the conditional branch: variables 060 is equal to ten?
a: because if you are going to have multiple passwords, this message would keep desplaying over and over.
Q: Why did we need an exit event processing if the switch was on?
a: Because otherwise, it would look like this to the player
You have already obtained this prise.
It was a Masterball.
You have entered an incorrect password!
Now, does this make sense?
Comments are appreciated!
If you didn't understand something, please tell me so you can use this tutorial to your best advantage.
There is one more section of this thread.
Remember how I said "This isn't the best way, but it is the simplest way, and it is very powerful."?
Why is it not the best way?
One reason, and one reason only.
It's not a normal textbox the player types in, there making choices.
Therefore, you can't backspace!
You have to just finish the code and try again.
If you press X to backup, it will most likely type a nine.
I don't know any way to help you with that.
__________________
Game developer.
Not nearly as active on here as I used to be.
Still like meeting and talking to pokemon fanatics like myself.
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
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:25 PM.


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.