Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-02-16 17:54:34

ElectrikeInc
Member
Registered: 2012-02-14
Post 11/120

Recovering Lost Scripts

I learned on Bulbapedia that there is a script left over in the game to fight a Level 40 Entei without it roaming. I would like this to be in my hack, but I don't know how to recover it. Since Mateo used the lost girl script in the Christmas hack, I think that he recovered it (unless he just rewrote the script or something). Please help me, and explain how as if I don't have any knowledge of hex editing, because I don't.


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#2 2012-02-16 18:14:52

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,218/3,456

Re: Recovering Lost Scripts

I used the original text in the Christmas Hack, but the script itself did not seem to be around anymore so I re-wrote one. However the script for Entei is still there, and all you would have to do is have an event call it. I think you might do better to just recreate that event as standing Pokemon events are not hard to make (there is a tutorial on it here) and I think the beta script doesn't actually set a flag as part of its script, so you would be able to access it again and again and there is not room to add setting a flag at the end without repointing it and remaking it anyway. Hope this helped.

Offline

#3 2012-02-16 18:45:49

ElectrikeInc
Member
Registered: 2012-02-14
Post 12/120

Re: Recovering Lost Scripts

Thanks! I'm going to go look for the tutorial you mentioned, and I'm glad that you mentioned the lack of a flag so that I wouldn't try to activate it and make it permanent. That helped a lot.


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#4 2012-02-16 23:44:59

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,219/3,456

Re: Recovering Lost Scripts

Glad I could help, and hope it works out like you want it to!

Offline

#5 2012-02-17 00:57:37

ElectrikeInc
Member
Registered: 2012-02-14
Post 14/120

Re: Recovering Lost Scripts

Edit: I think I found the tutorial you meant.

Mateo wrote:

83-PlayPokemonCry
XX-PokemonNumber
00-Part of cry code
47-LoadFont
4C-LoadText
XXXX-Pointer (2-byte) to text for Pokemon
53-CloseTextbox
49-UnloadFont
67-SetLastPersonTalkedTo
FF-None
1E-SetTypeOfFight
03-SetTypeOfFight
XX-TYpe(See list)
5C-LoadPokemonData
XX-Pokemon
YY-Level
5E-StartBattle
5F-ReloadMap/Return to PC is lost
33-BitTable1Set
XXXX-BitFlag to set
6D-HidePerson
XX-PersonEvent (Goldmap person number + 1)
90-EndOfScript

Is it possible to cut out the text part and cut straight to the battle? Otherwise, what would a 2-byte pointer to Red's script be? I don't want Entei to say anything, and Red just has a bunch of elipses. Other than the Xs, are either of the following correct?

8324400474CXXXX534967FF1E03095C244405E5F33XXXX6DXX90

Am I supposed to put line breaks, or were those just there for your tutorial?

832440067FF1E03095C244405E5F33XXXX6DXX90

That is what it would be without any text, correct?
For the other Xs that I didn't fill out - I have Goldmap, but I am not sure what the person number is. Is it the image part, so Entei's plus 1 would be 131? Would it be 0131, or does the number of digits not matter? Next, what BitFlag do I set? A BitFlag is a flag to make the Entei go away, right? Finally, how do I insert it into my ROM? I am fine with replacing another event, I just don't know how to do it.

Last edited by ElectrikeInc (2012-02-18 02:45:38)


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#6 2012-02-18 19:13:54

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,222/3,456

Re: Recovering Lost Scripts

It would not be the image part, it would be in the name part of the person dialog that pops up. It would say Person 1 or Person 3 etc depending on which person you clicked on to edit. So if you were editing Person 3, you would put 04 in the script.

Also, you are correct in that you do not have to make it show text if you don't want to. The original text for Entei just said "ENTEI: Bufufu!" or something like that, similar to how Ho-oh says "HO-OH: Shaoo!" and Lugia says "LUGIA: Gyaaas!" when you battle them. But they don't have to say anything and you can remove that part.

Also, right you do not have to put line breaks. They are only there so I could document each command in a pseudo-language style to make it easier to understand.

Offline

#7 2012-02-18 21:15:04

Tauwasser
Member
Registered: 2010-10-16
Post 258/447

Re: Recovering Lost Scripts

You might want to review your knowledge of hexadecimal and hex editors in general, seeing as you put 244 in your raw byte script for the Pokémon number...

cYa,

Tauwasser

Offline

#8 2012-02-18 21:21:31

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,223/3,456

Re: Recovering Lost Scripts

^Good catch. I only glanced over the raw script he posted and didn't notice that. Thanks for pointing that out for him.

Offline

#9 2012-02-19 00:32:17

ElectrikeInc
Member
Registered: 2012-02-14
Post 22/120

Re: Recovering Lost Scripts

ElectrikeInc wrote:

I learned on Bulbapedia that there is a script left over in the game to fight a Level 40 Entei without it roaming. I would like this to be in my hack, but I don't know how to recover it. Since Mateo used the lost girl script in the Christmas hack, I think that he recovered it (unless he just rewrote the script or something). Please help me, and explain how as if I don't have any knowledge of hex editing, because I don't.

