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 Battle scripting error.. (https://www.pokecommunity.com/showthread.php?t=376021)

buttjuice August 17th, 2016 2:07 AM

Battle scripting error..
 
I don't know what I'm doing wrong since I'm using practically the same script for all my battles. I changed the ID so that it is for the trainer, and the trainer exists in advanced trainer. Here it is;

Spoiler:
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x004 0x0 @before @after
msgbox @beaten 0x6
release
end

#org @before
= Hey, have you battled my brother yet?

#org @after
= And I thought I was strong..

#org @beaten
= Have you seen a pichu yet?


Once I compile it into the rom, i get this;

Spoiler:
eXtreme Script Editor v1.1.1
-------------------------------------
08-17-2016 5:51:32 AM
-------------------------------------
Opening output: C:\Users\Bryce\Desktop\yo\Pokemon - Fire Red Version (U) (V1.0).gba...
Processing input script...
1 - #DYNAMIC
> lDynamicStart = 0x800000
3 - #ORG
> lNewOffset = 0x822808
4 - (5C) - TRAINERBATTLE [+14]
> bKind = 0x0
> iIndex = 0x4
> iReserved = 0x0
> pChallenge = 0x8822821
> pDefeat = 0x8822849
5 - (0F) - MSGBOX (native) [+8]
> pText = 0x8822868
> bType = 0x6
6 - (6C) - RELEASE [+1]
7 - (02) - END [+1]
9 - #ORG
> lNewOffset = 0x822821
10 - RAW TEXT [+38]
> sText = "Hey, have you battled my brother yet?"
12 - #ORG
> lNewOffset = 0x822849
13 - RAW TEXT [+29]
> sText = "And I thought I was strong.."
15 - #ORG
> lNewOffset = 0x822868
16 - RAW TEXT [+27]
> sText = "Have you seen a pichu yet?"
-------------------------------------
DYNAMIC_OFFSET 1
> sLabel = @start
> lOffset = 0x822808
DYNAMIC_OFFSET 2
> sLabel = @before
> lOffset = 0x822821
DYNAMIC_OFFSET 3
> sLabel = @after
> lOffset = 0x822849
DYNAMIC_OFFSET 4
> sLabel = @beaten
> lOffset = 0x822868
-------------------------------------
Cleaning up...
Closing output...
Finished processing input in 0.004 seconds.


Which to me says it's working, but I guess I could be wrong? I hit copy and get the script offset 822808. Once I hit "open script" in advance map, this is the script it shows me.

Spoiler:
'---------------
#org 0x822808


so uh, whats going on?

Obermarschall August 17th, 2016 3:24 AM

But does it work in your hack?
Usually mine does that too, however it works.
I guess it's the game who gives a static offset once it is compiled and added in the game. Because the dynamic offset searches for the next free space and thats then the result :) Correct me if I'm wrong!

buttjuice August 17th, 2016 3:30 AM

Quote:

Originally Posted by Obermarschall (Post 9371142)
But does it work in your hack?
Usually mine does that too, however it works.
I guess it's the game who gives a static offset once it is compiled and added in the game. Because the dynamic offset searches for the next free space and thats then the result :) Correct me if I'm wrong!

I don't believe it works because the scripts that usually work look more like this when I click "open script"
Spoiler:
'---------------
#org 0x1C696D
trainerbattle 0x0 0x2 0x0 0x81C6986 0x81C69A1
msgbox 0x81C69BC MSG_NORMAL '"Hmph.. Maybe my sister will beat y..."
release
end


'---------
' Strings
'---------
#org 0x1C6986
= Have you seen my sister?

#org 0x1C69A1
= Wow, you kicked my butt.

#org 0x1C69BC
= Hmph.. Maybe my sister will beat you!


It seems like it pretty much deletes my script which is so strange. I'll try and see if it works in game, though!

buttjuice August 17th, 2016 3:36 AM

Okay, that's extremely weird. I deleted the event, because I noticed that the characters OW sprite wasn't the same as the one in advance map, and she's still there? Must be a complete glitch..but I don't really want to remap..

Good thing I have a backup that was not too far back. Still, wondering how I got that glitch? Has this happened to anybody before?

Obermarschall August 17th, 2016 3:45 AM

Ah ok I see your point.
I had this once. Could it be that you compiled it with a copy of your rom? Or a backup version but you accidently opened another rom in advance map?

buttjuice August 17th, 2016 4:07 AM

Quote:

Originally Posted by Obermarschall (Post 9371153)
Ah ok I see your point.
I had this once. Could it be that you compiled it with a copy of your rom? Or a backup version but you accidently opened another rom in advance map?

I wish that was the case :/ but no biggie, im almost caught up. Just hate having to reinsert tiles.

Obermarschall August 17th, 2016 4:19 AM

Too bad I hope someone else knows a solution to that :/

buttjuice August 17th, 2016 4:54 AM

It seems when I added new tiles that my new scripts were no longer working. Anybody know if they actually correlate?

So, it seems the tiles were overwriting the scripts or something. I had to specify the search between 710000 and 0xFFFFFF when I inserted the tiles, and repointed them and now am all good. :D

JakkJames August 22nd, 2016 6:48 AM

I had this same problem with scripting. Try doing it like ;
$00822808
Then when you open the script using XSE it should appear as your own custom script. Make sure you put 2 x 0's infront of your offset.


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