You are not logged in.
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"?
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).
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)
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)
As I suspected. Can we get iimarckus on this if he's participating in the pokeyellow disassembly?
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)
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)
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.
There's something else I forgot I need to know: how do you assign a script to a character in the overworld?
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:
But then the ones you want to do something fancy need to use:
(your script goes here)
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?
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)
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.
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!"
Then you'd just to
jr nc, .comeBackLater
(continue with the "else" case here, aka what he does if you had room)
then after you finish that script, add:
ld hl, thatTextPointer
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)
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)
Right, now all that's left is to assign more proper w and asm markers to those with the placeholder asterisks.
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
or whatever, then add the
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.
Understood. So, what's the w that needs to be consulted in wram here?
As for the asm variables?
OK, I took care of the w variable. But what about the asm variables, which are for the Oak Aide movements?