The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Applymovement failure :(

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 September 7th, 2017 (7:24 AM). Edited September 7th, 2017 by hjk321.
hjk321's Avatar
hjk321 hjk321 is offline
 
Join Date: Sep 2017
Posts: 219
Hey, I made a script that applies movement to the player:

EDIT: Even after adding #raw 0xFE to end the movements (updated script below) it still is broken.

Spoiler:

'---------------
#org 0x71B317
countpokemon
compare LASTRESULT 0x0
if 0x1 goto 0x871B337
end

'---------------
#org 0x71B337
lock
msgbox 0x871B352 MSG_NORMAL '"OAK: Hold up!"
applymovement MOVE_PLAYER 0x871B386
msgbox 0x871B362 MSG_NORMAL '"OAK: Get a starter from me first!"
release
end


'---------
' Strings
'---------
#org 0x71B352
= OAK: Hold up!

#org 0x71B362
= OAK: Get a starter from me first!


'-----------
' Movements
'-----------
#org 0x71B386
#raw 0x23 'Step on the Spot Left (Normal)
#raw 0xFE


But upon walking on that tile the game softlocks. What am I doing wrong?

Note: this is the compiled version of the script in XSE; I used dynamic everything beforehand
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old September 7th, 2017 (7:58 AM).
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
You should have a waitmovement 0xFF after the applymovement, that might be causing your issue.
__________________

Pokeemerald Works
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old October 10th, 2017 (3:07 AM).
#Vytron's Avatar
#Vytron #Vytron is offline
Just an ordinary Romhacker
 
Join Date: Jan 2017
Location: Europe
Gender: Male
Nature: Quiet
Posts: 333
If you put this script on a green "Script" tile (in AdvanceMap) than you must add setvar (and a var number) to the script.
Like this:
'---------------
#org 0x71B317
countpokemon
compare LASTRESULT 0x0
if 0x1 goto 0x871B337
end

'---------------
#org 0x71B337
lock
msgbox 0x871B352 MSG_NORMAL '"OAK: Hold up!"
applymovement MOVE_PLAYER 0x871B386
msgbox 0x871B362 MSG_NORMAL '"OAK: Get a starter from me first!"
setvar 0xVar number 0x1 <----------------------------------------------------------------------------------------------------------------------
release
end


'---------
' Strings
'---------
#org 0x71B352
= OAK: Hold up!

#org 0x71B362
= OAK: Get a starter from me first!


'-----------
' Movements
'-----------
#org 0x71B386
#raw 0x23 'Step on the Spot Left (Normal)
#raw 0xFE
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old October 10th, 2017 (4:06 AM).
TheHanseman's Avatar
TheHanseman TheHanseman is offline
 
Join Date: Aug 2016
Location: Germany
Gender: Male
Posts: 8
You can do what Vytron said or add a 2 at var number and a 2 aat var value (at advance map)
__________________
https://media.giphy.com/media/3o7btTCiDQIRhIYJ1e/giphy.gif
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old October 11th, 2017 (10:53 AM).
Bladecraft's Avatar
Bladecraft Bladecraft is offline
It's written "Bladecraft" on my forehead.
 
Join Date: Feb 2017
Gender: Male
Nature: Calm
Posts: 83
Newbie Mistakes Alert:

1. The script you posted is complied. Posting uncompiled scripts is easier to read, to edit and to help with.
I have uncompiled your script for you, please save all your scripts before putting them in your game and post the correct ones.

Spoiler:

#org @start
countpokemon
compare LASTRESULT 0x0
if 0x1 goto @script
end

#org @script
lock
msgbox @1 0x6
applymovement 0xFF @move
msgbox @2 0x6
release
end

#org @1
= OAK: Hold up!

#org @2
= OAK: Get a starter from me first!

#org @move
#raw 0x23
#raw 0xFE

2. You should explain what type of script you're using, what's working and what's not.
Let's assume you're using an S Tile script, the green one in a-map.
If NOTHING works, including the text, that's most likely because your S Tile does not have a var.

To put it simply, when the player walks on the tile, the game checks if the var is equal to it's value. If it does, the script works, if it doesn't, it ignores them.
Search for a list of free variables for the ROM you're hacking, don't forget to set it in a different script to the correct value and then the script will work.

Other than that, the other possibility is that you've forgotten a waitmovement 0x0 line after the movement command.
Spoiler:
#org @script
lock
msgbox @1 0x6
applymovement 0xFF @move
waitmovement 0x0
msgbox @2 0x6
release
end

3. Your movement commands don't make sense.
#raw 0x23
#raw 0xFE
Make the player only to stay on his spot and look left. It doesn't deny entry in any way as the player can just keep walking after the text is finished. Change them too, but you'll realize this after testing.

4. In the case you messed up, and your script is for some reason incorrect and you'd like to edit it:
DO NOT DIRECTLY EDIT THE SCRIPT FROM THE GAME
Take your uncompiled script, edit it and recompile it.
You're taking in more space, but it's worth it so you don't overwrite something and mess up your game.

If you're hacking Emerald, in the beginning of each script write "#freespace 0xFF" so you don't overwrite anything [in XSE].
If you're hacking Fire Red, stop and hack Emerald.

Sorry for the lack of pictures, I'm pretty lazy;
[as long as you're not too annoying] Come to PokeCommunity's Discord for further help, my current nickname is "Bliz But Better".

Happy hacking.
__________________
Rule #0: Always Make a Backup




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:15 AM.