Quote:
Originally Posted by spenceroone3
Code:
'-----------------------
#org 0x1667DD
lock
#raw 0x8F
call 0x80081900
killscript
#raw 0x80
compare 0x8008 0x0
if 0x1 call 0x166814
compare 0x8008 0x1
if 0x1 call 0x16681D
compare 0x8008 0x2
if 0x1 call 0x166826
compare 0x8008 0x3
if 0x1 call 0x16682F
release
end
'-----------------------
I've put that part in bold, but I don't understand exactly what to do after that.
|
The random command (8F) takes a two-byte-long number as its argument, representing the size of the number you want generated. If you put 4 as the argument, it will generate 0,1,2, or 3. Similarly if you were to put 8 it would be 0,1,2,3,4,5,6 or 7. You can't see this as the script decompiler is interpreting the 4 that is the command's argument as a call command. Really the script is like this:
Code:
#org 0x1667DD
lock
#raw 0x8F
#raw 0x04 0x00
copyvar 0x8008 0x800D
compare 0x8008 0x0
if 0x1 call 0x166814
compare 0x8008 0x1
if 0x1 call 0x16681D
compare 0x8008 0x2
if 0x1 call 0x166826
compare 0x8008 0x3
if 0x1 call 0x16682F
release
end
'-----------------------
The 04 00 bit is the argument (4) for the random command, in swapped-hex. The copyvar takes the random number that was placed in LASTRESULT (0x800D) by the random command and puts it in variable 0x8008.
__________________
FR scripter back in the day... now, check out my
Universal Pokemon Randomizer