View Single Post
  #1    
Old January 27th, 2009 (12:30 AM). Edited April 15th, 2010 by Spherical Ice.
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
Silver Tier
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Posts: 1,816
Hello all, and thanks for even opening this! ^-^

Anyways... I am not about to make this all flashy and pretty, because it isn't, these scripting techniques should not be tried unless you are sure you know what you are doing!
This is for Advanced - Expert Scripters, fluent in PokeCode. (XSE is preferable, since that is what I will be using.)
Also, in each special script I show you, I will use 'OFFSET-A', or 'OFFSET-B' as placeholders for whatever you want.

Okies...
here is the first thing I will be including in this document...
The quite sought after...
Explaining the Daycare Script

Ok, First off, lets post the WHOLE code, then I'll break it down, and explain each line individually.

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
special 0x187
special2 LASTRESULT 0x178
compare LASTRESULT 0x1
if 0x1 goto @OFFSET-A
msgbox @OFFSET-B 0x5
compare LASTRESULT 0x0
if 0x1 goto @OFFSET-C
special2 LASTRESULT 0x84
compare LASTRESULT 0x1
if 0x1 goto @OFFSET-D
fadescreen 0x1
special 0xBC
waitstate
compare 0x8004 0x6
if 0x4 goto @OFFSET-E
special2 LASTRESULT 0x85
compare LASTRESULT 0x0
if 0x1 goto @OFFSET-H
special2 0x8005 0xBA
special 0x176
cmdc3 0x2F
release
end
Now, I know this is really scary, so big and burly, nasty and such, but it can all be explained, and that is what I will do...

Code:
#dynamic 0x800000

lock
faceplayer
-------------------------------
You know what these do...
Code:
special 0x187
-------------------
I am still doing research on this particular special command... but I suggest leaving it at the top, or the script wont go as planned...
Code:
special2 LASTRESULT 0x178
compare LASTRESULT 0x1
if 0x1 goto @OFFSET-A
-------------------------------
special2 LASTRESULT 0x178, assigns LASTRESULT with either 1, or 0, like a binary switch.
It set it to 1 if there ARE pokemon already stored using this script, 0 is set, if there are no pokemon previously stored.
compare LASTRESULT 0x1, checks if LASTRESULT is set to 1, for Pokemon already stored.
if 0x1 goto @OFFSET-A, means, if LASTRESULT is set to 1, go to the specified offset, usually used in order to either return the pokemon, or tell the player that they already have a pokemon deposited.
Code:
msgbox @OFFSET-B 0x5
compare LASTRESULT 0x0
if 0x1 goto @OFFSET-C
-----------------------
An experienced scripter such as yourself would know this bit of code.
I use this to ask the player if they WANT to deposit a pokemon.
If they say no, it goes to OFFSET-C.  This Portion of code is Optional, and may be removed if you are stealing a pokemon for an event of sorts.
Code:
special2 LASTRESULT 0x84
compare LASTRESULT 0x1
if 0x1 goto @snippet9
-------------------------
special2 LASTRESULT 0x84, sets LASTRESULT to be either 0 or 1, but this time, 1 means that you only have one pokemon in your party, and 0 means you have more than one.
This is useful, so the player doesn't accidentally give away his.her last pokemon!
You should know what the Compare and the IF commands do by now...
Code:
fadescreen 0x1
special 0xBC
waitstate
compare 0x8004 0x6
if 0x4 goto @OFFSET-E
----------------------------
A bigger chunk, but explainable.
You know what fadescreen does.
special 0xBC, brings up the pokemon selection screen, this is needed unfourtunatley... and I have yet to find away around needing this... if you were planning on having a pokemon stolen from the player at all in the game... so sorry...
waitstate, just waits for the Pokemon selection to be made, and waits for the screen to be faded back in.
compare 0x8004 0x6, checks if you pressed the B button, or pressed the cancel button in the pokemon menu.
if 0x4 goto @OFFSET-E, just says if you did press B, or cancel, then go to the offset. useful for canceling the script, and not causing an error by taking an undefined pokemon.
Code:
special2 LASTRESULT 0x85
compare LASTRESULT 0x0
if 0x1 goto @OFFSET-H
-----------------------------
special2 LASTRESULT 0x85, sets LASTRESULT, again, to be either 0, or 1.  This time, if LASTRESULT is 0, that means that if you were to give away the pokemon selected, your last pokemon would be an egg.  And if LASTRESULT is 1, that means that if you gave the selected pokemon away, that you will still have pokemon to defend yourself with.
This is VERY useful, in order to prevent the player from playing with nothing but an egg, which could lead to errors.
OFFSET-H is the offset to lead AWAY from this script if all that would be left is an egg.
Code:
special2 0x8005 0xBA
---------------------------
This sets 0x8005 to the value stored in 0xBA, 0xBA is the Pokemon Species # of the pokemon selected, this is optional, but recomended, it is also useful for making the pokemon cry happen, like when selecting a pokemon from Professor Oak.
Code:
special 0x176
cmdc3 0x2F
----------------
I am still doing research on these two commands, but I believe that when they are put in this order, and used together like this, they remove the selected pokemon from the party!
DO NOT change them, remove them, or do anything to them, or the script will not work!
Code:
release
end
-----------
If you need an explanation about this, you should not be reading this, you are not ready.
As you can see, I have explained how to take pokemon from the player, in (somewhat decent) detail.
If you have any questions, you know how to post here!

Don't ask about how to return taken pokemon to the player, I am still working out the kinks to that!
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote