The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page NPC Character takes over from my player character...

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 February 1st, 2017 (4:33 PM). Edited February 1st, 2017 by Jehowi.
Jehowi Jehowi is offline
Your Master Superior
 
Join Date: May 2009
Location: Belgium
Age: 31
Gender:
Nature: Careful
Posts: 61
So as I was testing my rom, this happens:



So basically, after the battle my playable character freezes and the NPC right next to the character I battled takes over from him. What am I doing wrong?

This is the script of the guy I battled:


#org 0x878F28C
'-----------------------------------
checkflag 0x237
if true jump 0x878F2AC ' Flag is set
trainerbattle 0x1 0x8 0x0 0x878F2B5 0x878F2D6 0x878F2A8
end

#org 0x878F2AC
'-----------------------------------
msgbox 0x878F301 ' You might even be ab...
callstd MSG_LOCK ' Built-in lock command
end

#org 0x878F2A8
'-----------------------------------
setflag 0x237
end


#org 0x878F2B5
= Prepare to get your butt kicked!

#org 0x878F2D6
= Maybe I should try punching you\nnext time!

#org 0x878F301
= You might even be able to\nchallenge our sensei!


And this is the script of the guy right next to it. The basic idea is that I have to beat the two guys next to him first before i can challenge him, and it USED to work when I tested it outside of the cave :(

#org 0x878F3F9
'-----------------------------------
lock
faceplayer
checkflag 0x237
if true jump 0x878F40E ' Flag is set
msgbox 0x878F4EB ' My name is ANTHONY! ...
callstd MSG_LOCK ' Built-in lock command
release
end

#org 0x878F40E
'-----------------------------------
checkflag 0x238
if true jump 0x878F421 ' Flag is set
msgbox 0x878F491 ' So, you managed to b...
callstd MSG_LOCK ' Built-in lock command
release
end

#org 0x878F421
'-----------------------------------
checkflag 0x239
if true call 0x878F468 ' Flag is set
call 0x878F431
release
end

#org 0x878F468
'-----------------------------------
msgbox 0x878F57F ' I really enjoyed our...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x878F487 ' Equal To
trainerbattle 0x3 0xA 0x0 0x878F6F2
release
end

#org 0x878F487
'-----------------------------------
msgbox 0x878F6BB ' I'll be training her...
callstd MSG_LOCK ' Built-in lock command
release
end

#org 0x878F431
'-----------------------------------
trainerbattle 0x1 0xA 0x0 0x878F5BE 0x878F62C 0x878F444
return

#org 0x878F444
'-----------------------------------
checkflag 0x239
if false call 0x878F44F ' Flag is unset
release
end

#org 0x878F44F
'-----------------------------------
msgbox 0x878F642 ' You're the real deal...
callstd MSG_NOCLOSE ' Non-closing message
copyvarifnotzero 0x8000 FOCUSBAND
copyvarifnotzero 0x8001 0x1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x239
release
end


#org 0x878F4EB
= My name is ANTHONY! I'm a P1\nGrand Prix Champion from the\lKANTO region. I don't take on\lrookies. If you wish to challenge\lme, beat my pupils first!

#org 0x878F491
= So, you managed to beat one of my\npupils. Impressive. But can you\lbeat the other one too?

#org 0x878F57F
= I really enjoyed our battle. I am\nalways in for another round!

#org 0x878F6F2
= I bite the dust again.

#org 0x878F6BB
= I'll be training here for a while\nif you ever need me.

#org 0x878F5BE
= I enjoyed how you smashed my\npupils to pulp. But I'm in a\lcompletely different league.\lPrepare to be crushed!

#org 0x878F62C
= I can't believe it...

#org 0x878F642
= You're the real deal, kid. This is\na gift from me to you. May it help\lyou on your journey in the most\luncertain moments.

Truth be told, All the scripts I tested before in the hometown stop working in that cave. I also made a script where I could have a re-match with someone, and it worked fine before. So I implement it in my real game (i use backups to try my scripts first) and now all of a sudden it doesn't work anymore all of a sudden. What happens is either the game thinks that you're having two battles at once and it calls the same pokémon twice in a double battle, or it immediately freezes when I approach the trainer. I'll share that script as well, cause you never know if anyone finds what's wrong with it all of a sudden.

#dyn 0x740000
#org @begin
lock
faceplayer
trainerbattle 0x0 005 0x0 @intro @defeat
compare LASTRESULT 1
if true call @second
msgbox @afterwards
callstd msg_normal
release
end

#org @second
msgbox @yesornoquestion
callstd MSG_YESNO
compare LASTRESULT NO
if == jump @nomessage
trainerbattle 0x03 005 0x0 @loseagaintext
release
end

#org @nomessage
msgbox @nomessage1
callstd MSG_normal
release
end

#org @yesornoquestion
= Let's battle again!

#org @intro
= Get ready for the show!

#org @defeat
= Show's over...

#org @afterwards
= You outclassed me.

#org @nomessage1
= Fine. You know where to find\me!

#org @loseagaintext
= You're too strong.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old February 2nd, 2017 (4:47 AM).
Jehowi Jehowi is offline
Your Master Superior
 
Join Date: May 2009
Location: Belgium
Age: 31
Gender:
Nature: Careful
Posts: 61
Well... I completely deleted all of my events in that map and rest all the movement permissions. I then saved my file, restarted advance map, added the movement permissions and events again, and now they all work flawlessly. I have no idea why though. The scripts are all the same. So if anyone knows why it does that, feel free to enlighten me.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old February 2nd, 2017 (6:35 AM).
Squeetz's Avatar
Squeetz Squeetz is offline
ROM Hacker
 
Join Date: Jun 2013
Location: Norway
Age: 25
Gender: Male
Nature: Quiet
Posts: 236
Quote:
Originally Posted by Jehowi View Post
Well... I completely deleted all of my events in that map and rest all the movement permissions. I then saved my file, restarted advance map, added the movement permissions and events again, and now they all work flawlessly. I have no idea why though. The scripts are all the same. So if anyone knows why it does that, feel free to enlighten me.
You're using a bugged "look down" behavior for one or more of your NPCs.
You should use the first "look down", and not the second one.
__________________
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:23 AM.