The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script FR "Delay" script commands

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 May 27th, 2017 (3:52 PM). Edited August 22nd, 2017 by KrustyKong.
KrustyKong's Avatar
KrustyKong KrustyKong is offline
 
Join Date: Feb 2016
Location: California
Age: 27
Gender: Female
Posts: 80
so I'm just wondering exactly how many frames each of these delay by?
#raw 0x18 = Delay1
#raw 0x19 = Delay2
#raw 0x1A = Delay3
#raw 0x1B = Delay4
#raw 0x1C = Delay5

I'm trying to make the player wait while an NPC carries out these commands:
#raw 0x10 'Step Down (Normal)
#raw 0x30 'Face Right (Delayed)
#raw 0x28 'Step on the Spot Right (Faster)

I seem to have gotten the result I wanted by making the player do these:
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0x1A 'Delay3
but I still want to know the frame counts for each because it seems they're all slightly different.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 27th, 2017 (4:01 PM).
Trev's Avatar
Trev Trev is offline
i gave you everything...
 
Join Date: May 2012
Age: 26
Gender: Male
Nature: Sassy
Posts: 1,505
You could just use waitmovement 0x0 and only put the player's movement after the NPCs if you want to make that a bit more efficient.

I think the number on each tells how many frames the player will wait for. You're waiting 13 frames, if that's the case. Don't know if you've timed it, but if it's around the length of 13 frames, that's probably right.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 27th, 2017 (4:17 PM).
KrustyKong's Avatar
KrustyKong KrustyKong is offline
 
Join Date: Feb 2016
Location: California
Age: 27
Gender: Female
Posts: 80
Quote:
Originally Posted by Trev View Post
You could just use waitmovement 0x0 and only put the player's movement after the NPCs if you want to make that a bit more efficient.

I think the number on each tells how many frames the player will wait for. You're waiting 13 frames, if that's the case. Don't know if you've timed it, but if it's around the length of 13 frames, that's probably right.
Thank you for the quick response. Is there a list of how long the other movements take? cuz it appears step on the spot is about three frames.
The reason I'm doing it like this is I'm editing existing scripts but had some trouble adding an increased number of commands than the original. Basically, an extension of my problem here https://www.pokecommunity.com/showthread.php?t=392797
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 27th, 2017 (4:23 PM).
Trev's Avatar
Trev Trev is offline
i gave you everything...
 
Join Date: May 2012
Age: 26
Gender: Male
Nature: Sassy
Posts: 1,505
If you want to add more commands to a script, you can use the #dynamic function for that. Simple replace the pointer of the script section you want to edit with @[whatevernameyouwant] and replace all reference pointers to that script with the same, and you can add as many commands as you want. When you compile, those scripts will be compiled into free space and nothing will overwrite. The original script will contain these new pointers and they'll operate in game as if they were a part of the original script.
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 27th, 2017 (4:44 PM).
KrustyKong's Avatar
KrustyKong KrustyKong is offline
 
Join Date: Feb 2016
Location: California
Age: 27
Gender: Female
Posts: 80
Quote:
Originally Posted by Trev View Post
If you want to add more commands to a script, you can use the #dynamic function for that. Simple replace the pointer of the script section you want to edit with @[whatevernameyouwant] and replace all reference pointers to that script with the same, and you can add as many commands as you want. When you compile, those scripts will be compiled into free space and nothing will overwrite. The original script will contain these new pointers and they'll operate in game as if they were a part of the original script.
I was worried about using free space because I think I read that you have to keep track of what you use for some reason. I'm not sure I understand your instructions though. Where do I put #dynamic
the original script looks like this in XSE
Quote:
'---------------
#org 0x165E26
applymovement 0x5 0x8165F71
waitmovement 0x0
applymovement MOVE_PLAYER 0x8165EB9
applymovement 0x5 0x8165FBF
waitmovement 0x0
return
would the edited one be this?
Quote:
'---------------
#dynamic 0x800000

#org @new
applymovement 0x5 0x8165F71
waitmovement 0x0
applymovement MOVE_PLAYER 0x8165EB9
applymovement 0x5 0x8165FBF
waitmovement 0x0
return
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 27th, 2017 (4:56 PM).
Trev's Avatar
Trev Trev is offline
i gave you everything...
 
Join Date: May 2012
Age: 26
Gender: Male
Nature: Sassy
Posts: 1,505
You don't need to keep track of it. Most tools nowadays do automatic free space locating, so nothing is going to overwrite itself. Besides, if you're making a hack, you HAVE to use free space. There's no way around it.

Yes, that's exactly what you should do. You don't need the "'---------------" though. Also, be sure that, when you replace the pointers, you replace all references to those pointers. So if 0x716420 (example) is referenced by another part of the script, you have to change it to your @ pointer.
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old May 27th, 2017 (5:17 PM).
KrustyKong's Avatar
KrustyKong KrustyKong is offline
 
Join Date: Feb 2016
Location: California
Age: 27
Gender: Female
Posts: 80
Quote:
Originally Posted by Trev View Post
You don't need to keep track of it. Most tools nowadays do automatic free space locating, so nothing is going to overwrite itself. Besides, if you're making a hack, you HAVE to use free space. There's no way around it.

Yes, that's exactly what you should do. You don't need the "'---------------" though. Also, be sure that, when you replace the pointers, you replace all references to those pointers. So if 0x716420 (example) is referenced by another part of the script, you have to change it to your @ pointer.
Okay I think I got it.
But for the free space thing, I'm using Mrdollsteak's ROM base and am worried that if there's ever an update, things will go wrong.
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old May 27th, 2017 (5:27 PM).
Trev's Avatar
Trev Trev is offline
i gave you everything...
 
Join Date: May 2012
Age: 26
Gender: Male
Nature: Sassy
Posts: 1,505
My advice is to set your #dynamic to 0x710000 so it'll start adding right where the used-up free space ends in vanilla FireRed (it won't overwrite anything, don't worry). Dollsteak data starts at 0x900000 and he will most likely only add things after that offset, so it's unlikely you'll reach that far and more unlikely that any of his data will overwrite your's.
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old May 27th, 2017 (6:34 PM).
KrustyKong's Avatar
KrustyKong KrustyKong is offline
 
Join Date: Feb 2016
Location: California
Age: 27
Gender: Female
Posts: 80
Ok all is well now. I actually put the @ at 0x165E26 instead of 0x8165F71. Thanks again for your help.
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:14 AM.