FoggyDoggy
Im comin' home...
- 1,816
- Posts
- 17
- Years
- Age 32
- Just Outside Treasure Town
- Seen Nov 28, 2024
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.
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...
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!
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
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. [color="red"]This Portion of code is Optional, and may be removed if you are stealing a pokemon for an event of sorts.[/color]
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, [COLOR="Red"]this is optional[/COLOR], 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.
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!
Last edited by a moderator: