Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

Reply
 
Thread Tools
  #1    
Old June 8th, 2009 (12:16 AM). Edited June 9th, 2009 by 0m3GA ARS3NAL.
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
  • Silver Tier
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 24
Gender: Male
Nature: Gentle
Posts: 1,812
Hello PokeCommunity.

I know there are many XSE tutorials out there, but I thought I would give my 2 cents

about topics not covered often.


Uncommon Commands



comparefarbytetobyte




The command comparefarbytetobyte is useful for initiating a script depending on a

value in the RAM, like pallet, or some other random thing.
(Useful for you DaN (Day and Night) users, for making night and day based scripts.

An example of this code would be...
Code:
comparefarbytetobyte 0xPOINTER 0x5
if b_== goto @script
This would compare 0x5 to a byte at the pointer, (Wherever you decide to make it.)
And if the byte is 05, it will go branch off to the otehr script.

Pretty simple yeah?

The alternate version of this being
comparefarbytes
is very similar, only instead it compares bytes found at 2 pointers together.

Code:
comparefarbytes 0xPOINTER1 0xPOINTER2

special2



The command special2 has a lot of different confusinf aspects, mainly because we

don't know all of the commands, but what it does is it gives a value back depending

on the command executed.

For instance, special2 0x800D 0x104, would excecute special2, and it would do

something, and a vale would be put into 0x800D...
Kinda difficult to explain...

Basically it checks some random thing in the RAM, and depending on what it sees, it

gives back a number.
A good example being the daycare script.

Here is a small portion...
Code:
special2 LASTRESULT 0x178
compare LASTRESULT 0x1
special2 0x178 checks if we have a pokemon in the daycare. (Single Daycare, not Dual)
And if we do, it sets LASTRESULT to be 1, otehrwise, it is 0.
(you could use this for a hack...)


yesnobox



yesnobox is nothing too important.
It just pops up a yes/no prompt.
This can be a cool command though, since you can choose where the box will be.
it is simple to use.

Code:
yesnobox 0xXCORDINATE 0xYCORDIANTE
The first byte is the X Coordinate, and the second is the Y Concordia, of the screen

of course, not the map. (I never really tested out the cordinate plane of the

screen, so you'll have to experiment with it...)

multichoice2 and multichoice3



the command multichoice2 is nothing that special, all it does it show a regular

multichoice command, only you are able to select which choice is higlighted when

opened.
(Crude ASCII drawings)

Normal
--------<
--------
--------
--------
--------

Multichoice2
--------
--------
--------
--------<
--------

Nothing too special, but I'll give you a code example for the heck of it.
Code:
multichoice2 0x5 0x5 0x10 0x2 0x0
This will make a multichoice box, at coordinates 5,5, using multichoice #16, and the

3rd selection is highlighted. (I cant remember if 0x0 makes the B button press able or not...)


multichoice3



Multichoice3 is a bit more interesting.
With this one we choose how many answers are in a row, making for an interesting way

to use multichoices. (I like using yes/no multichoices like this, set at the top of

the screen, or just above the text box... =3)
(Crude ASCII drawing)
Normal
--------<
--------
--------
--------
--------
--------

Multichoice3 (3 per row)
--------< --------
-------- --------
-------- --------

Here is a code example of the above scenario.

Code:
multichoice3 0x5 0x5 0x10 0x3 0x0

bufferpokemon



This is a great command for people who like to give random pokemon to the player.
Especially since variables can be used as pokemon species numbers.

For example, if you have a script that randomly selects 3 pokemon, lets say it

chooses 0x19 (Pikachu) and it stores it in a variable, LASTRESULT (0x800D).
You can use the bufferpokemon command to make Pikachu's name appear in a script.

Code:
bufferpokemon 0x1 LASTRESULT
The first byte is the buffer Number. (There are 3 buffers.) and the second is the

variable that has pikachus number in it!
Pretty simple eh?

This exact process can be done with items too, only use the;
bufferitem command.
This also works with attack names.
bufferattack, and many otehrs, check the XSE database for more info.



Well, that is all for now, if you have any suggestions, comment!
If you like, comment, +rep, or whatever you want, I don't care so long it is positive!
__________________
>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

Relevant Advertising!

  #2    
Old June 8th, 2009 (9:35 AM).
onyx79's Avatar
onyx79 onyx79 is offline
Red Dead Revolver
     
    Join Date: Jan 2009
    Location: Orange Islands (=
    Gender: Male
    Nature: Modest
    Posts: 503
    thanks for this! I hope this will help me and other people in hacking
    __________________
    my room base: http://www.pokecommunity.com/showpost.php?p=5397075&postcount=64
    Reply With Quote
      #3    
    Old June 8th, 2009 (4:30 PM).
    liuyanghejerry's Avatar
    liuyanghejerry liuyanghejerry is offline
       
      Join Date: Jan 2008
      Location: China,Xi'an
      Nature: Calm
      Posts: 219
      Really a good start,0m3GA ARS3NAL!
      There are a lot of "new" commands that I want to learn,such as comparefarbytetobank.If you can say something about it,I'll appreciate.
      __________________
      Zel,thethethethe,LU-HO,Darthatron,HackMew,ZodiacDaGreat,Juan,score_under,JPAN,Tamah-chan,I really appreciate your kindness and your help!:D
      Reply With Quote
        #4    
      Old June 9th, 2009 (6:24 AM).
      sab's Avatar
      sab sab is offline
      Now too much of a life.
         
        Join Date: Jul 2008
        Location: Midgar
        Age: 21
        Gender: Male
        Nature: Timid
        Posts: 995
        good start! I would personaly add "random" "setweather" and "countpokemon" to this but it's your call.
        __________________
        Reply With Quote
          #5    
        Old June 9th, 2009 (11:02 AM). Edited June 9th, 2009 by 0m3GA ARS3NAL.
        0m3GA ARS3NAL's Avatar
        0m3GA ARS3NAL 0m3GA ARS3NAL is offline
        Im comin' home...
        • Silver Tier
         
        Join Date: Jan 2008
        Location: Superjail Penitentiary
        Age: 24
        Gender: Male
        Nature: Gentle
        Posts: 1,812
        Quote:
        Originally Posted by liuyanghejerry View Post
        Really a good start,0m3GA ARS3NAL!
        There are a lot of "new" commands that I want to learn,such as comparefarbytetobank.If you can say something about it,I'll appreciate.
        I never really used that command, I'll look into it.

        Quote:
        Originally Posted by sab View Post
        good start! I would personaly add "random" "setweather" and "countpokemon" to this but it's your call.
        Sure! Random has been covered before, but I'll do it. Countpokemon is also a good Idea, I'll get on these!
        __________________
        >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
          #6    
        Old June 10th, 2009 (8:58 PM).
        liuyanghejerry's Avatar
        liuyanghejerry liuyanghejerry is offline
           
          Join Date: Jan 2008
          Location: China,Xi'an
          Nature: Calm
          Posts: 219
          Quote:
          Originally Posted by 0m3GA ARS3NAL View Post
          I never really used that command, I'll look into it.
          Yes,me neither.But I'm writing a Chinese tut about XSE,so I need to know them...anyway,thanks.
          __________________
          Zel,thethethethe,LU-HO,Darthatron,HackMew,ZodiacDaGreat,Juan,score_under,JPAN,Tamah-chan,I really appreciate your kindness and your help!:D
          Reply With Quote
            #7    
          Old June 11th, 2009 (1:11 AM).
          ruken ruken is offline
             
            Join Date: Apr 2009
            Gender:
            Posts: 11
            thanks for the yesnobox
            Reply With Quote
              #8    
            Old June 11th, 2009 (4:40 AM).
            DarkPrince304's Avatar
            DarkPrince304 DarkPrince304 is offline
            Back to Hacking after exams!!!
               
              Join Date: May 2009
              Location: PokeCommunity
              Gender: Male
              Nature: Calm
              Posts: 167
              Hey is there a command to release a pokemon from the party?
              __________________
              I am the creator of Pokemon Gotta Catch em' All! Game.







              Click on the Banner to go to main thread
              Reply With Quote
                #9    
              Old June 11th, 2009 (1:38 PM).
              0m3GA ARS3NAL's Avatar
              0m3GA ARS3NAL 0m3GA ARS3NAL is offline
              Im comin' home...
              • Silver Tier
               
              Join Date: Jan 2008
              Location: Superjail Penitentiary
              Age: 24
              Gender: Male
              Nature: Gentle
              Posts: 1,812
              Quote:
              Originally Posted by DarkPrince304 View Post
              Hey is there a command to release a pokemon from the party?
              Nope, that would be ASM, but I am getting into ASM, so I'll go ahead and write one up later.
              __________________
              >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
                #10    
              Old June 15th, 2009 (7:40 PM).
              ckret2's Avatar
              ckret2 ckret2 is offline
              usually pronounced "secret 2"
                 
                Join Date: Dec 2008
                Location: You Are Here
                Age: 26
                Gender:
                Nature: Rash
                Posts: 518
                Oh, wow!! Thank you SO much! I was just about to post a question in the Script Help Thread about special2, and found you explained it here! I've spent a couple hours or so today decoding the special2 used in the legendary bird scripts, 0xB4.

                I've also got a question about that special2, but, before I get on to that, here's what I know; maybe this is something you'd be interested in for the tutorial, I dunno. Here's, for example, the Zapdos script in full:

                Spoiler:
                #org 0x1637B8
                special 0x187
                compare 0x800D 0x2
                if 0x1 goto 0x81A7AE0
                special 0x188
                lock
                faceplayer
                setwildbattle 0x91 0x32 0x0
                checksound
                cry 0x91 0x2
                preparemsg 0x81A6448
                waitmsg
                waitcry
                pause 0xA
                playsong 0x156 0x0
                waitkeypress
                setflag 0x807
                special 0x138
                waitstate
                clearflag 0x807
                special2 0x800D 0xB4
                compare 0x800D 0x1
                if 0x1 goto 0x816381B
                compare 0x800D 0x4
                if 0x1 goto 0x8163824
                compare 0x800D 0x5
                if 0x1 goto 0x8163824
                setflag 0x2BF
                release
                end

                #org 0x1A7AE0
                release
                end

                #org 0x16381B
                setflag 0x2BF
                goto 0x81A922D

                #org 0x163824
                setvar 0x8004 0x91
                goto 0x81A9236

                #org 0x1A922D
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                release
                end

                #org 0x1A9236
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                bufferpokemon 0x0 0x8004
                msgbox 0x81A63C4 0x4
                release
                end

                #org 0x1A6448
                = Gyaoo!

                #org 0x1A63C4
                = The [buffer1] flew away!


                To make things easier on myself, I took out the offsets and added normal text explanations where appropriate, so here's the "dumbed down" script:

                Spoiler:
                #org 0x1637B8
                special 0x187
                compare 0x800D 0x2
                if 0x1 goto @[RELEASE-END]
                special 0x188
                lock
                faceplayer
                setwildbattle 0x91[Zapdos] 0x32[level 50] 0x0
                checksound
                cry 0x91[Zapdos] 0x2[???]
                preparemsg @[ZAPDOScry]
                waitmsg
                waitcry
                pause 0xA
                playsong 0x156[???] 0x0
                waitkeypress
                setflag 0x807
                special 0x138[starts wild battle]
                waitstate
                clearflag 0x807
                special2 0x800D 0xB4
                compare 0x800D 0x1
                if 0x1 goto @[SETFLAG-2BF]
                compare 0x800D 0x4
                if 0x1 goto @[SETVAR]
                compare 0x800D 0x5
                if 0x1 goto @[SETVAR]
                setflag 0x2BF
                release
                end

                #org @[RELEASE-END]
                release
                end

                #org @[SETFLAG-2BF]
                setflag 0x2BF
                goto @[HIDESPRITE-END]

                #org @[SETVAR]
                setvar 0x8004 0x91
                goto @[HIDE-FLY]

                #org @[HIDESPRITE-END]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                release
                end

                #org @[HIDE-FLY]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                bufferpokemon 0x0 0x8004
                msgbox @[FLEW] 0x4
                release
                end

                #org @[ZAPDOScry]
                = Gyaoo!

                #org @[FLEW]
                = The [buffer1] flew away!


                And even further abbreviated, condensed, randomly swuished together, and messed with until it's turned into what I think is relevant to the special2 used here:

                Spoiler:
                setflag 0x807
                special 0x138[starts wild battle]
                waitstate
                clearflag 0x807
                special2 0x800D 0xB4
                compare 0x800D 0x1
                if 0x1 goto @[SETFLAG-2BF]
                compare 0x800D 0x4
                if 0x1 goto @[SETVAR]
                compare 0x800D 0x5
                if 0x1 goto @[SETVAR]
                setflag 0x2BF
                release
                end

                #org @[SETFLAG-2BF]
                setflag 0x2BF
                goto @[HIDESPRITE-END]
                #org @[HIDESPRITE-END]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                release
                end

                #org @[SETVAR]
                setvar 0x8004 0x91
                goto @[HIDE-FLY]
                #org @[HIDE-FLY]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                bufferpokemon 0x0 0x8004
                msgbox @[FLEW] 0x4
                release
                end
                #org @[FLEW]
                = The [buffer1] flew away!


                Side note: Oddly enough, even though flag 0x2BF is set, that's not Zapdos's number in AdvanceMap; Zapdos's number is 5D. However, it seems that 5D is a preset flag in FireRed (like the flag that make all the non-Rocket NPCs of Saffron City hidden until you beat Giovanni, at which point the flag is cleared). There's a command in the map script to check and see if flag 0x2BF has been set; if it has, then it won't clear 5D. As long as 2BF has not been set, the map script will do clearflag 0x5D, which lets Zapdos be visible.

                These are the conclusions I can draw from the above:

                special2 0x800D 0xB4
                compare 0x800D...
                • 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
                • 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set
                • 0x5; if true then the same as 0x4
                • if none are true, then the flag is set and that's the end.

                The reason I included some of the above stuff ("setflag 0x807" through "clearflag 0x807") is because, I assume, those flags are used to check and see if you fainted while battling the Zapdos, because it's set immediately before the battle starts and yet is cleared immediately after the battle ends. This is pretty much confirmed in the map script of the Power Plant:

                Spoiler:
                #org 0x163764
                #raw 0x5
                #raw pointer 0x816376F
                #raw 0x3
                #raw pointer 0x816378D
                #raw 0x0

                #org 0x16376F
                checkflag 0x807
                if 0x1 call 0x8163779
                end

                #org 0x16378D
                setworldmapflag 0x8B4
                checkflag 0x2BF
                if 0x0 call 0x81637AC
                checkflag 0x2D0
                if 0x0 call 0x81637B0
                checkflag 0x2D1
                if 0x0 call 0x81637B4
                end

                #org 0x163779
                special2 0x800D 0xB4
                compare 0x800D 0x7
                if 0x5 goto 0x81A77A9
                hidesprite 0x800F
                return

                #org 0x1637AC
                clearflag 0x5D
                return

                #org 0x1637B0
                clearflag 0x85
                return

                #org 0x1637B4
                clearflag 0x86
                return

                #org 0x1A77A9
                return


                And with the relevant info extracted:

                Spoiler:
                checkflag 0x807
                if 0x1 call @[SPECIAL2]
                end

                #org @[SPECIAL2]
                special2 0x800D 0xB4
                compare 0x800D 0x7
                if 0x5 goto 0x81A77A9
                hidesprite 0x800F
                return


                So, along with the conclusions I already had above, we can add one more:

                special2 0x800D 0xB4
                compare 0x800D...
                • 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
                • 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set (so you can rebattle the Pokémon?)
                • 0x5; if true then the same as 0x4
                • if none are true, then the flag is set to hide the Pokémon and that's apparently the end.
                if you faint, so that flag 0x807 isn't cleared...
                • 0x7; if it's 0x5 (in other words, "not exactly equal to" 0x7), then the Pokémon is apparently hidden.


                Sorry for the tl;dr it took to reach that conclusion. But it never hurts to show your work.

                The reason I'm throwing all this at you is because, for one thing, you're the first person so far to actually start to address what a special2 is, rather than just throw one into a tutorial in the middle of something else without talking about what it is and how it works. I'm trying to decode the script above to create another script that makes it impossible to progress unless you beat--don't catch, but beat--a Pokémon.

                I've decoded as much as I can of special2 0xB4, so I thought I'd present my research to someone who probably knows more about the command than I do. :D This same special2 is used with the legendary trio, Mewtwo, Lugia, Ho-Oh, Deoxys, and Snorlax, at the very least. (And those scripts use the "setflag/clearflag 0x807" trick too, which confuses me; if 0x807 is set and that means you can't go back to battle the Pokémon you were fighting when it was set, wouldn't that mean you can't ever battle any of the other legendaries, too...?)

                Any insight into how this command behaves would be useful and appreciated, and I hope I've presented some useful information and not just wasted you time with all this.
                __________________

                This one is my hack.


                This one is the hack I part-time map for.

                I got an Illumise?
                Pretty awesome.
                Glad I grabbed an egg I didn't recognize.
                Reply With Quote
                  #11    
                Old June 15th, 2009 (8:55 PM).
                0m3GA ARS3NAL's Avatar
                0m3GA ARS3NAL 0m3GA ARS3NAL is offline
                Im comin' home...
                • Silver Tier
                 
                Join Date: Jan 2008
                Location: Superjail Penitentiary
                Age: 24
                Gender: Male
                Nature: Gentle
                Posts: 1,812
                Quote:
                Originally Posted by ckret2 View Post
                Oh, wow!! Thank you SO much! I was just about to post a question in the Script Help Thread about special2, and found you explained it here! I've spent a couple hours or so today decoding the special2 used in the legendary bird scripts, 0xB4.

                I've also got a question about that special2, but, before I get on to that, here's what I know; maybe this is something you'd be interested in for the tutorial, I dunno. Here's, for example, the Zapdos script in full:

                Spoiler:
                #org 0x1637B8
                special 0x187
                compare 0x800D 0x2
                if 0x1 goto 0x81A7AE0
                special 0x188
                lock
                faceplayer
                setwildbattle 0x91 0x32 0x0
                checksound
                cry 0x91 0x2
                preparemsg 0x81A6448
                waitmsg
                waitcry
                pause 0xA
                playsong 0x156 0x0
                waitkeypress
                setflag 0x807
                special 0x138
                waitstate
                clearflag 0x807
                special2 0x800D 0xB4
                compare 0x800D 0x1
                if 0x1 goto 0x816381B
                compare 0x800D 0x4
                if 0x1 goto 0x8163824
                compare 0x800D 0x5
                if 0x1 goto 0x8163824
                setflag 0x2BF
                release
                end

                #org 0x1A7AE0
                release
                end

                #org 0x16381B
                setflag 0x2BF
                goto 0x81A922D

                #org 0x163824
                setvar 0x8004 0x91
                goto 0x81A9236

                #org 0x1A922D
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                release
                end

                #org 0x1A9236
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                bufferpokemon 0x0 0x8004
                msgbox 0x81A63C4 0x4
                release
                end

                #org 0x1A6448
                = Gyaoo!

                #org 0x1A63C4
                = The [buffer1] flew away!


                To make things easier on myself, I took out the offsets and added normal text explanations where appropriate, so here's the "dumbed down" script:

                Spoiler:
                #org 0x1637B8
                special 0x187
                compare 0x800D 0x2
                if 0x1 goto @[RELEASE-END]
                special 0x188
                lock
                faceplayer
                setwildbattle 0x91[Zapdos] 0x32[level 50] 0x0
                checksound
                cry 0x91[Zapdos] 0x2[???]
                preparemsg @[ZAPDOScry]
                waitmsg
                waitcry
                pause 0xA
                playsong 0x156[???] 0x0
                waitkeypress
                setflag 0x807
                special 0x138[starts wild battle]
                waitstate
                clearflag 0x807
                special2 0x800D 0xB4
                compare 0x800D 0x1
                if 0x1 goto @[SETFLAG-2BF]
                compare 0x800D 0x4
                if 0x1 goto @[SETVAR]
                compare 0x800D 0x5
                if 0x1 goto @[SETVAR]
                setflag 0x2BF
                release
                end

                #org @[RELEASE-END]
                release
                end

                #org @[SETFLAG-2BF]
                setflag 0x2BF
                goto @[HIDESPRITE-END]

                #org @[SETVAR]
                setvar 0x8004 0x91
                goto @[HIDE-FLY]

                #org @[HIDESPRITE-END]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                release
                end

                #org @[HIDE-FLY]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                bufferpokemon 0x0 0x8004
                msgbox @[FLEW] 0x4
                release
                end

                #org @[ZAPDOScry]
                = Gyaoo!

                #org @[FLEW]
                = The [buffer1] flew away!


                And even further abbreviated, condensed, randomly swuished together, and messed with until it's turned into what I think is relevant to the special2 used here:

                Spoiler:
                setflag 0x807
                special 0x138[starts wild battle]
                waitstate
                clearflag 0x807
                special2 0x800D 0xB4
                compare 0x800D 0x1
                if 0x1 goto @[SETFLAG-2BF]
                compare 0x800D 0x4
                if 0x1 goto @[SETVAR]
                compare 0x800D 0x5
                if 0x1 goto @[SETVAR]
                setflag 0x2BF
                release
                end

                #org @[SETFLAG-2BF]
                setflag 0x2BF
                goto @[HIDESPRITE-END]
                #org @[HIDESPRITE-END]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                release
                end

                #org @[SETVAR]
                setvar 0x8004 0x91
                goto @[HIDE-FLY]
                #org @[HIDE-FLY]
                fadescreen 0x1
                hidesprite 0x800F
                fadescreen 0x0
                bufferpokemon 0x0 0x8004
                msgbox @[FLEW] 0x4
                release
                end
                #org @[FLEW]
                = The [buffer1] flew away!


                Side note: Oddly enough, even though flag 0x2BF is set, that's not Zapdos's number in AdvanceMap; Zapdos's number is 5D. However, it seems that 5D is a preset flag in FireRed (like the flag that make all the non-Rocket NPCs of Saffron City hidden until you beat Giovanni, at which point the flag is cleared). There's a command in the map script to check and see if flag 0x2BF has been set; if it has, then it won't clear 5D. As long as 2BF has not been set, the map script will do clearflag 0x5D, which lets Zapdos be visible.

                These are the conclusions I can draw from the above:

                special2 0x800D 0xB4
                compare 0x800D...
                • 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
                • 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set
                • 0x5; if true then the same as 0x4
                • if none are true, then the flag is set and that's the end.

                The reason I included some of the above stuff ("setflag 0x807" through "clearflag 0x807") is because, I assume, those flags are used to check and see if you fainted while battling the Zapdos, because it's set immediately before the battle starts and yet is cleared immediately after the battle ends. This is pretty much confirmed in the map script of the Power Plant:

                Spoiler:
                #org 0x163764
                #raw 0x5
                #raw pointer 0x816376F
                #raw 0x3
                #raw pointer 0x816378D
                #raw 0x0

                #org 0x16376F
                checkflag 0x807
                if 0x1 call 0x8163779
                end

                #org 0x16378D
                setworldmapflag 0x8B4
                checkflag 0x2BF
                if 0x0 call 0x81637AC
                checkflag 0x2D0
                if 0x0 call 0x81637B0
                checkflag 0x2D1
                if 0x0 call 0x81637B4
                end

                #org 0x163779
                special2 0x800D 0xB4
                compare 0x800D 0x7
                if 0x5 goto 0x81A77A9
                hidesprite 0x800F
                return

                #org 0x1637AC
                clearflag 0x5D
                return

                #org 0x1637B0
                clearflag 0x85
                return

                #org 0x1637B4
                clearflag 0x86
                return

                #org 0x1A77A9
                return


                And with the relevant info extracted:

                Spoiler:
                checkflag 0x807
                if 0x1 call @[SPECIAL2]
                end

                #org @[SPECIAL2]
                special2 0x800D 0xB4
                compare 0x800D 0x7
                if 0x5 goto 0x81A77A9
                hidesprite 0x800F
                return


                So, along with the conclusions I already had above, we can add one more:

                special2 0x800D 0xB4
                compare 0x800D...
                • 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
                • 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set (so you can rebattle the Pokémon?)
                • 0x5; if true then the same as 0x4
                • if none are true, then the flag is set to hide the Pokémon and that's apparently the end.
                if you faint, so that flag 0x807 isn't cleared...
                • 0x7; if it's 0x5 (in other words, "not exactly equal to" 0x7), then the Pokémon is apparently hidden.


                Sorry for the tl;dr it took to reach that conclusion. But it never hurts to show your work.

                The reason I'm throwing all this at you is because, for one thing, you're the first person so far to actually start to address what a special2 is, rather than just throw one into a tutorial in the middle of something else without talking about what it is and how it works. I'm trying to decode the script above to create another script that makes it impossible to progress unless you beat--don't catch, but beat--a Pokémon.

                I've decoded as much as I can of special2 0xB4, so I thought I'd present my research to someone who probably knows more about the command than I do. :D This same special2 is used with the legendary trio, Mewtwo, Lugia, Ho-Oh, Deoxys, and Snorlax, at the very least. (And those scripts use the "setflag/clearflag 0x807" trick too, which confuses me; if 0x807 is set and that means you can't go back to battle the Pokémon you were fighting when it was set, wouldn't that mean you can't ever battle any of the other legendaries, too...?)

                Any insight into how this command behaves would be useful and appreciated, and I hope I've presented some useful information and not just wasted you time with all this.
                WOW, quite a lengthy post you got there, but yeah, special 2 does not really make anything in the game happen, but make a variable set to a number depending on what happens in the game... or what has already happened.
                __________________
                >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
                  #12    
                Old June 16th, 2009 (10:18 AM).
                ckret2's Avatar
                ckret2 ckret2 is offline
                usually pronounced "secret 2"
                   
                  Join Date: Dec 2008
                  Location: You Are Here
                  Age: 26
                  Gender:
                  Nature: Rash
                  Posts: 518
                  Quote:
                  Originally Posted by 0m3GA ARS3NAL View Post
                  WOW, quite a lengthy post you got there, but yeah, special 2 does not really make anything in the game happen, but make a variable set to a number depending on what happens in the game... or what has already happened.
                  So I figured, yeah. Knowing that it does that, though, and knowing how to use that to get it to do what you want, are two different matters... Have you looked into 0xB4, by any chance, or so far am I the only one who's been crazy enough to study it in-depth? I'm hoping to figure out how exactly to get it to work--like, do you have to do setwildbattle beforehand and then use special 0x138, or can a simple wildbattle be used and still be functional with 0xB4? And what exactly do all those numbers mean--does a value of 0x1 mean that you caught the Pokémon; what do 0x4 and 0x5 do, maybe one means "ran from battle" and the other means "made the Pokémon faint"; and what is 0x7 and why is the Pokémon hidden if you faint in battle and get any result other than 0x7?

                  There's very few ROM hackers out there who I think might've done enough research into XSE to figure out this kind of stuff, one of whom is you, another of which is HackMew, and in the guide that comes with XSE HackMew doesn't discuss special2. There isn't nearly enough info about special2 available, is there...?

                  I can tell you've figured out how to use various special2s to create a daycare script. Do you know if the behaviors of any other special2s have been determined yet?
                  __________________

                  This one is my hack.


                  This one is the hack I part-time map for.

                  I got an Illumise?
                  Pretty awesome.
                  Glad I grabbed an egg I didn't recognize.
                  Reply With Quote
                    #13    
                  Old February 23rd, 2014 (2:34 PM).
                  FraPunk FraPunk is offline
                     
                    Join Date: Feb 2014
                    Posts: 1
                    Hey, did you now if there's a command like "if var 0x??? = 0 goto" or "if var 0x??? > 0 goto"?
                    Thank you

                    (I'm sorry for my english but i'm italian and i don't speak english ver well... )
                    Reply With Quote
                      #14    
                    Old February 23rd, 2014 (11:36 PM).
                    Spherical Ice's Avatar
                    Spherical Ice Spherical Ice is offline
                    • Moderator
                    • Silver Tier
                     
                    Join Date: Nov 2007
                    Location: Bristol, UK
                    Age: 19
                    Posts: 5,202
                    Quote:
                    Originally Posted by FraPunk View Post
                    Hey, did you now if there's a command like "if var 0x??? = 0 goto" or "if var 0x??? > 0 goto"?
                    Thank you

                    (I'm sorry for my english but i'm italian and i don't speak english ver well... :) )
                    compare 0x??? 0x1
                    if 0x1 goto @snippet1
                    __________________

                    A Pokemon that is discriminated!
                    Support squirtle and make it everyone's favourite.
                    Reply With Quote
                    Reply
                    Quick Reply

                    Sponsored Links
                    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

                    Forum Jump


                    All times are GMT -8. The time now is 6:01 PM.