Thank you, Tauwasser, but I said why I put 244 in the first post - I don't know what the hex version of Entei is. It would really be nice to say what Entei should be, since this is a help thread. Can you please link to a page with all of the hex codes for Pokemon? I could only find one for Red and Blue. And Mateo, what about the flag? Are there any that won't effect any other events in the game? I would be very happy if you gave a few examples. Thank you both for helping.
Edit: I think I just learned something about Hex! Is Entei F3? I think the code would be this, then, right?

832440067FF1E03095CF3405E5F33XXXX6DXX90

In Goldmap, which one is the person number? I'm just going to post all of the possible codes I can:
Picture Number: 832440067FF1E03095CF3405E5F334C006D13190
Facing: 832440067FF1E03095CF3405E5F334C006D2390
Movement: 832440067FF1E03095CF3405E5F334C006D0190 or 832440067FF1E03095CF3405E5F334C006D190
Function: 832440067FF1E03095CF3405E5F334C006D14590
Text Block: 832440067FF1E03095CF3405E5F334C006D1990
Text Bank: 832440067FF1E03095CF3405E5F334C006D4190
Was I at least looking at the correct screen?
Edit: I just found a list of flags in Gold and Silver, and it says that 4C00 is unused. I added it to the other codes; if that is incorrect, please just tell me!

Last edited by ElectrikeInc (2012-02-19 01:04:13)


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#10 2012-02-19 05:45:43

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,227/3,456

Re: Recovering Lost Scripts

58168766.png

EDIT: Also, to find any pokemon's value in hex, take his number and type it into windows calculator. Then change it to Hex instead of Dec and it will show its value in Hex instead of Decimal.
In order to switch between Hex and Decimal, you will have to change the calculator to Scientific (Windows XP) or Programming (Windows 7).

Last edited by Mateo (2012-02-19 05:47:56)

Offline

#11 2012-02-19 08:00:01

Miksy91
Member
Registered: 2010-10-16
Post 786/2,305

Re: Recovering Lost Scripts

"4200 = Violet City
4300 = Azalea Town
4400 = Cianwood City
4500 = Goldenrod City
4600 = Olivine City
4700 = Ecruteak City
4800 = Mahogany Town
4900 = Lake of Rage
4A00 = Blackthorn City
4B00 = Silver Cave
4C00 = Unused"

These are actually bit numbers of Bittable 2 and determine whether a place can be flown to or not so you can't use it in this occasion because person's flag is loaded with a bit from Bittable 1 (with most of the other stuff too). Table 1 follows the table 2 in KBM's thread where I assume you picked up "4C00 is unused".

Anyway, there should be a plenty of unused flags (or bit numbers) out there but I wouldn't use them if I wasn't sure they are unused. In special cases like this one, you could probably just take out a hidden item somewhere in the game and use its flag.

Relating to Mateo's comment, you could also look for Giegue's Master Hacking Compendium (I think that's what it's called) and make a .txt file in your PC with all the pokemon and their hexadecimal numbers that way. I often look for it myself when I for example want to change the pokemon of a new trainer I added in the game.

Last edited by Miksy91 (2012-02-19 08:01:00)

Offline

#12 2012-02-19 08:05:30

stag019
Idea Killer
Registered: 2011-01-05
Post 140/630

Re: Recovering Lost Scripts

It's right here. Read the thread to see where it mentions outdated or incorrect stuff. Also, I never got around to rewriting it, and I really should.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#13 2012-02-19 17:41:34

ElectrikeInc
Member
Registered: 2012-02-14
Post 27/120

Re: Recovering Lost Scripts

I made a new code! It uses 04 for the people number, C400 for the flag, and says F3 in one and F4 in the other, because if the thread was correct it's F4, and if I was correct it's F3.
83F40067FF1E03095CF4405E5F33C4006D0490
83F30067FF1E03095CF3405E5F33C4006D0490
Doesn't something need to say "if flag C400 is false?" Otherwise, couldn't anyone battle Entei as many times as they want?

Last edited by ElectrikeInc (2012-02-19 17:42:07)


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#14 2012-02-19 17:47:44

Tauwasser
Member
Registered: 2010-10-16
Post 260/447

Re: Recovering Lost Scripts

Hmm, I never noticed that 0x004C is unused, but you seem to be correct.

There is one unused used entry 0x1B in the fly table, which leads to a room inside the S.S. Aqua (which should be used when you faint during battle there). Were it used on as a fly destination, it would be assigned bit2 of D9F1, which incidentally goes unused in the bit table map. 0x004C actually checks bit3 of D9F1. So it seems you could actually salvage it for an actual fly location if you wanted to, since the maps would work with its ID number. Fly table entry 0x1C points to the end of the table, which is curiously some 0xFF bytes instead of some code, as if there used to be something.

I might need to change my documentation on that :P

cYa,

Tauwasser

Last edited by Tauwasser (2012-02-19 17:53:48)

Offline

#15 2012-02-19 17:52:00

ElectrikeInc
Member
Registered: 2012-02-14
Post 29/120

Re: Recovering Lost Scripts

This thread was actually about recovering or recreating a specific lost script (see the first post). Thank you for telling about a lost Fly script, but it is kind of irrelevant to the subject of a standing Entei script somewhere in the game.


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#16 2012-02-19 18:05:54

Tauwasser
Member
Registered: 2010-10-16
Post 261/447

Re: Recovering Lost Scripts

What do you mean by recovering it anyway?

The script is located at 0x109428 in Gold (NA) v1.0. It's pretty bare-bones, anyway:

47 - Load Font
4C 63 54 - Text Box
83 F4 00 - Entei's cry
53 - Close text box
49 - Load Sprites
5C F4 28 - Load Entei at Level 40
5E - Commence battle
06 02 3D 54 - If Entei was not caught: jump to not_caught
Caught:
6D 04 - Hide Entei Sprite
5F - Return from battle
90 - Return

not_caught:
5F - Return from battle
6D 04 - Hide Entei Sprite
90 - Return

I'm actually not sure what status code 0x02 is after battle, but this seems to make the most sense. So you happen to see it for a short moment if you did not catch it. Determining where some status code came from in battle is a mess, but it will be figured out eventually...

As you can see from the people ID, this is inside a room with other events. Likely the cave in the final version, which then got redesigned to do a trigger script instead.

cYa,

Tauwasser

Last edited by Tauwasser (2012-02-19 18:41:19)

Offline

#17 2012-02-19 18:13:34

Miksy91
Member
Registered: 2010-10-16
Post 790/2,305

Re: Recovering Lost Scripts

I've never thought about "when to hide the event" according to whether you catch the fought pokemon or not.
I've always done it the "Caught" way.

I think that's sort a bug in my hack but, nah... :D

Offline

#18 2012-02-19 18:41:32

ElectrikeInc
Member
Registered: 2012-02-14
Post 30/120

Re: Recovering Lost Scripts

Tauwasser wrote:

What do you mean by recovering it anyway?

The script is located at 0x109428 in Gold (NA) v1.0. It's pretty bare-bones, anyway:

47 - Load Font
4C 63 54 - Text Box
83 F4 00 - Entei's cry
53 - Close text box
49 - Load Sprites
5C F4 28 - Load Entei at Level 40
5E - Commence battle
06 02 3D 54 - If Entei was not caught: jump to not_caught
Caught:
6D 04 - Hide Entei Sprite
5F - Return from battle
90 - Return

not_caught:
5F - Return from battle
6D 04 - Hide Entei Sprite
90 - Return

I'm actually not sure what status code 0x02 is after battle, but this seems to make the most sense. So you happen to see it for a short moment if you did not catch it. Determining where some status code came from in battle is a mess, but it will be figured out eventually...

cYa,

Tauwasser

Wow. How do I make Caught and not_caught appear in the script? I could just use that code now that you posted it. Thank you so much!


I haven't been on this site for a very long time. Sorry about that! >.<
I am probably not going to get very far in the ROM projects that I've started, at least until I get more experience hacking, so I apologize.

Offline

#19 2012-02-19 18:45:14

442/700

Re: Recovering Lost Scripts

Tauwasser wrote:

What do you mean by recovering it anyway?

The script is located at 0x109428 in Gold (NA) v1.0. It's pretty bare-bones, anyway:

47 - Load Font
4C 63 54 - Text Box
83 F4 00 - Entei's cry
53 - Close text box
49 - Load Sprites
5C F4 28 - Load Entei at Level 40
5E - Commence battle
06 02 3D 54 - If Entei was not caught: jump to not_caught
Caught:
6D 04 - Hide Entei Sprite
5F - Return from battle
90 - Return

not_caught:
5F - Return from battle
6D 04 - Hide Entei Sprite
90 - Return

I'm actually not sure what status code 0x02 is after battle, but this seems to make the most sense. So you happen to see it for a short moment if you did not catch it.

Something similar (but more complete) happens with Sudowoodo, who jumps away after battle if not caught. Maybe status 2 means the player fled? Too lazy to check right now.

; …
5C B9 14 ; Load Sudowoodo at level 20
5E ; commence battle
33 2a 00 ; set bit
06 02 e9 61 ; if Sudowoodo not caught, go to not_caught
6d 04 ; hide Sudowoodo sprite
6c 04  26 ; write to variable sprite ram (why?)
5f ; return from battle
90 ; return

not_caught:
5f ; return from battle
68 04 1e 63 ; move Sudowoodo via moving_data
6d 04 ; hide Sudowoodo sprite
6c 04 26 ; write to variable sprite ram
0f 5d 00 ; “Interpret script header scripts of type 04 in part2 and load sprite tiles anew”
90 ; return

moving_data:
35 35 47 ; jump quickly north twice

Unrelated: I’m pretty sure that defense needs to be 0xA as well for shinies (reference). From the compendium:

Shiny status of:

-          Attack = 2,3,6,7,A,B, E or F
-          Initiative and special are A
-          Defense is redundant

Board footer

Powered by FluxBB