Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-11-06 04:11:13

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

Give Mew

I'm trying to make it so the Director in Celadon Mansion gives you a Mew upon completion of the Pokedex.

Messing around with the Lapras guy script, I tested it out on the Programmer, and it worked fine. I'm just a bit confused as to where I put things for the Director's script.

This is a rough idea of what I used to test it on the Programmer:

TX_ASM
    ld a, [wd72e]
    and a ; got mew?
    jr z, .givemew
.givemew
    ld hl, .MeetMewGuyText
    call PrintText
    lb bc, MEW, 5
    call GivePokemon
    jr nc, .done
    ld a, [wSimulatedJoypadStatesEnd]
    and a
    call z, WaitForTextScrollButtonPress
    call EnableAutoTextBoxDrawing
    ld hl, .HeresYourMewText
    call PrintText
    ld hl, wd72e
    set 0, [hl]
    jr .done
.done
    jp TextScriptEnd
    
.MeetMewGuyText
    TX_FAR _MeetMewGuyText
    db "@"

.HeresYourMewText
    TX_FAR _HeresYourMewText
    db "@"

Now the Director has two scripts.

The first being:

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

and the second being:

.CompletedDexText
    TX_FAR _CompletedDexText
    db $6
    TX_ASM
    callab DisplayDiploma
    ld a, $1
    ld [wDoNotWaitForButtonPressAfterDisplayingText], a
    jp TextScriptEnd

Where would I put/reference the Give Mew routine? I assume it would be somewhere before "jp TextScriptEnd" but I'm not entirely confident about that.

Offline

#2 2015-11-08 21:48:53

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

Re: Give Mew

Bump.

Offline

#3 2015-11-10 10:18:04

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

Re: Give Mew

No ideas??

Offline

#4 2015-11-10 13:39:27

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 338/435
Website

Re: Give Mew

put it after  ld [wDoNotWaitForButtonPressAfterDisplayingText], a

Offline

#5 2015-11-11 00:59:14

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

Re: Give Mew

Crystal_ wrote:

put it after  ld [wDoNotWaitForButtonPressAfterDisplayingText], a

When I did that, it kept freezing after showing the diploma.

Right now, I've taken the diploma out completely (as I always thought it was pretty useless).

Now if you have completed your Pokedex, he'll just give you a Mew.

My problem now is that this keeps repeating and he can give you a Mew over and over again. How do I stop that?

scripts/celadonmansion3.asm

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

.GameDesigner ; 487d0 (12:47d0)
    TX_FAR _GameDesignerText
    db "@"

.CompletedDexText
    TX_FAR _CompletedDexText
    db $6
    TX_ASM
    ld a, [wd72e]
    and a ; got mew?
    jr z, .givemew
.givemew
    ld hl, .MeetMewGuyText
    call PrintText
    lb bc, MEW, 5
    call GivePokemon
    jr nc, .done
    ld a, [wSimulatedJoypadStatesEnd]
    and a
    call z, WaitForTextScrollButtonPress
    call EnableAutoTextBoxDrawing
    ld hl, .HeresYourMewText
    call PrintText
    ld hl, wd72e
    set 0, [hl]
    jp TextScriptEnd
    
.MeetMewGuyText
    TX_FAR _MeetMewGuyText
    db "@"

.HeresYourMewText
    TX_FAR _HeresYourMewText
    db "@"
    jp TextScriptEnd

text/celadon_mansion_3f.asm

_MeetMewGuyText:: 
   text "For completing"
   line "your #DEX..."
   cont "I have a surprise"
   
   para "Here is one last"
   line "#MON as a reward!"
   done
   
_HeresYourMewText::
   text "MEW can learn"
   line "every single move!"
   cont "Many believe it"
   cont "is the ancestor"
   cont "of all #MON!"
   done

Offline

#6 2015-11-11 01:09:57

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

Re: Give Mew

Take a look at the rematch/phone call thread, I explained how to make events only run once over there.

Offline

#7 2015-11-11 02:03:41

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

Re: Give Mew

Mateo wrote:

Take a look at the rematch/phone call thread, I explained how to make events only run once over there.

Would that be any of these?

PewterPhoneCall:
ld hl, wPhoneCallFlags ; something you would add to mark special event phone calls having already happened
bit 1, [hl] ; check to see if this call has already happened
ret nz ; if it has already happened, don't run it again

