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)

#101 2015-11-06 07:28:53

Schattenjäger
Member
Registered: 2015-10-21
Post 8/25

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

Since the Name Rater is the only thing that lets you change a pokémon's nickname, that's probably the code you need to look into. wPartyMon1OTID is loaded in the script, at least, and most likely it's for the purpose of checking whether you can change the nickname or not.

Last edited by Schattenjäger (2015-11-06 09:53:12)

Offline

#102 2015-11-08 06:37:47

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

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

Schattenjäger wrote:

Since the Name Rater is the only thing that lets you change a pokémon's nickname, that's probably the code you need to look into. wPartyMon1OTID is loaded in the script, at least, and most likely it's for the purpose of checking whether you can change the nickname or not.

wPartyMon1OTID shows up in a few different files.

core.asm
experience.asm
namerater.asm
learn_move.asm
in_game_trades.asm
cable_club.asm

I assume I only need to change it in namerater.asm

NameRaterScript_1da20: ; 1da20 (7:5a20)
    ld hl, wPartyMonOT
    ld bc, NAME_LENGTH
    ld a, [wWhichPokemon]
    call AddNTimes
    ld de, wPlayerName
    ld c, NAME_LENGTH
    call .asm_1da47
    jr c, .asm_1da52
    ld hl, wPartyMon1OTID
    ld bc, wPartyMon2 - wPartyMon1
    ld a, [wWhichPokemon]
    call AddNTimes
    ld de, wPlayerID
    ld c, $2
.asm_1da47
    ld a, [de]
    cp [hl]
    jr nz, .asm_1da52
    inc hl
    inc de
    dec c
    jr nz, .asm_1da47
    and a
    ret
.asm_1da52
    scf
    ret

Any idea where to start? I'm looking at the "ld c, $2", with the idea in my head that I might have to change 2 to something else.

Offline

#103 2015-11-08 17:42:30

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

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

It might be easier to follow like this:

IsMonRenamable:
; Return carry if mon [wWhichPokemon] can't be renamed.

    ld hl, wPartyMonOT
    ld bc, NAME_LENGTH
    ld a, [wWhichPokemon]
    call AddNTimes

    ld de, wPlayerName
    ld c, NAME_LENGTH

    call .Compare
    jr c, .no

    ld hl, wPartyMon1OTID
    ld bc, wPartyMon2 - wPartyMon1
    ld a, [wWhichPokemon]
    call AddNTimes

    ld de, wPlayerID
    ld c, 2

.Compare
    ld a, [de]
    cp [hl]
    jr nz, .no
    inc hl
    inc de
    dec c
    jr nz, .Compare

.yes
    and a
    ret

.no
    scf
    ret

It just checks whether the OT ID and name both match.

Last edited by comet (2015-11-08 17:43:26)

Offline

#104 2015-11-08 17:54:25

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

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

Looks like you could remove the check and make all Pokemon renamable by just commenting out/removing lines 63, 64, and 65 in namerater.asm (line numbers taken from your github repo).

That would remove the check, remove it loading the text for not being able to rename it, and remove the conditional jump that makes it show that text if the move wasn't renamable.

Offline

#105 2015-11-08 22:03:28

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

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

Mateo wrote:

Looks like you could remove the check and make all Pokemon renamable by just commenting out/removing lines 63, 64, and 65 in namerater.asm (line numbers taken from your github repo).

That would remove the check, remove it loading the text for not being able to rename it, and remove the conditional jump that makes it show that text if the move wasn't renamable.

Cheers! I had previously thought about removing the part where it doesn't let you rename, but didn't think it would be that easy!

Offline

#106 2016-06-08 01:54:02

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

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

Where can I change how much money you lose if you lose a battle? And is MissingNo not working due to adding new Pokemon? All I'm getting is Snorlax, Cloyster, Golduck and Electrode at levels 132 etc.

I'd also like to know if and how it would be possible to include the option to fly to the Pokemon Centre at Rock Tunnel.

Offline

#107 2016-06-15 11:34:55

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

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

bump...

Offline

#108 2016-06-15 15:03:35

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 384/434
Website

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

If you replaced the would-be-Missingno Pokemon with others you'll encounter those instead. It also depends on what your name is, you know the glitch.

The function responsible for halving the player's money on a loss is this one: https://github.com/pret/pokered/blob/bf … sm#L22-L67

Fly warp data is here (https://github.com/pret/pokered/blob/7e … _warps.asm) but there may be more to it.

Offline

#109 2016-06-17 14:38:18

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

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

Crystal_ wrote:

If you replaced the would-be-Missingno Pokemon with others you'll encounter those instead. It also depends on what your name is, you know the glitch.

The function responsible for halving the player's money on a loss is this one: https://github.com/pret/pokered/blob/bf … sm#L22-L67

Fly warp data is here (https://github.com/pret/pokered/blob/7e … _warps.asm) but there may be more to it.

Thanks. I knew where the function for the player's money was, but just had no idea which part I had to change to make you lose less money.

As for the fly warp data, I see that the options for Routes 4 and 10 are already there, but what exactly do I need to do to make it possible to fly there?

Cheers.

Offline

#110 2016-06-17 14:56:16

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 390/434
Website

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

Pretty sure wTownVisitedFlag determines where you can fly to but nothing sets the route 4 and 10 flags.

https://github.com/pret/pokered/blob/ma … 2933-L2934

Edit: You'd have to change this if you want some maps apart from towns to set a flag: https://github.com/pret/pokered/blob/bf … L3231-3239
Map constants are here: https://github.com/pret/pokered/blob/ma … stants.asm Only the first 11 flags are ever set since map id 12 is unused and anything past Route 1 is ignored. This leaves the last 2 (route 4 and route 10) to be never set during regular gameplay.

What do you want to do with the money? Lose 1/4, 1/8, a different algorithm?

Last edited by Crystal_ (2016-06-17 15:00:58)

Offline

#111 2016-06-20 03:08:06

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

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

Crystal_ wrote:

Pretty sure wTownVisitedFlag determines where you can fly to but nothing sets the route 4 and 10 flags.

https://github.com/pret/pokered/blob/ma … 2933-L2934

Edit: You'd have to change this if you want some maps apart from towns to set a flag: https://github.com/pret/pokered/blob/bf … L3231-3239
Map constants are here: https://github.com/pret/pokered/blob/ma … stants.asm Only the first 11 flags are ever set since map id 12 is unused and anything past Route 1 is ignored. This leaves the last 2 (route 4 and route 10) to be never set during regular gameplay.

I kind of understand, but I'm not sure exactly which parts to change, exactly?

Crystal_ wrote:

What do you want to do with the money? Lose 1/4, 1/8, a different algorithm?

1/4 is probably more realistic than half. I was never a fan of that in the original game.

Thanks!

Offline

#112 2016-06-21 12:21:20

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 391/434
Website

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

whenever you hit route 4 or 10 for the first time, you have to set their town visited flag if you want to be able to fly there. That's what i'd try first, but i'm just guessing. I know as much as you, really. there may be more to it so it's a matter of investigating if the first approach doesn't work.

For 1/4 you could replace the division by two with a division by 4, then substract the result to your original money by calling SubstractBCD (or however it's called).

Offline

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

Board footer

Powered by FluxBB