Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#51 2015-11-02 09:01:45

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

Re: Rematches and/or cell phones?

OK, I copied the script into scripts/ceruleancity.asm. What do I do about the sections respectively prefaced by "check if you have received the badge from Brock" and "let you walk out the door first"?

Offline

#52 2015-11-02 18:16:50

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

Re: Rematches and/or cell phones?

You can just leave out the one for checking for the badge, since you just wanted it to run the first time you came in. You could also remove the one labeled "Let you walk out the door first" since you aren't going to be entering Cerulean City through a door the first time you get there.

Also, keep in mind that in the commands tho check for and mark the phone call as having happened, you'll need to use a different bit than you used for Pewter (otherwise it won't happen, since Pewter already set that bit). If you just use that one byte, you can do bit 0, bit 1, bit 2, bit 3, bit 4, bit 5, bit 6, and bit 7 for different calls (that one byte can mark a total of 8 phone calls having happened).

Offline

#53 2015-11-04 22:16:51

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

Re: Rematches and/or cell phones?

After asking around on The PokéCommunity Forums, I got a few leads from Imafruitbat, who suggested I look at and assemble the final script from the following:

SliphCo7Text1 (the Lapras guy script, assuming I interpreted it right, from scripts/silphco7.asm)
Whatever the script is where Officer Jenny gives you a Squirtle in Vermilion City (can't find it)
Whatever the script is where the rival chooses his starter (from scripts/oakslab.asm)

Offline

#54 2015-11-04 22:32:20

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

Re: Rematches and/or cell phones?

I would assume the script of Jenny giving the squirtle would be in Pokeyellow, not Pokered, since that event only happens in Yellow Version.

EDIT: It looks like that script hasn't actually been disassembled and added to Pokeyellow yet, since Vermilion City in Pokeyellow does not seem to have any references to Jenny as of yet.

Last edited by Mateo (2015-11-04 22:36:43)

Offline

#55 2015-11-04 23:29:01

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

Re: Rematches and/or cell phones?

As I suspected. Can we get iimarckus on this if he's participating in the pokeyellow disassembly?

Offline

#56 2015-11-04 23:51:59

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

Re: Rematches and/or cell phones?

I don't see why you need that one in particular though. Any event that gives you a Pokemon (other than the starter choices) have a check to make sure there is room and let you come back later. You could look at the Eevee Pokeball in Celadon Mansion, for example.


Since you're wanting to go through with giving the Pokemon as part of the phone call event, this is a rough outline of how I'm guessing you'll need to handle it:

- Trigger the phone call when the player arrives in Cerulean
- Make the player walk to the aid, or the aid walk to the player, however you wanna do it.
- Have the Aid say his text about why he is giving the Pokemon and whatnot
- If there is room to give you the Pokemon, go ahead with it and do whatever you want done after (him walking away and his event being hidden, I assume)
- If there is NOT room to give it, Mark the call as having happened (so it doesn't get stuck in an infinite loop of calling so you can walk away and make room) and end the call script there

- If you can talk to the Aid, that means you had to make room and come back (otherwise he just functions as a "dummy" event that the phone call moves around and talks for)
- Talking to him offers the Pokemon the same as the script would
- If there is room, give the Pokemon and have him walk away
- If there is not room, once again have him say he will wait here for you and end the script there

If that is what you had in mind, I'll see what all you would need to do to make it happen. If that wasn't what you had in mind, let me know and I'll see what else we'd need to look up to make it happen.

Last edited by Mateo (2015-11-04 23:56:41)

Offline

#57 2015-11-05 00:04:57

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

Re: Rematches and/or cell phones?

OK, so source from the Silph Co. Lapras guy script, the Eevee Poké Ball script, and the "rival choosing Starter" script. I'll post what code I'm able to write here shortly, along with the leftovers.

Anyway, at present, the intent of my script is to:

- Upon entering Cerulean City, insert a phone call requesting a meeting with the Oak Aide in the Pokémon Center (that much I've already mastered);
- Keep the guard standing in front of the door of the burglarized house in Cerulean City until the unchosen Starter is picked up or the player character meets with Bill on Cerulean Cape, whichever comes last;
- Have the Oak Aide tell the player character about the situation that caused the unchosen Starter to fall into his hands;
- Have him give the unchosen Starter to the player character promptly if there are five or less Pokémon in the player's party, then give some parting words, walk away, and disappear; and
- Keep him around with an instruction to the player character to make some room for the unchosen Starter if there are six Pokémon in the player's party.

Last edited by Fotomac (2015-11-05 00:10:29)

Offline

#58 2015-11-05 00:31:41

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

Re: Rematches and/or cell phones?

Really, I don't see why the Lapras guy wouldn't be enough on his own, since he should cover giving a Pokemon and making sure there is room for it. But the Pokeball is just an extra reference in case the Rocket-event stuff gets in the way of reading it.

And ok that should be simple enough. The hard part really is the phone call, which you've already got covered. Making the aid script in the center could be largely based on the Lapras guy, you'd just need to add some stuff to make him walk off and disappear. And since you need to disappear an event on another map, you might want to take a look at how Bill removes that policeman originally so you can make the Aid do it instead.

Sounds like you're looking at it in a way that makes sense, and I think you should be able to work it out by looking in those places. Seems like a good start so far.

Offline

#59 2015-11-05 00:43:21

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

Re: Rematches and/or cell phones?

There's something else I forgot I need to know: how do you assign a script to a character in the overworld?

Offline

#60 2015-11-05 01:06:12

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

Re: Rematches and/or cell phones?

It's their text pointer. You'll notice each person has a number indicating which text pointer they call, and there is a list of text pointer inside the scripts file. Normall, these just point directly to a thing like:

TX_FAR _SomethingText
db "@"


But then the ones you want to do something fancy need to use:

TX_ASM
(your script goes here)

Offline

#61 2015-11-05 01:16:26

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

Re: Rematches and/or cell phones?

Guess that's what the numbers after the "STAY" and direction commands mean in the corresponding mapObjects bank. For example, if I were to do:

object SPRITE_OAK_AIDE, $5, $5, STAY, LEFT, $5 ; person

Then the text pointer in the corresponding script file would be the fifth, correct?

Offline

#62 2015-11-05 01:23:45

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

Re: Rematches and/or cell phones?

yep. Also, you'll notice all the people events are in order fist, and the signposts come after in terms of the list of pointers.

Offline

#63 2015-11-05 03:37:12

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

Re: Rematches and/or cell phones?

Here's the part I adapted from the Lapras guy's code and the Cerulean Rival exit code:

CeruleanPokecenterText5
    TX_ASM
    ld a, [w****] ; whatever this is that'll give me the unchosen Starter
    bit 0, a ; got unchosen Starter?
    ld hl, .MeetOakAideText
    call PrintText
    ld a, [wPlayerStarter]
    cp CHARMANDER
    jr z, .charmander
    cp SQUIRTLE
    jr z, .squirtle
    ; else Bulbasaur
    lb bc, SQUIRTLE, 5
    call GivePokemon
    jr z, .showText
.charmander
    lb bc, BULBASAUR, 5
    call GivePokemon
    jr z, .showText
.squirtle
    lb bc, CHARMANDER, 5
    call GivePokemon
.showText
    ld hl, .OakAideFarewellText
    call PrintText
    ld hl, w****
    call SetSpriteMovementBytesToFF
    ld a, [wXCoord]
    cp $14
    jr nz, .asm_***** ; if the player is to the Aide's left when talking to the Aide
    ld de, CeruleanPokecenterMovement2
    jr .asm_***** ; calling for the Aide sprite to move
.asm_*****
    ld de, CeruleanPokecenterMovement1
.asm_*****
    ld a, $1
    ld [H_SPRITEINDEX], a
    call MoveSprite
    ld a, $3
    ld [wCeruleanPokecenterCurScript], a
    ret

Any lines of code I should add, remove, or otherwise change?

Oh, I found the Eevee script in scripts/celadonmansion5.asm. Which portions of the following should I add to the above segment of code?

CeladonMansion5Text2: ; 1dd46 (7:5d46)
    TX_ASM
    lb bc, EEVEE, 25
    call GivePokemon
    jr nc, .asm_24365
    ld a, HS_CELADON_MANSION_5_GIFT
    ld [wMissableObjectIndex], a
    predef HideObject
.asm_24365
    jp TextScriptEnd

Last edited by Fotomac (2015-11-05 03:38:13)

Offline

#64 2015-11-05 03:43:06

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

Re: Rematches and/or cell phones?

the "jr nc, .asm_24365" part is checking to make sure there was room for the Pokemon. So you would put a jr nc after the givepokemon command, and have it jump to what should happen if there wasn't room for the Pokemon it tried to give you.

Offline

#65 2015-11-05 04:02:52

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

Re: Rematches and/or cell phones?

What should happen is him saying, according to the text segment as I have put it in the map's text bank:

text "So please, make"
line "some room for"
cont "this and come"
cont "back here!"

Offline

#66 2015-11-05 04:10:30

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

Re: Rematches and/or cell phones?

Then you'd just to

call GivePokemon
jr nc, .comeBackLater
(continue with the "else" case here, aka what he does if you had room)



then after you finish that script, add:

.comeBackLater
ld hl, thatTextPointer
call PrintText
jp TextScriptEnd

That way if there wasn't room, he tells you to come back when you have room, BUT if there was room, he just gives it normally and marks you as having received it and hides the cop and whatnot.

Last edited by Mateo (2015-11-05 04:10:51)

Offline

#67 2015-11-05 04:31:51

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

Re: Rematches and/or cell phones?

So is the following how it'd look (apart from the placeholder asterisks, that is)?

CeruleanPokecenterText5:
    TX_ASM
    ld a, [w****]
    bit 0, a ; got unchosen Starter?
    ld hl, .MeetOakAideText
    call PrintText
    ld a, [wPlayerStarter]
    cp CHARMANDER
    jr z, .charmander
    cp SQUIRTLE
    jr z, .squirtle
    ; else Bulbasaur
    lb bc, SQUIRTLE, 5
    call GivePokemon
    jr nc, .comeBackLater
    else
    jr z, .showText
.charmander
    lb bc, BULBASAUR, 5
    call GivePokemon
    jr nc, .comeBackLater
    else
    jr z, .showText
.squirtle
    lb bc, CHARMANDER, 5
    call GivePokemon
    jr nc, .comeBackLater
    else
.showText
    ld hl, .OakAideFarewellText
    call PrintText
    ld hl, w****
    call SetSpriteMovementBytesToFF
    ld a, [wXCoord]
    cp $14
    jr nz, .asm_*****
    ld de, CeruleanPokecenterMovement2
    jr .asm_*****
.asm_*****
    ld de, CeruleanPokecenterMovement1
.asm_*****
    ld a, $1
    ld [H_SPRITEINDEX], a
    call MoveSprite
    ld a, $3
    ld [wCeruleanPokecenterCurScript], a
    ret
.comeBackLater
    ld hl, TooManyPokemon
    call PrintText
    jp TextScriptEnd

Last edited by Fotomac (2015-11-05 04:33:13)

Offline

#68 2015-11-05 04:37:09

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

Re: Rematches and/or cell phones?

Glancing over it that looks about right.

Offline

#69 2015-11-05 04:41:01

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

Re: Rematches and/or cell phones?

Right, now all that's left is to assign more proper w and asm markers to those with the placeholder asterisks.

Offline

#70 2015-11-05 04:44:40

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

Re: Rematches and/or cell phones?

Also, one thing you could do to simplify it:

instead of doing multiple "call GivePokemon, jr nc, .comeBacklater" things, you could just do

ld bc, CHARMANDER, 5
jr .showText

or whatever, then add the

call GivePokemon
jr nc, .comeBackLater


at the start of the .showText routine


also, you need to comment out those "else" lines or the compiler will yell at you, since "else" isn't an actual asm command, it's just an understood thing, so I added it as a comment in my initial example.

Offline

#71 2015-11-05 04:57:10

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

Re: Rematches and/or cell phones?

Understood. So, what's the w that needs to be consulted in wram here?

Offline

#72 2015-11-05 17:20:36

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

Re: Rematches and/or cell phones?

Well, for new events like this, you could make a new variable called wExtraFlags or something, the same way you made one for the phone calls.

Offline

#73 2015-11-05 19:38:01

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

Re: Rematches and/or cell phones?

As for the asm variables?

Offline

#74 2015-11-09 09:38:39

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

Re: Rematches and/or cell phones?

OK, I took care of the w variable. But what about the asm variables, which are for the Oak Aide movements?

Offline

#75 2015-11-13 09:30:33

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

Re: Rematches and/or cell phones?

I'm getting an error thanks to the symbol "CeruleanPokecenterCurScript". Where do I put it in the code?

Offline

Board footer

Powered by FluxBB