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 XSE changes offsets after compiling (https://www.pokecommunity.com/showthread.php?t=412249)

Chillaxo August 2nd, 2018 11:10 AM

XSE changes offsets after compiling
 
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.

BirdstarCat13 August 2nd, 2018 4:49 PM

Try removing the freespace command.

Zeturic August 2nd, 2018 5:28 PM

This is standard gba memory mapping. The ROM offset 0x108A904 is mapped as memory address 0x908A904. There's nothing incorrect about that.

Chillaxo August 2nd, 2018 11:45 PM

Quote:

Originally Posted by Sagiri (Post 9909691)
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...

chazfoot August 6th, 2018 3:21 AM

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


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.