The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script HELP in NPC movement

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old November 12th, 2020 (12:48 AM).
MM980's Avatar
MM980 MM980 is offline
"You said you have a dream...That dream...Make it come true ! Make your wonderful dream a reality, and it will become your truth ! If anyone can, it's you !"
 
Join Date: Nov 2020
Location: Kerala,India
Age: 16
Gender: Male
Nature: Sassy
Posts: 118
HI,
First of all, thank you very much for helping...
I want an NPC to the block the way, if the player has a pokemon, the NPC will walk away, anyone have an idea in this topic?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old November 12th, 2020 (2:54 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
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.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old November 12th, 2020 (10:01 PM).
MM980's Avatar
MM980 MM980 is offline
"You said you have a dream...That dream...Make it come true ! Make your wonderful dream a reality, and it will become your truth ! If anyone can, it's you !"
 
Join Date: Nov 2020
Location: Kerala,India
Age: 16
Gender: Male
Nature: Sassy
Posts: 118
Thank you, It would be really awesome if you had a YouTube channel ☺
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:16 AM.