|
There are 2 approaches you can have to this:
- Make the NPC move out of your way but still stay in that town/area
- Make the NPC walk away and not return
For the first way:
#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x211
if 0x1 goto @AlreadyTalked
countpokemon
compare 0x800d 0x1
if 0x1 goto @GotAPokemon
msgbox @t1 0x6
applymovement 0xff @mplayer
waitmovement 0x0
release
end
#org @GotAPokemon
msgbox @t2 0x6
applymovement 0x11 @m1
waitmovement 0x0
setflag 0x211
release
end
'------------
#org @t1
= Come back when you obtain\na Pokemon!
#org @t2
= Oh you have a Pokemon?\pProceed ahead.
#org @t3
= How's your Pokemon doing?
#org @m1
#raw 0x12
#raw 0x11
#raw 0x0
#raw 0xfe
#org @mplayer
#raw 0x13
#raw 0x2
#raw 0xfe
#org @AlreadyTalked
msgbox @t3 0x6
release
end
'---------------------
and you can use a "movesprite2" command in a type 03 level script (after movesprite2 goes X position then Y position) so that the NPC stays in that position always after returning to that map.
'--------------------
Second method where the NPC walks away and doesn't return (in my opinion easier method as it doesn't require a level script to keep the NPC in position):
#dynamic 0x800000
#org @start
lock
faceplayer
countpokemon
compare 0x800d 0x1
if 0x1 goto @GotAPokemon
msgbox @t1 0x6
applymovement 0xff @mplayer
waitmovement 0x0
release
end
#org @GotAPokemon
msgbox @t2 0x6
applymovement 0x11 @m1
waitmovement 0x0
hidesprite 0x11
setflag 0x211
release
end
'------------
#org @t1
= Come back when you obtain\na Pokemon!
#org @t2
= Oh you have a Pokemon?\pProceed ahead.
#org @t3
= How's your Pokemon doing?
#org @m1
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xfe
#org @mplayer
#raw 0x13
#raw 0x2
#raw 0xfe
'------------------
So, essentially, the NPC will check if you have at least one pokemon, and if you do , the NPC walks away and enables the player to progress further.
In my case I placed the npc on the left of my map and it walks away to the left if I have a Pokemon. I used (applymovement 0x11 @m1) where 0x11 is the person event number in hex (it was 17 in advance map so it is 11 in XSE).
I also used (setflag 0x211) where 211 is the person ID number in advance map. Your NPC needs to have this so it can permanently be hidden.
|