Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-04-25 05:21:46

ElecRei
Member
From: Cyberworld
Registered: 2011-04-22
Post 1/24

New to Scripting-Help with a Yes/No script

I've run into a problem involving a yes/no script in Pokemon Gold. Here's what I had (Not what I inserted):

6A 47 4C xx xx 54 4E 09 xx xx 4C xx xx 53 49 90

1225C5(Offset) 00 96 AE B4 AB A3 7F A0 8F 8E 91 98 86 8E 8D E6 57 00

1225D3(Offset) 00 87 A4 B1 A4 7F B8 AE B4 7F A6 AE E7 57 00

1225E2(Offset) 00 85 A8 AD A4 7F B3 A7 A4 AD E8 57 00

All together it was:

6A 47 4C C5 65 54 4E 09 D3 65 4C E2 65 53 49 90 00 96 AE B4 AB A3 7F A0 8F 8E 91 98 86 8E 8D E6 57 00
00 87 A4 B1 A4 7F B8 AE B4 7F A6 AE E7 57 00 00 85 A8 AD A4 7F B3 A7 A4 AD E8 57 00

The result I got was this:

Would aPON?

Yes
No

Yes: Unknown opcode at 8109 error, then a complete freeze up.
No: Fine then.

What I would like to know is how to fix the error and the "Would aPON?" part. Also I know the script is sort of messed up text-wise, it says "Would a PORYGON".


*Working on Pokemon Pink, Copper and Tin to follow*

Playing through Pokemon Brown
Team: Charmeleon, Drowzee, and Porygon

Offline

#2 2011-04-25 05:49:28

Miksy91
Member
Registered: 2010-10-16
Post 336/2,311

Re: New to Scripting-Help with a Yes/No script

With command 09, you basically point to a new script (which must have its own ending commands as well).
Now, you're pointing to another offset where there is text.

Change it work for example like this:
[4E] [09] [00] [70]

$123000
52 D3 65


52 Text2 code:
--------------
Displays a text. Afterwards there is no other script interpreted. Corresponds to 47 + 4C + 53 + 49 + 90

Structure:
[52][2byte textpointer]


Now, in the case you choose "Yes", the game will continue the script at offset $123000.
In case yoy choose "No", the main script will continue "behind" 09 00 70.

Last edited by Miksy91 (2011-04-25 05:55:52)

Offline

#3 2011-04-29 23:06:20

ElecRei
Member
From: Cyberworld
Registered: 2011-04-22
Post 3/24

Re: New to Scripting-Help with a Yes/No script

I'm confused at where I would place the [4E] [09] [00] [70]? Do I replace the [4E] [09] [xx] [xx] with it?


So in my case would it be:


6A 47 4C C5 65 54 4E 09 xx 70 4C xx xx 53 49 90
                                      ^
                                      What goes here?


*Working on Pokemon Pink, Copper and Tin to follow*

Playing through Pokemon Brown
Team: Charmeleon, Drowzee, and Porygon

Offline

#4 2011-04-29 23:11:12

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

Re: New to Scripting-Help with a Yes/No script

The pointer immediately follows the 09, there is no extra command between the 09 and the pointer

Offline

#5 2011-04-30 04:33:21

ElecRei
Member
From: Cyberworld
Registered: 2011-04-22
Post 4/24

Re: New to Scripting-Help with a Yes/No script

Wait so if I understand correctly:

6A 47 4C xx xx 54 4E 09 xx xx 4C xx xx 53 49 90

The first two [xx] bytes lead to the question text, the second set leads to the text if the player answers yes, and what is the last on for? I'm very confused at where these are to be placed.


*Working on Pokemon Pink, Copper and Tin to follow*

Playing through Pokemon Brown
Team: Charmeleon, Drowzee, and Porygon

Offline

#6 2011-05-01 15:46:08

Miksy91
Member
Registered: 2010-10-16
Post 346/2,311

Re: New to Scripting-Help with a Yes/No script

ElecRei wrote:

Wait so if I understand correctly:

6A 47 4C xx xx 54 4E 09 xx xx 4C xx xx 53 49 90

The first two [xx] bytes lead to the question text, the second set leads to the text if the player answers yes, and what is the last on for? I'm very confused at where these are to be placed.

Second xx doesn't lead to text.
If you answer yes, xx behind 09 is a 2-byte pointer to a new script.
If you answer no, third xx shows text because it's part of code (4C xx xx).


09: When [RAM]<>00, go to the pointed script. Else resume interpreting after the pointer.


4E
--------------
Displays a YES/NO box at X0F/Y07. Gives feedback:    00 = NO chosen, 01 = YES chosen



So in case you answer no, 00 is written to RAM and with code 09 you check if RAM is different from 00.
If it is different, the script will follow through the 2-byte pointer that follows byte 09.

Last edited by Miksy91 (2011-05-01 15:47:13)

Offline

Board footer

Powered by FluxBB