The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script XSE changes offsets after compiling

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 August 2nd, 2018 (11:10 AM). Edited August 6th, 2018 by Chillaxo.
Chillaxo's Avatar
Chillaxo Chillaxo is offline
 
Join Date: Nov 2017
Posts: 8
Dear community,
I am close to despair and depression. For hours I was trying to figure out why my script wasnt working. What I finaly noticed was, that XSE is changing the offsets of my subscripts after compiling. They differ from what is displayed in the output box. I can only see these changes once I reload the script.

Info: Emerald (32 MB), applied Chacha Dinosaur's Battle Engine Upgrade, Pokemon Expansion, Items, TMs, Tutor Moves Expansion and Dizzy’s Hacked Engine.

The Script and (just) 2 examples of what's bothering me:
(All code embedded offsets are affected)
Spoiler:
#dynamic 0x108A4B0
#freespace 0xFF

#org @start
checkflag 0x23
if 0x1 goto @end1 --> compiler output: 108A904 after reopening: 908A904
checkflag 0xD3
if 0x1 goto @battle --> compiler output: 108A909 after reopening: 908A909
hidesprite 0x23
release
end

#org @end1 --> compiler output: 108A904; this one stays correct after compiling
hidesprite 0x23
release
end

#org @battle --> compiler output: 108A909; this one stays correct after compiling
lock
applymovement 0xFF @moveEX
waitmovement 0x0
fadescreen 0x1
showsprite 0x23
warp 0x0 0x13 0xFF 0x17 0x2C
fadescreen 0x0
applymovement 0x23 @movetohero
waitmovement 0x0
msgbox @text1 0x6
trainerbattle 0x1 0x287 0x0 @beforeb @afterb @laterb
release
end

#org @laterb
setflag 0x23
msgbox @textafter 0x6
giveitem 0x1DB 0x1 MSG_Obtain
msgbox @bye 0x6
applymovement 0x23 @runaway
waitmovement 0x0
hidesprite 0x23
release
end

Movements:
Spoiler:
#org @moveEX
#raw 0x56
#raw 0xFE

#org @movetohero
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @runaway
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0xFE


Strings:
Spoiler:
#org @text1
= There you are again! I'm glad to\nmeet you here. I spent the past\ldays training my Pokémon a lot.\lLet me show you how to battle like\la champ!

#org @beforeb
= Let's get it started!

#org @afterb
= Aaargh...

#org @textafter
= I can't believe that I have lost.\nI guess I still have to grow...\lbut don't worry. I will challange\lyou again. You should keep the\ltraining! Maybe this TM can help\lyou.

#org @bye
= I got to jet. See you soon!



As you can see, only the first two characters of my offsets change and only of those that are embedded in the code. Unluckily, that causes the script to point into nothingness making the script useless. I have the slight feeling that there is an easy solution to it. But I spent the last 4 hours looking for solution by experimenting, reading threads and googleing without success. Help is greatly appreciated!

EDIT: Problem is solved. It was not related to the script offsets. They are fine. Had to fix positions of OW sprites.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old August 2nd, 2018 (4:49 PM).
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Try removing the freespace command.
__________________
-------------------------
I hate signatures that are just a line of text without any clear division. You weirdos know who you are ;)
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old August 2nd, 2018 (5:28 PM).
Zeturic's Avatar
Zeturic Zeturic is offline
 
Join Date: Mar 2007
Posts: 787
This is standard gba memory mapping. The ROM offset 0x108A904 is mapped as memory address 0x908A904. There's nothing incorrect about that.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old August 2nd, 2018 (11:45 PM).
Chillaxo's Avatar
Chillaxo Chillaxo is offline
 
Join Date: Nov 2017
Posts: 8
Quote:
Originally Posted by Sagiri View Post
This is standard gba memory mapping. The ROM offset 0x108A904 is mapped as memory address 0x908A904. There's nothing incorrect about that.
Well, if that is supposed to be like that... I have again no clue why nothing is happening on script activation...
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old August 6th, 2018 (3:21 AM). Edited August 6th, 2018 by chazfoot.
chazfoot's Avatar
chazfoot chazfoot is offline
 
Join Date: Jul 2018
Location: London
Gender: Male
Posts: 63
Looking at the first few lines of script if neither flag is set then the script will simply hidesprite, release and end. Try it with either flag set and see if it works. Also you have a release command there but no lock command before it so you can probably get rid of that release command.

The hidesprite 0x23 and flag 0x23 have the same value, but the npc event flag to make them disappear isn't the same as the npc number for hidesprite. If the npc is event no. a change hidesprite 0x23 to hidesprite 0xa
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.