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)
-   -   Other Scripting problems (https://www.pokecommunity.com/showthread.php?t=326415)

Lynker May 14th, 2014 3:38 PM

Scripting problems
 
Okay, so I have a script and it runs pretty well for one I almost completely wrote on my own. Here's the script:

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done

applymovement 0x1 @move
waitmovement 0x0
applymovement 0xFF @move2
msgbox @shoes 0x6
applymovement 0x1 @move3
waitmovement 0x0
release
end

#org @done
release
end

#org @move
#raw 0x04
#raw 0x04
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x02

#org @move2
#raw 0x02

#org @move3
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x05
#raw 0x05
#raw 0x03
#org @shoes
= Good morning, honey!\pProfessor Adler told me that he wants \lto see you in his lab.\lPut on your Running Shoes\l and head to Loyoto Village.


When the @move part happens, it works. But then instead of playing the message, the NPC then does their movement @move 3 (back to their chair). And then they face down, instead of facing right like I want them to. Then the game is stuck, even though I have the "release" and "end" at the end of the script. Why isn't it working?

And where do I put the Running Shoes offset in the script? I'm not sure on that. Thank you. :)

machomuu May 14th, 2014 3:52 PM

First off, you need to end each of your movements with 0xFE, because that's what tells the game that the movement process is over (So, for instance, in @move, you need to have 0xFE at the end of the last movement. Same for move2 and move3. Because you don't end them, the game doesn't know to continue with the script.

As for Running Shoes, IIRC you only need to set the flag (the command for which would be setflag 0x8C0) to make it so that the player can run.

Renegade May 14th, 2014 3:53 PM

Try this:

Code:

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
applymovement 0x1 @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @shoes 0x6
applymovement 0x1 @move3
waitmovement 0x0
setflag 0x82F
release
end

#org @done
release
end

#org @move
#raw 0x04
#raw 0x04
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x02
#raw 0xFE

#org @move2
#raw 0x02
#raw 0xFE

#org @move3
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x05
#raw 0x05
#raw 0x03
#raw 0xFE

#org @shoes
= Good morning, honey!\pProfessor Adler told me that he wants \lto see you in his lab.\lPut on your Running Shoes\l and head to Loyoto Village.


Remember to always use #raw 0xFE after movements or they won't work correctly. I'm also assuming you have the person events (0x1's) correct in A-Map.
The Running Shoes use flag 0x82F in Fire Red, if that's the ROM you are using.

machomuu May 14th, 2014 3:57 PM

Knowing Jabu, it'd probably be this:
Code:

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
applymovement 0x1 @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @shoes 0x6
applymovement 0x1 @move3
waitmovement 0x0
setflag 0x8C0
release
end

#org @done
release
end

#org @move
#raw 0x04
#raw 0x04
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x02
#raw 0xFE

#org @move2
#raw 0x02
#raw 0xFE

#org @move3
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x05
#raw 0x05
#raw 0x03
#raw 0xFE

#org @shoes
= Good morning, honey!\pProfessor Adler told me that he wants \lto see you in his lab.\lPut on your Running Shoes\l and head to Loyoto Village.


He's an Emerald guy, all around.

Lynker May 14th, 2014 4:21 PM

That worked! Thanks a lot. :)

Now, how would I make it so this message never plays again (And the scripts around it)? And is there a list of the fanfares anywhere?

Edit: That's weird. When I leave the town and go to the route, the Running Shoes are disabled. When I get to another town, they're re-enabled. The route is listed as a route in the Header, though. Has this happened to anyone else before?

machomuu May 14th, 2014 4:34 PM

Quote:

Originally Posted by JabuJabule (Post 8250863)
That worked! Thanks a lot. :)

Now, how would I make it so this message never plays again (And the scripts around it)? And is there a list of the fanfares anywhere?

Edit: That's weird. When I leave the town and go to the route, the Running Shoes are disabled. When I get to another town, they're re-enabled. The route is listed as a route in the Header, though. Has this happened to anyone else before?

I think there's a list of fanfares in Diego's XSE tutorial. To make sure the event doesn't play again, you need to set a flag. You already have a checkflag in place for this purpose, so you just need to do this:
Code:

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
applymovement 0x1 @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @shoes 0x6
applymovement 0x1 @move3
waitmovement 0x0
setflag 0x8C0
setflag 0x828
release
end

#org @done
release
end

#org @move
#raw 0x04
#raw 0x04
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x02
#raw 0xFE

