Okay, I did what you said, however I encountered this error in XSE:
Error 6 "Overflow" on line 11 Wrong Parameter Type
I do not understand what I did wrong!
Anyways here is the script:
I organized, fixed, and optimized your script.
Code:
#dynamic 0x8000000 (don't know what to put here so I just put it that way)
#org @start
[B][COLOR="Red"]checkflag 0x3FFF
if b_true goto @done[/COLOR][/B]
countpokemon
compare LASTRESULT 0x2
if 0x1 goto @havepokemon
lock
applymovement [B][COLOR="Red"]0x[Sprite ID][/COLOR][/B] @faceplayer
waitmovement [B][COLOR="Red"]0x0[/COLOR][/B]
msgbox [B][COLOR="Red"]@nopassage 0x4[/COLOR][/B]
closeonkeypress
applymovement 0xFF @goleft
waitmovement [B][COLOR="Red"]0x0[/COLOR][/B]
release
end
#org @havepokemon
lock
applymovement [B][COLOR="Red"]0x[Sprite ID][/COLOR][/B] @faceplayer
waitmovement [B][COLOR="Red"]0x0[/COLOR][/B]
msgbox [B][COLOR="Red"]@gothru 0x4[/COLOR][/B]
[B][COLOR="Red"]setflag 0x3FFF[/COLOR][/B]
closeonkeypress
release
end
[B][COLOR="Red"]#org @done
lock
msgbox @gothru 0x6
release
end[/COLOR][/B]
#org @gothru
= Okay go on through.
#org @nopassage
= No pokemon? No passage!
#org @faceplayer
#raw 0x12 0xFE
#org @goleft
#raw 0x12 0x2 0xFE
I gotta tell you, there were A LOT of things wrong here.
For starters, message boxes should be written as;
msgbox @text 0x[Box Type]
NOT
msgbox 0x[boxtype] @text
Next, if you are using a compare function, you have to use 2 compares, you cant just have it say;
compare LASTRESULT 0x2
if 0x1 goto @text
if 0x0 goto @text2
It MUST be
compare LASTRESULT 0x2
if 0x1 goto @text
compare LASTRESULT 0x2
if 0x0 goto @text2
Finally, Applymovements;
When you are using an applymovent, you have to have it set up like this;
applymovement 0x[Sprite ID] @movements
You had it built like a pointer.
(The Sprite ID is the ID number of the sprite in A-Map, you can find it at the top of the RIGHT SIDE of A-Map, when you have a sprite highlighted.)
Also, waitmovement should be 0x0, until you know become a better scripter, but for now, 0x0 will work perfectly
FINALLY, if you are going to have this script on a TILE (Like step on a certain spot and it activates.) Be sure to set it up as
'Unknown 00 03'
'Var Number 40 50'
In A-Map
If this script is a Person script (Like talk to the person, and it activates)
Be sure to have the FIRST unknown thing in Advance Map, set to 03
Do all this, and that script will work perfectly.
(You will notice the script would normally repeat itself, I added an extra part to the script preventing this.)
All of the changes I made are in
BOLD RED.