ld a, [wObtainedBadges] ; variables that stores which badges you have
bit 0,a ; check to see if you have beaten Brock
ret z ; if you haven't, don't do the phone call yet

ld hl,wPhoneCallFlags ; address with your special call flags that we checked earlier
set 1,[hl] ; mark you as having received that call
ret ; we're done, so go back to the rest of the scripts in the header

Last edited by megamctaco (2015-11-11 02:03:57)

Offline

#8 2015-11-11 03:36:15

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

Re: Give Mew

Nevermind, worked it out after much trial and error.

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

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

.GameDesigner ; 487d0 (12:47d0)
    TX_FAR _GameDesignerText
    db "@"

.CompletedDexText
    TX_FAR _CompletedDexText
    db $6
    TX_ASM
    ld a, [wd72e]
    and a ; got mew?
    jr z, .givemew
.givemew
    ld hl, .MeetMewGuyText
    call PrintText
    call z, WaitForTextScrollButtonPress
    lb bc, MEW, 5
    call GivePokemon
    ld a, [wSimulatedJoypadStatesEnd]
    and a
    call z, WaitForTextScrollButtonPress
    call EnableAutoTextBoxDrawing
    ld hl, .HeresYourMewText
    call PrintText
    ld hl, wd72e
    set 0, [hl]
    jr z, .gotmew
.gotmew
    ld hl, .GaveMewText
    call PrintText
       jp TextScriptEnd
    
.GaveMewText
    TX_FAR _GaveMewText
    db $6
    TX_ASM
    callab DisplayDiploma
    ld a, $1
    ld [wDoNotWaitForButtonPressAfterDisplayingText], a
    jp TextScriptEnd    
    
.MeetMewGuyText
    TX_FAR _MeetMewGuyText
    db "@"

.HeresYourMewText
    TX_FAR _HeresYourMewText
    db "@"
    jp TextScriptEnd

Turns out I just had to add "jr nz, .gotmew" to

cp 150
    jr nz, .gotmew
    jr nc, .CompletedDex
    ld hl, .GameDesigner
    jr .done

Offline

#9 2015-11-11 03:48:44

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

Re: Give Mew

Okay, seems I've ran into some more trouble.

Since I've added more Pokemon, making it a total of 163 obtainable, I tried to change it so Mew is given to you when you have caught 162 Pokemon. However, when I change it to more than 150, it skips right ahead to the "Congratulations on completing your Pokedex" text and displaying the diploma, even though that's not the case.

The only way it works is if it is set to 150. What's the fix for this?

Offline

#10 2015-11-11 04:25:35

Fotomac
Member
Registered: 2015-10-25
Post 65/297

Re: Give Mew

Speaking of Mew, I'm actually thinking of including an homage to the Mew glitch in my own hack. Specifically, after you beat the Swimmer in Cerulean Gym, after a set number of steps, you'll have a random wild encounter with Mew, and unless you're in a house, a Pokémon Center, or a Poké Mart, the whole map becomes like a less strong version of the Cave Tile Effect, i.e. every step has a chance of summoning wild Pokemon, only the appearances will be far less frequent and every wild encounter not in tall grass or water or cave will be a Lv. 5 Mew, which will not stop bothering you even if you defeat it in combat until you capture it successfully.

