Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → Hacking Red Questions (Trade evolutions and adding more TMs)

#1 2015-08-23 11:20:37

megamctaco
Member
Registered: 2015-08-23
Post 1/103

Hacking Red Questions (Trade evolutions and adding more TMs)

After years of messing around, I've finally decided to actually try and make my own hack of Pokemon Red.

**EDIT** I'll be using Drenn's Pokémon Red Color Hack + Gen 2 Graphics .gbc rom instead of the original Red gb rom.

Just have a few questions:

1. Is there a way to bypass trade evolutions and make them level up evolutions instead? (eg. Haunter evolves into Gengar by leveling up instead of trading).

2. Is there a way to make every move into a TM, thus having 161 TMs? (Yes, even Splash). The 5 HMs would stay as they are.

3. On GymEdit GB, there is no way to add more Pokemon to the Gym Leaders' team. How would I go about doing that? (eg. Add Sandslash and Kabuto to Brock's team).

4. I'd like to add a pokeball with Mew inside (think Eevee in Celadon City). Either next to the truck near SS Anne or from the guy in Celadon after completing the 150 pokedex. How would I do that?

Any help would be great! I haven't had any experience in terms of hex editing and would preferably like to steer clear of that. From what I've read, this can all be done by ASM programming (correct me if I'm wrong).

Last edited by megamctaco (2015-08-23 11:37:24)

Offline

#2 2015-08-23 15:36:13

Danny-E 33
Administrator
Registered: 2012-06-09
Post 897/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

1. https://github.com/dannye/pokered-gbc/b … .asm#L1712
Just change that line to "EV_LEVEL,XX,GENGAR", where XX is the level.

2. This would proabably be challenging. TM 50 already goes up to ID FA, so if you wanted to triple the number of TMs, item IDs would have to become 16-bit.

3. https://github.com/dannye/pokered-gbc/b … s.asm#L482
Just change that line to "db $FF,12,GEODUDE,14,ONIX,XX,SANDSLASH,YY,KABUTO,0", where XX and YY are the levels for Sandslash and Kabuto.

4. If you put Mew in the dock, you need to add an object to that map (here) and write a script for when you talk to that object (here)

If you want to make the game designer give you Mew, you need to edit his already existing script here.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#3 2015-08-24 01:18:45

megamctaco
Member
Registered: 2015-08-23
Post 2/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Legend! Thanks a lot!

I try that out either tonight or tomorrow and hopefully all goes well.

As for the 161 TMs; if that's too difficult, is there a way to change the original 50 TMs to any other existing moves? Say TM24 Thunderbolt is changed to Transform instead?

Offline

#4 2015-08-24 03:26:14

Danny-E 33
Administrator
Registered: 2012-06-09
Post 898/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Yes, just edit this list.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#5 2015-08-24 07:49:51

megamctaco
Member
Registered: 2015-08-23
Post 3/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Cheers for the help!

I've managed to change the trade evolutions to level evolutions. I changed gym leader teams and replaced most of the original 50 TMs with different moves.

Any tips on how to make the item IDs 16-bit so I can have 161 TMs?

I'm trying to learn how to do most of this on my own so I don't have to be annoying and ask multiple times, but a good starting point with scripting would be a great help.

What would I need to add to make the game designer give me a Mew upon Pokedex completion?

Offline

#6 2015-08-24 22:57:35

Danny-E 33
Administrator
Registered: 2012-06-09
Post 899/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Making item IDs 16-bit could be complicated. Things that immediately come to mind that would need to be modified:
- The player's item bag, and item PC storage
- Other wram addresses for temporary storage of item IDs, like when using an item
- Map object data (data/mapObjects/) which stores item IDs for pick-up items
- Mart inventories
- Plus all the code that works with this data would need to be rewritten to handle the ID in a register pair, instead of a single register. A lot of this code is in scripts/ but not all of it.

For the game designer script, here is the original:

DirectorText: ; 487b2 (12:47b2)
    TX_ASM

    ; check pokédex
    ld hl, wPokedexOwned
    ld b, wPokedexOwnedEnd - wPokedexOwned
    call CountSetBits
    ld a, [wNumSetBits]
    cp 150
    jr nc, .CompletedDex
    ld hl, .GameDesigner
    jr .done
.CompletedDex
    ld hl, .CompletedDexText
.done
    call PrintText
    jp TextScriptEnd

The code that should handle giving the player a Mew should be immediately below ".CompletedDex"
To see how to accomplish it, you can look at how another script does it. For example, the guy from Silph Co that gives you Lapras:

SilphCo7Text1:
; lapras guy
    TX_ASM
    ld a, [wd72e]
    bit 0, a ; got lapras?
    jr z, .givelapras
    CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
    jr nz, .savedsilph
    ld hl, .LaprasGuyText
    call PrintText
    jr .done
.givelapras
    ld hl, .MeetLaprasGuyText
    call PrintText
    lb bc, LAPRAS, 15
    call GivePokemon
    jr nc, .done
    ld a, [wSimulatedJoypadStatesEnd]
    and a
    call z, WaitForTextScrollButtonPress
    call EnableAutoTextBoxDrawing
    ld hl, .HeresYourLaprasText
    call PrintText
    ld hl, wd72e
    set 0, [hl]
    jr .done
.savedsilph
    ld hl, .LaprasGuySavedText
    call PrintText
.done
    jp TextScriptEnd

So you need to call GivePokemon while b holds MEW and c holds the level that you want the player to receive. The GivePokemon function sets the carry flag when it is successful, so this script jumps to .done if the carry flag is not set (The player did not receive the Pokemon. The party and current box were full.)

If the carry flag is set (was successful), the script sets a flag and prints .HeresYourLaprasText. Specifically, it sets bit 0 of wd72e. Notice that it checks this flag at the beginning of the script. This is to avoid giving the player a Lapras every time they talk to him. You would have to do a similar thing for your script, and use an unused flag for this event. (there are a ton of them)


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#7 2015-08-29 16:47:46

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 309/437
Website

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Is there anything between Max Elixer (0x53) and HM 01 (0xC4) other than the silph scope floors? If I'm not mistaken you have over 100 usable item slots in-between. If you need 111 more TMs, you can replace the HM 01 constant with 0x55 and count the other HMs/TMs from there, although that could lead to a conflict with the silph scope floors which are somehow handled with item id's (i don't know the details).

I changed gym leader

Be careful with the hardcoded trainer moves. Normally the most recently learned moves are used by trainers by default but some bosses use special moves on their pokemon. e.g. if you replace misty's starmie with a charmeleon, you'll end up with a charmeleon that knows bubblebeam.

LoneMoves: ; 39d22 (e:5d22)
; these are used for gym leaders.
; this is not automatic! you have to write the number you want to W_LONEATTACKNO
; first. e.g., erika's script writes 4 to W_LONEATTACKNO to get mega drain,
; the fourth entry in the list.

; first byte:  pokemon in the trainer's party that gets the move
; second byte: move
; unterminated
    db 1,BIDE
    db 1,BUBBLEBEAM
    db 2,THUNDERBOLT
    db 2,MEGA_DRAIN
    db 3,TOXIC
    db 3,PSYWAVE
    db 3,FIRE_BLAST
    db 4,FISSURE

TeamMoves: ; 39d32 (e:5d32)
; these are used for elite four.
; this is automatic, based on trainer class.
; don't be confused by LoneMoves above, the two data structures are
    ; _completely_ unrelated.

; first byte: trainer (all trainers in this class have this move)
; second byte: move
; ff-terminated
    db LORELEI,BLIZZARD
    db BRUNO,FISSURE
    db AGATHA,TOXIC
    db LANCE,BARRIER
    db $FF

Offline

#8 2015-08-31 05:08:51

megamctaco
Member
Registered: 2015-08-23
Post 4/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

I haven't gotten to adding more TMs yet, but I've changed the Fighting Dojo to a Bug Gym, with Scyther or Pinsir as the prize Pokemon. Seems to be working fine, but I haven't changed the name of the gym yet.

If I could add Gen II Bug Pokemon to have some variety in that gym, that would be perfect. I think I saw a tutorial on how to add next gen Pokemon on FireRed but is there a way to do it on Red version?

Offline

#9 2015-08-31 15:35:01

Danny-E 33
Administrator
Registered: 2012-06-09
Post 900/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

If you are hex editing (it doesn't sound like you are), it is nightmareish.

If you are using pokered, click.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#10 2015-09-01 05:17:11

megamctaco
Member
Registered: 2015-08-23
Post 5/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Danny-E 33 wrote:

If you are hex editing (it doesn't sound like you are), it is nightmareish.

If you are using pokered, click.

Honestly I can't wrap my head around hex editing, and I find ASM to be easier. Thanks, I'll try that out.

Offline

#11 2015-09-03 04:18:09

megamctaco
Member
Registered: 2015-08-23
Post 6/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Well I just tried to add Leafeon but I got this error.

Untitled.png

The only two changes I couldn't do 100% like the ones shown in the "Adding Leafeon test" were main.asm and home.asm, because they're different than mine for some reason.

For example, none of this was in mine:

"     ld a,BANK(MewPicFront)
     jr z,.GotBank
     ld a,b
+    cp LEAFEON
+    ld a,BANK(LeafeonPicFront)
+    jr z,.GotBank
+    ld a,b
     cp FOSSIL_KABUTOPS
     ld a,BANK(FossilKabutopsPic)
     jr z,.GotBank"

had "RecallBank" written in mine instead, and it wasn't in the same order or line.

Last edited by megamctaco (2015-09-03 04:30:31)

Offline

#12 2015-09-03 04:37:31

Danny-E 33
Administrator
Registered: 2012-06-09
Post 901/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Well, as the error states, you do not have leafeon.png in pic/monback/ (it is probably named leafeonb.png)

Also, you do not need to edit home.asm
Since you are using the gbc hack, I have already modified that routine, which is why you see RecallBank.
The whole point of this routine, originally, is to determine which bank to look in for a Pokemon's front and back pic, based on its index number.
This makes it very hard to freely move any single Pokemon's pics between different banks.
With the changes I made to that routine, pics can be in any bank, with two conditions.
A Pokemon's front and back pic must be in the same bank, and the last line of each Pokemon's base stats file must be "db BANK(_____PicFront)" where _____PicFront is the label for that Pokemon's front pic.

As far as main.asm, you still need to delete "INCLUDE "data/baseStats/mew.asm"" and you need to add:
LeafeonPicFront::    INCBIN "pic/bmon/leafeon.pic"
LeafeonPicBack::     INCBIN "pic/monback/leafeonb.pic"
anywhere that it fits. I would put it in the same bank as some other pics, just for consistency. Note that all pics are included twice (from bmon/ and gsmon/), because the gbc project allows for you to toggle between gen I and gen II pics.

EDIT:
I think you updated your comment while I was typing mine and you changed the error screenshot.
Unknown symbol means something tried referring to "LeafeonPicBack" but that label doesn't exist anywhere.

Last edited by Danny-E 33 (2015-09-03 04:42:58)


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#13 2015-09-03 04:45:26

megamctaco
Member
Registered: 2015-08-23
Post 7/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Sorry, I realised what the error was before and I fixed it, and then I edited my previous post with a completely different error which has me stuck now.

Offline

#14 2015-09-03 04:57:09

megamctaco
Member
Registered: 2015-08-23
Post 8/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Now the error is _LeafeonDexEntry

I'm assuming it has something to do with the fact that in pokedex_entries.asm it has "; 407f6 (10:47f6)" after original Pokemon such as Growlithe, but nothing after Leafeon?

EDIT: I think I just worked it out. Forgot to add "::" after the text dex entry.

Yep, it worked. Only problem is that Leafeon now looks like a glitch block.

EDIT #2: Fixed it!

Last edited by megamctaco (2015-09-03 05:05:24)

Offline

#15 2015-09-03 06:06:15

megamctaco
Member
Registered: 2015-08-23
Post 9/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Trying to add Umbreon now by basically following the same steps. Coming up with an error saying my sprite "needs 4 colors, has 161". Any help?

Offline

#16 2015-09-03 06:27:36

Danny-E 33
Administrator
Registered: 2012-06-09
Post 902/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Exactly what it says. Use your favorite image editor (Paint, Gimp etc) and reduce the png to exactly 4 colors.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#17 2015-09-03 06:49:47

megamctaco
Member
Registered: 2015-08-23
Post 10/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Just did that and everything worked fine until I loaded the room. Bam! File data destroyed :(

EDIT: Had to start a new game. It evolves into Umbreon via Moon Stone, but immediately changes to a Flareon after the evolution (but the name stays as Umbreon).

Last edited by megamctaco (2015-09-03 06:55:52)

Offline

#18 2015-09-03 14:32:44

Danny-E 33
Administrator
Registered: 2012-06-09
Post 903/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

In your terminal, type "git diff | clip" (there will be no output on the screen, that's okay) then press ctrl+v into hastebin.com, click save and share the link.
Or just join our irc to talk about it in real time.
https://kiwiirc.com/client/irc.freenode.net/?#pret


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#19 2015-09-03 14:44:50

megamctaco
Member
Registered: 2015-08-23
Post 11/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Danny-E 33 wrote:

In your terminal, type "git diff | clip" (there will be no output on the screen, that's okay) then press ctrl+v into hastebin.com, click save and share the link.
Or just join our irc to talk about it in real time.
https://kiwiirc.com/client/irc.freenode.net/?#pret

http://hastebin.com/ujocoqekod.hs

I'll definitely join the irc tomorrow, as I'm about to go to bed. Thanks so much for the help! Much appreciated.

Edit: I managed to add Donphan, and everything works fine aside from the sprite which is all glitchy. My problem lies somewhere in the sprites I'm using, I imagine.

Last edited by megamctaco (2015-09-03 14:46:45)

Offline

#20 2015-09-03 15:54:22

Danny-E 33
Administrator
Registered: 2012-06-09
Post 904/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Okay, so I'm guessing you have never used git before. Typically, you make a few related changes, then make a 'commit' for those changes.
For example, only edit trainer parties and then make a commit named "Modify trainer parties" then add Leafeon and make a commit named "Add Leafeon" etc, instead of having a 7000 line long diff. Because look at the situation your are in now. What useful name can you give to the commit? "Change a bunch of shit"?
I also don't know how you managed to change the mode on all the files in the repo. I don't fully understand the point of file modes, I just know it's annoying to have mode changes in commits for no reason.


Anyway, the corrupt save file is unavoidable. When you add Pokemon, you increase the size of the owned/seen flag arrays in wram/sram which causes the new game to not recognize the old game's save files.

Donphan's Pokedex page is corrupted because you forgot the string terminator character (@) after "ARMOR".

As far as why Eevee evolves into Flareon immediately after evolving into Umbreon, I don't know yet. I tested it with your diff and I get the same bug. I will think on it a bit and let you know if I find out what's wrong.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#21 2015-09-04 01:32:21

megamctaco
Member
Registered: 2015-08-23
Post 12/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Danny-E 33 wrote:

Okay, so I'm guessing you have never used git before. Typically, you make a few related changes, then make a 'commit' for those changes.
For example, only edit trainer parties and then make a commit named "Modify trainer parties" then add Leafeon and make a commit named "Add Leafeon" etc, instead of having a 7000 line long diff. Because look at the situation your are in now. What useful name can you give to the commit? "Change a bunch of shit"?
I also don't know how you managed to change the mode on all the files in the repo. I don't fully understand the point of file modes, I just know it's annoying to have mode changes in commits for no reason.


Anyway, the corrupt save file is unavoidable. When you add Pokemon, you increase the size of the owned/seen flag arrays in wram/sram which causes the new game to not recognize the old game's save files.

Donphan's Pokedex page is corrupted because you forgot the string terminator character (@) after "ARMOR".

As far as why Eevee evolves into Flareon immediately after evolving into Umbreon, I don't know yet. I tested it with your diff and I get the same bug. I will think on it a bit and let you know if I find out what's wrong.

Well my only experience with ASM was 8 years ago in high school. I forgot 99% of it and I'll be the first to admit that I have no idea what I'm doing. Although I've learned a lot over the last couple of weeks thanks to this forum, the disassembly and you.

Prior to this I had no idea what git was, or anything really. I also don't know how I managed to change the mode on all the files either! Haha.

I should probably go into detail about what I ideally want for my hack.

1. Colorized overworld and gen II graphics (thanks to you and everyone involved, that is possible).
2. All 151 Pokemon available in one way or another, with some Gen II, III and IV Pokemon available.
3. All trade evolutions to be level evolutions (done, thanks!)
4. Fighting Dojo to be a Bug Gym with Scyther and Pinsir as the prize Pokemon (which may change once I add next gen Bug Pokemon).
5. 161 TMs. If this proves to be too difficult, I'll stick with what I've already done by changing the original TMs to different moves and maybe even adding new moves to the game in general.
6. New items. Eg. Sun Stone to evolve Eevee into Espeon or Ice Stone to evolve Eevee into Glaceon. Maybe even go further by adding some sort of Steel item to evolve Scyther into Scizor or a fake evolution such as Aerodactyl into Skarmory.
7. Adding new types such as Dark and Steel.
8. Running shoes and boy/girl option (I've seen it in another hack on here but can't remember which one it was).
9. Not necessary, but perhaps a day/night option.
10. Again, not necessary but changing the item bag to have different pockets like next gen games, or changing the boxes on Bill's PC to be more like next gen games.
11. Female Rockets.
12. Not necessary, but key items to replace Cut, Strength and Flash.
13. This kind of goes hand in hand with point 6, but replacing (what I think are crap) moves such as Bind with Gen II moves like Flame Wheel. Don't need new animations as I can just use Gen I animations like Ember or Flamethrower for it.

I usually work evenings, so I've got most of the day and plenty of time and patience to take as long as I want to get it done. All I need is a little help here and there. I think I'd be able to do certain things without help, such as adding Female Rockets and changing moves... hopefully.

I can't thank you enough for how much you've already helped me!

Offline

#22 2015-09-04 02:53:09

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,028/3,512

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

I wrote a tutorial on adding gender selection. You can find it here.

Offline

#23 2015-09-04 03:32:56

comet
Member
Registered: 2012-04-09
Post 598/679

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

The file mode change is because Windows doesn't have file modes. To compensate, git automatically marks the executable flag as set (+x) as well as +r+w. This behavior can be changed with git config.

Offline

#24 2015-09-04 03:56:09

megamctaco
Member
Registered: 2015-08-23
Post 13/103

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

Cheers Mateo, I'll check that out later.

I've since removed Donphan and added Umbreon and Glaceon (along with Leafeon, which I added yesterday).

Leafeon works perfectly, but my Glaceon and Umbreon have glitched sprites (both front and back). That's the only issue I'm having right now. Do the back sprites need to be 32 x 32 pixels like the others? Other than the glitched sprites, they're fine.

I'm using the sprites of Umbreon and Glaceon from Mateo's Red++ (as a test until I make my own).

EDIT: I got the sprites to work. Turns out I was missing "db BANK(GlaceonPicFront)" at the bottom of the baseStats.asm for each new Pokemon, which is strange because Leafeon had "db 0 ; padding" and the front sprite was working fine but the back sprite wasn't. Changing "db 0 ; padding" to "db BANK(LeafeonPicFront)" doesn't do anything. The front sprite still loads fine while the back sprite is a mess. Whereas Umbreon and Glaceon have both front and back sprites working perfectly now.

EDIT 2: Espeon is added and both sprites work perfectly.

Last edited by megamctaco (2015-09-04 05:54:09)

Offline

#25 2015-09-04 18:49:39

Danny-E 33
Administrator
Registered: 2012-06-09
Post 905/1,048

Re: Hacking Red Questions (Trade evolutions and adding more TMs)

megamctaco wrote:

Do the back sprites need to be 32 x 32 pixels

You're using the gbc hack, which adds gen II pics, so all back pics need to be 48x48.

megamctaco wrote:

Leafeon had "db 0 ; padding" and the front sprite was working fine

That's because you edited home.asm and I told you not to. The part you edited loads the right bank if the mon being loaded is Leafeon, but that code is unnecessary once you add BANK() to the base stats file.

megamctaco wrote:

the front sprite was working fine but the back sprite wasn't

I'm not sure why that is. It is working for me based on the diff you posted. Make sure its 48x48 pixels and in the same bank as the front pic and make sure the base stats file points to the back pic correctly.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

  • Index
  • → Help/Question
  • → Hacking Red Questions (Trade evolutions and adding more TMs)

Board footer

Powered by FluxBB