View Single Post
  #775    
Old June 24th, 2009, 02:29 PM
ckret2's Avatar
ckret2
usually pronounced "secret 2"
 
Join Date: Dec 2008
Location: You Are Here
Age: 23
Gender:
Nature: Rash
Send a message via AIM to ckret2
Quote:
Originally Posted by Samike360 View Post
^Whoa you figured it out? Good job, I've been working on that and I coulden't do it.

Could you possible make a tutorial about it/tell us how/pm me how? It would be much appreciated.
I think it's too short for a tutorial, so I'll just describe it here. Here's the basic code, starting at the wildbattle:

Quote:
wildbattle 0x69 0xB 0x0
special2 0x800D 0xB4
compare 0x800D 0x1
if 0x1 goto @beat
compare 0x800D 0x4
if 0x1 goto @ranaway
msgbox @caughtit 0x6
release
end

#org @ranaway
msgbox @tryagainlater 0x6
release
end

#org @beat
msgbox @youwon 0x6
setflag 0x100
release
end

#org @tryagainlater
= Maybe I'll come back later.

#org @youwon
= Yeah! I beat it!

#org @caughtit
= Well, I guess I caught it, huh?
end
(I just left in the wildbattle from my level 11 Marowak script, but this isn't the exact same script I used.) The most important part is the special2. To figure out if you won the battle or not, after the wildbattle, you have to include the line "special2 0x800D 0xB4". This checks the previous wildbattle, and stores the result of that battle in the variable 0x800D.

The next lines of code check to see how the battle ended. This condition:

compare 0x800D 0x1
if 0x1 goto @something

will check to see if you made the wild Pokémon faint. If you did make it faint, you'll be sent to @something. So, if you want to make it so that a flag is only set after you beat the Pokémon, put the setflag under @something, and the only way it'll be set is if you make the Pokémon faint. (I used 100 in the example above but I don't know whether or not 100 is a free flag, I just used it for the example. Supply your own flag as necessary.) This condition:

compare 0x800D 0x4
if 0x1 goto @something2

will check to see if you ran away from the battle. So, I put dialogue there that will only pop up if you run away.

I don't know how to check to see if you CATCH the Pokémon (compare 0x800D 0x??), so the way this script is set up, it will assume that you caught the Pokémon if you didn't faint it or run away from it; hence, the "msgbox @caughtit 0x6" beneath the other two "compare 0x800D" conditions. I know that in the actual game, there variable "compare 0x800D 0x5" is also used, but in every script it's used it's treated the same way as 0x4 is. In other words, it also says "if 0x1 goto @something2". My hypothesis is that MAYBE 0x5 means "ran away by using Roar/Teleport/Whirlwind/Pokémon Doll," but I don't know for sure yet. To be safe, you may want to put this code:

compare 0x800D 0x5
if 0x1 goto @something2

just to be on the safe side, since that's what the original game code does.

You can do a couple other tricks with this code too, so maybe I will do a tutorial on it at some point. Anyway, that should be enough explanation to get the battle to work.
__________________

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.