heyo

HEYO!

Male
Coolest side of cooldom.
Seen 6 Days Ago
Posted 1 Week Ago
92 posts
9.1 Years
EDIT: So I went back to my last backup, and it took like 6 hours but I managed to import a bunch of scripts into the game from the broken version. Those work fine...

However, since adding them, I ran into another new problem. Every time a wild battle or trainer battle starts up, the game freezes or resets. I know the scripts I added all work fine, and were imported to places in the rom where there was space. Is there any way of fixing this?

Original Post:
I haven't posted here in a LONG time........ hi

I started a new ROM hack about a month ago. First hack I've done in almost a decade. wild.
Anyways it's been going good, Ive been really really happy with how much more I can do now.

BUT, I ran into an issue. I compiled a script onto an npc in the game -- a really simple one; if flag is checked then the NPC will give you a TM. The problem was I accidentally put in the wrong line. In other words...
Instead of something like
msgbox @text2
#org @text2
I put in something like
msgbox @text2
#org @text3
The script had no text linked to it...thus, when I compiled it into the game, it screwed up.

I didn't think anything of it, so I just fixed the code and compiled that one. But now when I start the game up from BIOS, it white screens. I can get past this by loading a .sav from my VBA...but I'd really prefer the game to work on startup y'know?

I guess the question is, can I fix this? Is there any hex I can delete or rewrite that would undo this, or is it too far gone?

Would I have to redo everything from a backup? (I got lazy with backups and that'd mean I'd lose about a week of work, so oof)

I have no idea what line the code was on that broke it, or if it screwed a line up somewhere else. But if anyone has seen something like this before and knows what the repercussions are or how to fix, it would be greatly appreciated. Thanks.

Mahian23

Behold my Supreme Power!

Male
Online now
Posted 3 Hours Ago
69 posts
1.5 Years
Are you using XSE? It's not that hard,Just go to the offset you compiled it in XSE and correct it,If you are still getting problems than goto advancemap 1.92,Click the NPC where you compiled the script into.There should be an offset shown in the bottom left corner.Go to an Hex editor and jump to that offset and replace the bytes with FF.Your problem should get solved.If not,Than I hope you have a backup file which you can use or I'm sorry mate. :)
Winning an arguement with an intellegent person might be hard,but winning one with a dumb person is impossible.

Asith

Uwao

Seen 8 Hours Ago
Posted 10 Hours Ago
114 posts
310 Days
There's practically zero chance that a badly-written script would cause your game to break. Crash when the script is called sure, but permanent white screen? A successfully compiled script would never do that. Something else is going wrong here.
put in something like
msgbox @text2
#org @text3
Also, XSE would NOT let you compile a script like that. If your script has "no text linked to it" XSE (and any half-decent script editor) would tell you that and not compile. Your problem is clearly not what you think it is.

heyo

HEYO!

Male
Coolest side of cooldom.
Seen 6 Days Ago
Posted 1 Week Ago
92 posts
9.1 Years
There's practically zero chance that a badly-written script would cause your game to break. Crash when the script is called sure, but permanent white screen? A successfully compiled script would never do that. Something else is going wrong here.

Also, XSE would NOT let you compile a script like that. If your script has "no text linked to it" XSE (and any half-decent script editor) would tell you that and not compile. Your problem is clearly not what you think it is.
I was using pksvui at the time of writing that script, so it did let me compile it... that being said, I think you're right.
I ended up going back to an older backup and filling in a lot of things that I made afterwards, and I don't get the white screen anymore. BUT, now the game is resetting every time I enter a battle with a wild pokemon or trainer. I'm about to rip my hair out.
Male
Seen 4 Hours Ago
Posted 1 Week Ago
47 posts
5.9 Years
I've noticed something similar in my hack, if ever im using amap and the emulator at the same time and reloading the rom to check what I have edited, some addresses will screw up and change. Especially when I added FBI's custom wild pokemon, I go to the emulator, try the script and the game would freeze, then I check the asm routine I added for custom wild pokemon and all the values have changed out of nowhere, inexplicable, so I just re-write them and everything works fine again! Weirdest thing that has happened so much to me that now I know how to fix it. It scared me many times I have like 300+ backups, ugh!

heyo

HEYO!

Male
Coolest side of cooldom.
Seen 6 Days Ago
Posted 1 Week Ago
92 posts
9.1 Years
I've noticed something similar in my hack, if ever im using amap and the emulator at the same time and reloading the rom to check what I have edited, some addresses will screw up and change. Especially when I added FBI's custom wild pokemon, I go to the emulator, try the script and the game would freeze, then I check the asm routine I added for custom wild pokemon and all the values have changed out of nowhere, inexplicable, so I just re-write them and everything works fine again! Weirdest thing that has happened so much to me that now I know how to fix it. It scared me many times I have like 300+ backups, ugh!
I think something like this happened; I went into the hex of the version that was white-screening and for some reason the first 3 lines were goofed. I fixed those, and it doesn't white screen anymore. Afterwards, there's no audio at the game freak logo, and clicking past the title screen freezes the game. So I'm assuming there's more messed up lines in places but now I have no clue how to find them, ahahah.
Male
Seen 4 Hours Ago
Posted 1 Week Ago
47 posts
5.9 Years
I usually make a backup for the game every time I make a single script that Im not 100% sure will work, and I will test it out, once the script is perfect and works without bugs, then I delete the game I was trying it on, and insert the perfect working script into the backup I made....Also if you are making a script with asm inserts and it bugs out in the game, theres a chance the game will corrupt, idk why, but it has happened so much to me.