Hello, everyone! I was trying to make my first ScriptBox today, since I'm years out of practice, and am currently on Winter Break. I'm using XSE, as I figured it would be better to learn with a tool that is widely regarded as one of the better tools. I didn't compile anything yet, because there's a specific area where problems are bound to occur.
Spoiler:#dynamic 0x802367
#org @start
applymovement 0x4 @move
applymovement 0xFF @move1
waitmovement 0x0
trainerbattle 0x0 0x011 0x0 @intro @speak
msgbox @afterbattle 0x6
fadescreen 0x1
hidesprite 0x8
setflag 0x750
fadescreen 0x0
setvar 0x5001 0x1
release
end
#org @move
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xfe
#org @move1
#raw 0x0
#raw 0xfe
#org @intro
= Oh, it's you, [player]! You've grown up!\nI've heard a lot of things; care\lto prove them?
#org @speak
= Hm, you're better than I thought.
#org @afterbattle
= Well, [player], it's been a long\ntime. Your big bro has been\lworking hard in HOENN, but decided\lto visit to try and raise a\lpartner all the way since its\lEGG. I saw [rival] here earlier; I\lthink BROCK was defeated by them.\lAre you gonna let that happen? I'd\lbetter leave you to your training.\lGood luck, [player]!
Basically, what is supposed to happen is that the Person Event ID #4 moves down three spaces when the player steps on the ScriptBox, and commence a Trainer Battle, before saying something and leaving via fading screen and fading it back in. However, I'm struggling to figure out how to prevent the player from moving after the battle, as the player can move after the battle. The player needs to initiate Person Event ID #4 in order to make them disappear; how can I just have the script go on automatically with the textbox @afterbattle?
Use trainerbattle 0x1 instead of 0x0. This allows for an added pointer after the command which you can continue the script with :).