Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-09-06 06:28:30

Vitharix
Member
Registered: 2011-12-29
Post 46/396

Crossing Guard script

I'm trying to recreate a similar version of the Crossing Guard in Route 36's script. In Silver, he asks you to take a pokemon (Spearow, named Kenya) with mail to his buddy. After you deliver the pokemon, he rewards you by giving you an HP Up.

Using JohtoMap, I found the event data in the map header and determined his script begins at $1599CE . I've just been looking at his script in a hex editor and with Tauwasser's Compendium and written out all the values so I can look at it code by code.

What i'm curious about is, there are certain bytes which i've labeled below, and I don't have a clue what they do. More specifically, they don't seem to be useful within the script. Would anyone be willing to clear it up for me?


6A- face player
47- text box & load font
31- flag table 1 check
52- flag #
00- flag #? 
09- RAM check "if yes"
29- take phone number?
5A- delete fight RAM/reset person check
31- check flag
51- flag #
00- flag #
09- RAM check "if yes"
1C- check codes [xx]
5A- "codes"      (how does this relate to byte 1C?)
31- check flag (table 1)
50- flag #
00- flag #
09- RAM check "if yes"
0A- RAM check [<>0]    i'm not sure what this does either.
5A- "code" does this relate to byte 0A ^?
4C- display text
70- pointer to text
5A- pointer to text
4E- yes/no
08- if no
16- pointer to text
5A- pointer to text
4C- display text
DB- what could this byte possibly be for?
5A-pointer to text
54- keep text box open
85- key down code?
1C- check codes [xx]
01- "code" ^ ???
06- RAM check [=byte]
06- RAM check [=byte]
10- ASM code2 ??
5A- pointer to text
4C- display text
4B- pointer? 
5B- pointer?
84- sound code?
91- return code 3

I've left the other parts of the script off for time's sake, I might add them to this post eventually.

Offline

#2 2012-09-06 06:38:58

Miksy91
Member
Registered: 2010-10-16
Post 1,088/2,305

Re: Crossing Guard script

#org 0x1599CE
'-----------------------------------
faceplayer
loadfont
checkbit1 0x52
if true 0x5A29 ' 0x159A29
checkbit1 0x51
if true 0x5A1C ' 0x159A1C
checkbit1 0x50
if true 0x5A0A ' 0x159A0A
2writetext 0x5A70 ' 0x159A70
yesorno
if false 0x5A16 ' 0x159A16
2writetext 0x5ADB ' 0x159ADB
keeptextopen
waitbutton
checkcode 0x1
if == 0x6 0x5A10 ' 0x159A10
2writetext 0x5B4B ' 0x159B4B
playsound 0x91
waitbutton
givepoke 0x15 0xA 0x0 0x1 ' 0x5A50,0x5A56
givepokeitem 0x5A2F ' 0x159A2F
setbit1 0x50
2writetext 0x5B69 ' 0x159B69
closetext
loadmovesprites
end

#org 0x159A29
'-----------------------------------
2writetext 0x5C6C ' 0x159C6C
closetext
loadmovesprites
end

#org 0x159A1C
'-----------------------------------
2writetext 0x5C1E ' 0x159C1E
keeptextopen
verbosegiveitem FRESHWATER 1
if false 0x5A2D ' 0x159A2D
setbit1 0x52
2writetext 0x5C6C ' 0x159C6C
closetext
loadmovesprites
end

#org 0x159A2D
'-----------------------------------
loadmovesprites
end

#org 0x159A0A
'-----------------------------------
2writetext 0x5B69 ' 0x159B69
closetext
loadmovesprites
end

#org 0x159A16
'-----------------------------------
2writetext 0x5C07 ' 0x159C07
closetext
loadmovesprites
end

#org 0x159A10
'-----------------------------------
2writetext 0x5BE9 ' 0x159BE9
closetext
loadmovesprites
end

Pksv is a good tool because you can easily separate commands from one another by viewing the script with it. You've got lots of errors in "your script" above so here is what it should really look like.

Last edited by Miksy91 (2012-09-06 06:42:29)

Offline

#3 2012-09-06 06:44:24

Vitharix
Member
Registered: 2011-12-29
Post 48/396

Re: Crossing Guard script

Miksy91 wrote:

Should be
09 @go to 5A29

so those two bytes are pointers? It makes sense if they are, feels silly to miss that

And as always, thanks for the quick help Miksy!


EDIT:

I used PKSV to look at it, but I don't understand enough of it. Right now for me, PKSV's usefulness is limited to error-checking in scripts.

Last edited by Vitharix (2012-09-06 06:46:47)

Offline

Board footer

Powered by FluxBB