Or would there be a better way to go about this Mew glitch homage? (Do keep in mind that you can do the Mew glitch as it's traditionally performed as early as Cerulean City in the actual games.)

Offline

#11 2015-11-11 04:38:16

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

Re: Give Mew

megamctaco wrote:

Okay, seems I've ran into some more trouble.

Since I've added more Pokemon, making it a total of 163 obtainable, I tried to change it so Mew is given to you when you have caught 162 Pokemon. However, when I change it to more than 150, it skips right ahead to the "Congratulations on completing your Pokedex" text and displaying the diploma, even though that's not the case.

The only way it works is if it is set to 150. What's the fix for this?

You put jr nz right after the check. That means if it isn't exactly 150 caught, it jumps to Mew. You should have added the part about giving Mew in the "completed dex" part. The way its written, it should jump to mew no matter how many Pokémon you have, unless it is exactly the same number you checked for.

I'll try to explain how to properly do it when I'm on my computer, I hate typing anything longer tgan a text message on a stupid touchscreen lol.

Last edited by Mateo (2015-11-11 04:50:29)

Offline

#12 2015-11-11 19:24:11

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

Re: Give Mew

Ok, so I setup a fork of your copy on github, got it on my pc, and when I tried to build it, I just got a ton of "OPP_ already defined" errors. I thought it would be easier for me to work in out if I was playing with your actual code, but since clearly that isn't working, guess I'll have to do it the way I'd been doing.

Offline

#13 2015-11-11 23:02:44

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

Re: Give Mew

Mateo wrote:

Ok, so I setup a fork of your copy on github, got it on my pc, and when I tried to build it, I just got a ton of "OPP_ already defined" errors. I thought it would be easier for me to work in out if I was playing with your actual code, but since clearly that isn't working, guess I'll have to do it the way I'd been doing.

That's strange. Any ideas why it would do that?

Offline

#14 2015-11-11 23:06:47

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

Re: Give Mew

megamctaco wrote:
Mateo wrote:

Ok, so I setup a fork of your copy on github, got it on my pc, and when I tried to build it, I just got a ton of "OPP_ already defined" errors. I thought it would be easier for me to work in out if I was playing with your actual code, but since clearly that isn't working, guess I'll have to do it the way I'd been doing.

That's strange. Any ideas why it would do that?

Talked to Danny (since your project is based on his patch) and he suggested that my RGBDS is probably out of date. Sounds about right. I'll get that updated and see what I can come up with.

In the meantime, try moving the

jr nz, .gotMew

line, so that instead of being right after cp 150, it is REPLACING the "jr z, .giveMew" line further down.

That way, if you've already got mew, it goes to the GotMew line, otherwise it falls through to giving you mew the first time.

Offline

#15 2015-11-11 23:07:26

Fotomac
Member
Registered: 2015-10-25
Post 67/297

Re: Give Mew

Hello? Guys? I'm trying to figure out how to homage the Mew glitch in my hack.

Offline

#16 2015-11-11 23:13:49

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

Re: Give Mew

Fotomac wrote:

Hello? Guys? I'm trying to figure out how to homage the Mew glitch in my hack.

To be fair, that comment was actually off-topic, so I was focusing on the original question (how to make the man give Mew instead of just the Diploma) before moving on to that. And since that is completely unrelated to what we're figuring out in this thread, it would probably be better to discuss that in another thread, so it doesn't get lost by trying to have two unrelated discussions at the same time.

Also, the way you originally wanted to do it, I'm not sure of any good way to do that, so I would have to look into it.

Offline

#17 2015-11-11 23:32:38

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

Re: Give Mew

Mateo wrote:

In the meantime, try moving the

jr nz, .gotMew

line, so that instead of being right after cp 150, it is REPLACING the "jr z, .giveMew" line further down.

That way, if you've already got mew, it goes to the GotMew line, otherwise it falls through to giving you mew the first time.

That just made the diploma show up like normal, with a Mew part at all.

Offline

#18 2015-11-11 23:39:11

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

Re: Give Mew

I think the problem is what you are trying to use to set Mew as being received. wd72e is used by various other things, and is not a good choice to use for trying to permanantly mark an event as having happened. Kinda like how you added a new location to store the player's gender. You could just add

wExtraFlags::
ds 1

in wram.asm, (probably near wPlayerGender, but it doesn't really matter so long as it is inside the "main data" block so it will be saved) and replace wd72e with wExtraFlags and see if it works properly. Probably something else has already set the bit you are trying to check, so the game thinks you've already got Mew.

Offline

#19 2015-11-11 23:53:48

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

Re: Give Mew

Mateo wrote:

I think the problem is what you are trying to use to set Mew as being received. wd72e is used by various other things, and is not a good choice to use for trying to permanantly mark an event as having happened. Kinda like how you added a new location to store the player's gender. You could just add

wExtraFlags::
ds 1

in wram.asm, (probably near wPlayerGender, but it doesn't really matter so long as it is inside the "main data" block so it will be saved) and replace wd72e with wExtraFlags and see if it works properly. Probably something else has already set the bit you are trying to check, so the game thinks you've already got Mew.

Added that and my file got destroyed. Luckily I had a backup save state, so I don't have to catch that many Pokemon again!

Still gives me the diploma first.

Offline

Board footer

Powered by FluxBB