View Single Post
  #7244    
Old August 22nd, 2012 (12:53 PM).
robosllim's Avatar
robosllim
Unhatched Egg
 
Join Date: Jan 2012
Gender: Male
I'm a bit new to scripting and I'm having trouble with this one.
I'm writing in XSE for a FireRed hack. The script is fired off by a trigger/"green S" tile.

What I want to happen is, after the right flags are set, have a person walk toward the player, say something, then initiate a battle. I've looked at the scripts for the Giovanni Silph Co. battle as well as the Pokemon Tower rival battle for comparison but can't see where the important differences are. My script is below (the overuse of #raw 62 is just filler from debugging).

The trigger behaves well enough before I have the flag set, so that works, at least. But once I set the flag, everything just freezes. Nobody moves, and no battle begins. I tried attaching the script to a person event, but that makes the person move without initiating the battle.

Spoiler:
Code:
'-----------------------
#org 0x8004F8
checkflag 0x1000
if 0x0 goto @end
checkflag 0x1010
if 0x1 goto @end
lock
applymovement MOVE_PLAYER 0x88004F6
applymovement 0x1 0x880036E
waitmovement 0x0
pause 0x5
msgbox 0x8800374 '"asdf..."
callstd 0x4
setvar LASTTALKED 0x1
trainerbattle 0x3 0x1 0x0 0x88003DF
msgbox 0x88003F4 '"asdf..."
callstd 0x4
closeonkeypress
fadescreen 0x1
setflag 0x1010
hidesprite 0x1
hidesprite 0x2
hidesprite 0x3
fadescreen 0x0
release
end

'-----------------------
#org @end
release
end


'-----------
' Movements
'-----------
#org 0x8004F6
#raw 62 'Exclamation Mark (!)

#org 0x80036E
#raw 62 'Exclamation Mark (!)
#raw D 'Step Up (Slow)
#raw F 'Step Right (Slow)
#raw 1 'Face Up
#raw 62 'Exclamation Mark (!)


'---------
' Strings
'---------
#org 0x800374
= asdf

#org 0x8003DF
= asdf

#org 0x8003F4
= asdf