The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script FR "Delay" script commands (https://www.pokecommunity.com/showthread.php?t=393441)

KrustyKong May 27th, 2017 3:52 PM

FR "Delay" script commands
 
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.

Trev May 27th, 2017 4:01 PM

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.

KrustyKong May 27th, 2017 4:17 PM

Quote:

Originally Posted by Trev (Post 9659452)
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

Trev May 27th, 2017 4:23 PM

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.

KrustyKong May 27th, 2017 4:44 PM

Quote:

Originally Posted by Trev (Post 9659464)
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

Trev May 27th, 2017 4:56 PM

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.

KrustyKong May 27th, 2017 5:17 PM

Quote:

Originally Posted by Trev (Post 9659485)
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.

Trev May 27th, 2017 5:27 PM

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.

KrustyKong May 27th, 2017 6:34 PM

Ok all is well now. I actually put the @ at 0x165E26 instead of 0x8165F71. Thanks again for your help.


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


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.