#org @move2
#raw 0x02
#raw 0xFE

#org @move3
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x05
#raw 0x05
#raw 0x03
#raw 0xFE

#org @shoes
= Good morning, honey!\pProfessor Adler told me that he wants \lto see you in his lab.\lPut on your Running Shoes\l and head to Loyoto Village.


What that does is add a flag. With the checkflag you have in place, after the flag is set (meaning, after the script has happened once, it will check for the flag and, seeing that it is set, will go to @done (which just releases and ends, giving the illusion that the script isn't playing at all).

Lynker May 14th, 2014 4:48 PM

Quote:

Originally Posted by machomuu (Post 8250875)
I think there's a list of fanfares in Diego's XSE tutorial. To make sure the event doesn't play again, you need to set a flag. You already have a checkflag in place for this purpose, so you just need to do this:
Code:

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
applymovement 0x1 @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @shoes 0x6
applymovement 0x1 @move3
waitmovement 0x0
setflag 0x8C0
setflag 0x828
release
end

#org @done
release
end

#org @move
#raw 0x04
#raw 0x04
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x02
#raw 0xFE

#org @move2
#raw 0x02
#raw 0xFE

#org @move3
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x05
#raw 0x05
#raw 0x03
#raw 0xFE

#org @shoes
= Good morning, honey!\pProfessor Adler told me that he wants \lto see you in his lab.\lPut on your Running Shoes\l and head to Loyoto Village.


What that does is add a flag. With the checkflag you have in place, after the flag is set (meaning, after the script has happened once, it will check for the flag and, seeing that it is set, will go to @done (which just releases and ends, giving the illusion that the script isn't playing at all).

Thank you, that fixed it! Now I just need the mom to say something random afterwards. :P
Do you have any idea about the Running Shoes issue?

HidoranBlaze May 14th, 2014 5:03 PM

Quote:

Originally Posted by JabuJabule (Post 8250904)
Thank you, that fixed it! Now I just need the mom to say something random afterwards. :P
Do you have any idea about the Running Shoes issue?

That running shoes issue should not be happening if you did everything correctly. Maybe double check it? The game could be clearing the flag with a level script as well (although I have no idea how that would happen).

EDIT: nvm, if the flag was cleared, you'd have a different issue.

DOUBLE EDIT: Mind showing us a screenshot of the header tab in Advance Map?

Lynker May 14th, 2014 5:19 PM

Quote:

Originally Posted by HidoranBlaze (Post 8250930)
That running shoes issue should not be happening if you did everything correctly. Maybe double check it? The game could be clearing the flag with a level script as well (although I have no idea how that would happen).

EDIT: nvm, if the flag was cleared, you'd have a different issue.

DOUBLE EDIT: Mind showing us a screenshot of the header tab in Advance Map?

http://i100.photobucket.com/albums/m34/JabuJabule/Untitled_zpsf8a4da23.png

HidoranBlaze May 14th, 2014 5:49 PM

Umm ok I'm not seeing why your issue would occur. This is weird. Can you try doing this on a clean Emerald rom?

Lynker May 14th, 2014 7:27 PM

Quote:

Originally Posted by HidoranBlaze (Post 8251013)
Umm ok I'm not seeing why your issue would occur. This is weird. Can you try doing this on a clean Emerald rom?

Not really. I already have a lot of progress on the one I'm using.

HidoranBlaze May 14th, 2014 7:29 PM

Quote:

Originally Posted by JabuJabule (Post 8251155)
Not really. I already have a lot of progress on the one I'm using.

I'm not asking you to throw away your rom just yet. I'm saying you should test your running shoes script on a clean Emerald rom to see if the same problem occurs.

DrFuji May 14th, 2014 7:42 PM

Quote:

Originally Posted by JabuJabule (Post 8250954)

Based on what HackMew has written in this thread, I would try changing the 'Show name' to 'Show village/ city names'. Then again, if neither of those work, you could just follow the guide's steps to removing the limiter if you don't mind having Running Shoes enabled everywhere.

Lynker May 14th, 2014 8:19 PM

Quote:

Originally Posted by DrFuji (Post 8251167)
Based on what HackMew has written in this thread, I would try changing the 'Show name' to 'Show village/ city names'. Then again, if neither of those work, you could just follow the guide's steps to removing the limiter if you don't mind having Running Shoes enabled everywhere.

How odd, that fixed the problem! But I'm going to have running enabled everywhere, so thank you for the guide. :)


All times are GMT -8. The time now is 9:12 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.