The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script [Emerald] Back wih more problems

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 April 6th, 2019 (8:02 AM). Edited April 7th, 2019 by McPaul.
McPaul's Avatar
McPaul McPaul is offline
On my way to become a controversial and hated member.
 
Join Date: Mar 2018
Location: Switzerland
Gender: Male
Posts: 286
Hey yo!
I created a script the same way I usually do, but when I compile it doen't get the way I want. Just watch:

What I wrote and compiled:

Spoiler:
'---------------
#dynamic 0xDE4030

#org @main
lockall
checkflag 0x86A
if 0x0 goto 0x8290915
checkflag 0x889
if 0x1 goto 0x829091F
checkitem 0x16A 0x1
compare LASTRESULT 0x1
if 0x1 goto 0x8290915
setanimation 0x0 LASTRESULT
bufferitem 0x0 0x16A
msgbox 0x829092C MSG_YESNO '"It's a big boulder, but an item\nm..."
compare LASTRESULT 0x0
if 0x1 goto 0x8290929
closeonkeypress
doanimation 0x28
waitstate
goto 0x8290908

'---------------
#org 0x290915
msgbox 0x82909D6 MSG_KEEPOPEN '"It's a big boulder, but an item\..."
releaseall
end

'---------------
#org 0x29091F
msgbox 0x8290A16 MSG_KEEPOPEN '"[buffer1] made it possible to move..."
releaseall
end

'---------------
#org 0x290929
closeonkeypress
releaseall
end

'---------------
#org 0x290908
setflag 0x889
msgbox 0x829098C MSG_KEEPOPEN '"[player] used [buffer1]!\p[buffer1..."
releaseall
end


'---------
' Strings
'---------
#org 0x29092C
= It's a big boulder, but an item\nmay be able to push it aside.\pWould you like to use [buffer1]?

#org 0x2909D6
= und!

#org 0x290A16
= [buffer1] made it possible to move\nboulders around.

#org 0x29098C
= [player] used [buffer1]!\p[buffer1] made it\npossible to move boulders around!


And what I get when I reopen my script:

Spoiler:
'---------------
#org 0xE3D184
lockall
checkflag 0x86A
if 0x0 goto 0x8290915
checkflag 0x889
if 0x1 goto 0x829091F
checkitem 0x16A 0x1
compare LASTRESULT 0x1
if 0x1 goto 0x8290915
setanimation 0x0 LASTRESULT
bufferitem 0x0 0x16A
msgbox 0x829092C MSG_YESNO '"It's a big boulder, but an item\nm..."
compare LASTRESULT 0x0
if 0x1 goto 0x8290929
closeonkeypress
doanimation 0x28
waitstate
goto 0x8290908

'---------------
#org 0x290915
msgbox 0x82909D6 MSG_KEEPOPEN '"und!"
releaseall
end

'---------------
#org 0x29091F
msgbox 0x8290A16 MSG_KEEPOPEN '"[buffer1] made it possible to move..."
releaseall
end

'---------------
#org 0x290929
closeonkeypress
releaseall
end

'---------------
#org 0x290908
setflag 0x889
msgbox 0x829098C MSG_KEEPOPEN '"[player] used [buffer1]!\p[buffer1..."
releaseall
end


'---------
' Strings
'---------
#org 0x29092C
= It's a big boulder, but an item\nmay be able to push it aside.\pWould you like to use [buffer1]?

#org 0x2909D6
= und!

#org 0x290A16
= [buffer1] made it possible to move\nboulders around.

#org 0x29098C
= [player] used [buffer1]!\p[buffer1] made it\npossible to move boulders around!


And I get this:

Version 14 BOULDERS ALL.png


Why's that happening? All those difficulties every time I want to do a single little thing is getting on my nerves.

Thanks for your answer.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old April 6th, 2019 (9:32 AM).
kalarie kalarie is online now
 
Join Date: Jun 2008
Posts: 760
You mean the text?

Well, you as far as I can see that is the exact text you wanted to import at #org 0x2909D6?
Otherwise, you'll have to change the text at the string.

Off topic: Binary romhacking is not going to be very easy, you'll encounter lots of stuff that will work on your nerves...
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old April 6th, 2019 (9:47 AM).
Avara's Avatar
Avara Avara is offline
 
Join Date: Dec 2011
Gender: Female
Nature: Relaxed
Posts: 1,305
From what I can see it's pretty much doing what you told it to, it just looks like you've either accidentally overwritten or deleted part of the text of that string. Don't worry, just make a new pointer to correct text and you'll be fine x
__________________
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old April 6th, 2019 (10:19 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Whenever you're editing a compiled script (one that's already in the ROM), its best to repoint everything that makes it up. You've used a dynamic pointer for the @main segment of your script, but all of the branches and text are still using static pointers. Static pointers don't care what's already there in the ROM, they just overwrite it, causing errors if your script isn't spaced out properly.

Here's a version of your script with fully dynamic pointers. You will need to do this in the future as well.

Spoiler:
#dynamic 0xDE4030

#org @main
lockall
checkflag 0x86A
if 0x0 goto @CantPush
bufferitem 0x0 0x16A
checkflag 0x889
if 0x1 goto @AlreadyUsed
compare 0x800D 0x1
if 0x1 goto @CantPush
setanimation 0x0 0x800D
bufferitem 0x0 0x16A
msgbox @UseItem 0x5
compare 0x800D 0x0
if 0x1 goto @AnswerNo
closeonkeypress
doanimation 0x28
waitstate
goto @Ending

#org @CantPush
msgbox @CantPushText 0x6
releaseall
end

#org @AlreadyUsed
msgbox @AlreadyUsedText 0x6
releaseall
end

#org @AnswerNo
closeonkeypress
releaseall
end

#org @Ending
setflag 0x889
bufferitem 0x0 0x16A
msgbox @EndingText 0x6
releaseall
end

#org @UseItem
= It's a big boulder, but an item\nmay be able to push it aside.\pWould you like to use [buffer1]?

#org @CantPushText
= It's a big boulder, but an item\nmay be able to push it aside.

#org @AlreadyUsedText
= [buffer1] made it possible to move\nboulders around.

#org @EndingText
= [player] used [buffer1]!\p[buffer1] made it\npossible to move boulders around!


Just keep using dynamic pointers rather than static ones and you should be fine. For some reason, the script kept losing the contents of [buffer1] whenever I tried testing this so I moved the bufferitem command around and added a new one towards the end. I also repaired what I thought the @CantPushText string would be, because it was broken in both of your scripts.

And yes, there is a lot of frustration in hacking, but that also goes for making a game in any medium :P
__________________
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old April 6th, 2019 (10:33 PM).
McPaul's Avatar
McPaul McPaul is offline
On my way to become a controversial and hated member.
 
Join Date: Mar 2018
Location: Switzerland
Gender: Male
Posts: 286
Thank you guys I'll try to do as you said!

So DrFuji, I did that for every script I made until then. That means a lot of thigs are now broken in my game and I'll get bad surprises in the future?
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old April 6th, 2019 (10:40 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Possibly, it depends on whether the scripts you edited became longer/ stayed the size or smaller. Hopefully there isn't too much that is overwritten, but I wouldn't be surprised if there are some errors. Any errors would probably only be confined to scripts rather than more complicated things like battles so at least they will be easy to fix.
__________________
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old April 6th, 2019 (11:07 PM).
McPaul's Avatar
McPaul McPaul is offline
On my way to become a controversial and hated member.
 
Join Date: Mar 2018
Location: Switzerland
Gender: Male
Posts: 286
Thanks a lot!
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.