The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Movement Script Not Working

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 June 23rd, 2021 (10:22 AM).
Pokeeng Pokeeng is offline
 
Join Date: Nov 2015
Gender: Male
Posts: 73
So I created a movement/battle script where the trainer and an NPC both move. The player movements work just fine but the NPC stands in place and then doesn't disappear when the battle is over. I've created similar scripts in the past and I'm very stumped. I'm hoping someone may be able to help me. I can post or PM the script if necessary. Thank you.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (10:34 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@Pokeeng

You should probably post your script and the settings for the NPC sprite and the script in AdvanceMap.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (11:13 AM).
Pokeeng Pokeeng is offline
 
Join Date: Nov 2015
Gender: Male
Posts: 73
So the person ID of the NPC is 0x1334 if I'm not mistaken. I set movement and trainer as '01'

#dynamic 0x807AFD

#org @start
lock
checkflag 0x1330
if 0x1 goto @already
msgbox @1 0x6
waitmsg
applymovement 0xFF @walk
waitmovement 0xFF
msgbox @2 0x6
applymovement 0x11 @walk1
waitmovement 0x11
applymovement 0xFF @walk2
waitmovement 0xFF
trainerbattle 0x3 0x16 0x0 @after
msgbox @3 0x6
fadescreen 0x1
setflag 0x1332
hidesprite 0x11
setflag 0x1334
fadescreen 0x0
setvar 0x4057 0x4
setflag 0x1336
release
end

#org @already
msgbox @again
trainerbattle 0x3 0x16 0x0 @after
msgbox @3 0x6
fadescreen 0x1
setflag 0x1332
hidesprite 0x11
setflag 0x1334
fadescreen 0x0
setvar 0x4057 0x4
setflag 0x1336
release
end

#org @1
= Did you really think you had won

#org @2
= I was moments away from infinitenpower.pWith Jirachi, I would have rulednthe world unopposed.pYour interference will not gonunpunished.pI will have my vengeance!

#org @after
= No.pNO.pNO!pI CANNOT LOSE!

#org @3
= Mark my words, child.pThis world will feel my wrath.pThis is not the last you will seenof me.

#org @walk
#raw 0x62
#raw 0xFE

#org @walk1
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x52
#raw 0xFE

#org @walk2
#raw 0x47
#raw 0xFE
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (11:45 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
Have you expanded the amount of flags? 0x1334 is not an available flag in the vanilla games as far as I'm aware. Where did you get the idea to use those values?

For Fire Red, check this list for where flags are used: https://github.com/pret/pokefirered/blob/master/include/constants/flags.h

For Emerald, check this list: https://github.com/pret/pokeemerald/blob/master/include/constants/flags.h
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (12:25 PM).
Pokeeng Pokeeng is offline
 
Join Date: Nov 2015
Gender: Male
Posts: 73
I've used other flags from after 1300 before. I just assumed it was fine. How bad is it?
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (12:39 PM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@Pokeeng

If you did not expand the amount of flags it can lead to completely random results, as is also stated in this thread: https://www.pokecommunity.com/showthread.php?t=302347. Long story short: no, it's not safe to use them, so you shouldn't. Instead, stay with the flags mentioned in the sources I sent before.
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (12:54 PM).
Pokeeng Pokeeng is offline
 
Join Date: Nov 2015
Gender: Male
Posts: 73
So I've always been led to believe by the sources I've used that 1200+ is safe but assuming that the issue is the script, is there anything noticeably wrong with it?
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (1:41 PM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@Pokeeng

That's why I was curious what sources you used. Because anything I've ever read about flags is to be cautious which ones to use.

Either way, you use hidesprite 0x11. So that means person event number 17 (in decimal) will be hidden. Make sure those correspondent correctly with AdvanceMap. Subsequently, make sure to use a safe flag instead of those you've used up to this point.
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old June 23rd, 2021 (1:56 PM).
Pokeeng Pokeeng is offline
 
Join Date: Nov 2015
Gender: Male
Posts: 73
I'll definitely make sure to use safe flags from here on out. This specific script is actually for the end of the game so I'm surprised I haven't encountered a single glitch in 10+ playtests. I appreciate the help, thank you so much!
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
Thread Tools

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.