• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
I've got a level script that just stopped happening. It's Script 3 on One Island in the PC in FireRed...

I haven't (consciously) made any changes, but now the script doesn't run the first time you enter the pokemon center, so when you approach Bill and Cielo you're just sent straight home as part of the other script there.

Here is the unaltered level script...
Code:
'---------------
#org 0x170CB1
lockall
textcolor 0x0
applymovement MOVE_PLAYER 0x8170E7D
applymovement 0x2 0x8170E86
waitmovement 0x0
msgbox 0x81A0CDE MSG_KEEPOPEN '"BILL: Hey, there!\nCELIO!"
applymovement MOVE_PLAYER 0x81A75EB
waitmovement 0x0
sound 0x15
applymovement 0x3 0x81A75DB
waitmovement 0x0
applymovement 0x3 0x81A75E7
waitmovement 0x0
applymovement 0x3 0x81A75DD
waitmovement 0x0
msgbox 0x81A0CF7 MSG_KEEPOPEN '"CELIO: BILL!\nI can't believe you ..."
msgbox 0x81A0D27 MSG_KEEPOPEN '"BILL: Well, absolutely!\nHow's you..."
applymovement 0x2 0x81A75ED
applymovement MOVE_PLAYER 0x81A75E9
waitmovement 0x0
msgbox 0x81A0D72 MSG_KEEPOPEN '"[player], this is my buddy CELIO.\..."
applymovement 0x2 0x81A75EB
waitmovement 0x0
applymovement MOVE_PLAYER 0x81A75EB
waitmovement 0x0
checkflag 0x82C
if 0x1 call 0x8170E34
checkflag 0x82C
if 0x0 call 0x8170E3D
applymovement 0x3 0x81A75ED
waitmovement 0x0
msgbox 0x81A0E17 MSG_KEEPOPEN '"CELIO: That's really impressive.\p..."
msgbox 0x81A0E90 MSG_KEEPOPEN '"BILL: So, bring me up to speed.\nH..."
applymovement 0x3 0x81A75E7
waitmovement 0x0
msgbox 0x81A0ECC MSG_KEEPOPEN '"CELIO: It's running fine, but we'r..."
closeonkeypress
applymovement 0x2 0x81A75E9
waitmovement 0x0
msgbox 0x81A0F40 MSG_KEEPOPEN '"BILL: Oh, yeah?\nOkay, let me take..."
applymovement 0x2 0x81A75ED
waitmovement 0x0
applymovement MOVE_PLAYER 0x81A75E9
waitmovement 0x0
msgbox 0x81A0FB1 MSG_KEEPOPEN '"[player], can I get you to wait fo..."
loadpointer 0x0 0x81A10EE '"[player] accepted the METEORITE\nf..."
giveitem2 0x118 0x1 0x13E
additem 0x118 0x1
applymovement 0x3 0x81A75ED
waitmovement 0x0
msgbox 0x81A1113 MSG_KEEPOPEN '"CELIO: [player], if you are going\..."
additem 0x16F 0x1
loadpointer 0x0 0x81A231B '"Obtained the TRI-PASS!"
giveitem2 0x16F 0x1 0x13E
msgbox 0x81A1150 MSG_KEEPOPEN '"It's a PASS for the ferry service\..."
compare 0x4058 0x2
if 0x4 call 0x8170E46
compare 0x4058 0x2
if 0x0 call 0x8170E58
setflag 0x845
msgbox 0x81A1230 MSG_KEEPOPEN '"BILL: I'll catch you later!\nSay h..."
closeonkeypress
applymovement 0x2 0x81A75E9
waitmovement 0x0
applymovement 0x3 0x81A75E9
waitmovement 0x0
setflag 0x841
setvar 0x4076 0x1
releaseall
end

'---------------
#org 0x170E34
msgbox 0x81A0DE8 MSG_KEEPOPEN '"CELIO, this is [player], the\nreig..."
return

'---------------
#org 0x170E3D
msgbox 0x81A0DAC MSG_KEEPOPEN '"CELIO, this is [player], a rising\..."
return

'---------------
#org 0x170E46
textcolor 0x3
fanfare 0x13E
preparemsg 0x81A11EC '"[player] received an extra page\nf..."
waitmsg
waitfanfare
call 0x81A6675
return

'---------------
#org 0x170E58
setflag 0x39
setvar 0x4058 0x2
additem 0x169 0x1
loadpointer 0x0 0x81A1218 '"[player] received\na TOWN MAP!"
giveitem2 0x169 0x1 0x13E
return

'---------------
#org 0x1A6675
copyvar 0x8012 0x8013
return


'---------
' Strings
'---------
#org 0x1A0CDE
= BILL: Hey, there!\nCELIO!

#org 0x1A0CF7
= CELIO: BILL!\nI can't believe you came out here.

#org 0x1A0D27
= BILL: Well, absolutely!\nHow's your research coming along?\p[.]Oh, wait a sec.

#org 0x1A0D72
= [player], this is my buddy CELIO.\nHe's one dedicated PC MANIAC!

#org 0x1A0E17
= CELIO: That's really impressive.\pI hate to say it, but I have zero\naptitude for battling.\pAnyways, I'm glad to meet you.

#org 0x1A0E90
= BILL: So, bring me up to speed.\nHow's your machine running?

#org 0x1A0ECC
= CELIO: It's running fine, but we're\ntoo remote out here.\pThe PCs on this island just can't\nlink with your PC, BILL.

#org 0x1A0F40
= BILL: Oh, yeah?\nOkay, let me take a look-see.\p[.]Hang on here[.]\nI think we can make it work.\lLet me help you, okay?

#org 0x1A0FB1
= [player], can I get you to wait for\nme just a bit?\p[.]Actually, can I get you to do\nme a favor?\pThe island next to this one's\ncalled TWO ISLAND.\pThere's a guy there that runs\na GAME CORNER.\pHe has this thing for rare rocks\nand gems.\pWe keep in touch, being fellow\nmaniacs.\pSo, can I get you to deliver this\nMETEORITE to him?

#org 0x1A10EE
= [player] accepted the METEORITE\nfrom BILL.

#org 0x1A1113
= CELIO: [player], if you are going\nto TWO ISLAND, please take this.

#org 0x1A231B
= Obtained the TRI-PASS!

#org 0x1A1150
= It's a PASS for the ferry service\nserving the local islands.\pIt will let you travel between the\nISLANDS ONE, TWO, and THREE.\pOh, you should have this, too.

#org 0x1A1230
= BILL: I'll catch you later!\nSay hi to the guy for me!

#org 0x1A0DE8
= CELIO, this is [player], the\nreigning POKéMON CHAMP!

#org 0x1A0DAC
= CELIO, this is [player], a rising\ncontender as the POKéMON CHAMP!

#org 0x1A11EC
= [player] received an extra page\nfor the TOWN MAP!

#org 0x1A1218
= [player] received\na TOWN MAP!


'-----------
' Movements
'-----------
#org 0x170E7D
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x2E 'Face Up (Delayed)
#raw 0xFE 'End of Movements

#org 0x170E86
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x30 'Face Right (Delayed)
#raw 0xFE 'End of Movements

#org 0x1A75EB
#raw 0x30 'Face Right (Delayed)
#raw 0xFE 'End of Movements

#org 0x1A75DB
#raw 0x62 'Exclamation Mark (!)
#raw 0xFE 'End of Movements

#org 0x1A75E7
#raw 0x2F 'Face Left (Delayed)
#raw 0xFE 'End of Movements

#org 0x1A75DD
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0xFE 'End of Movements

#org 0x1A75ED
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements

#org 0x1A75E9
#raw 0x2E 'Face Up (Delayed)
#raw 0xFE 'End of Movements

And the flag in AMap is set to 4076 and the value is 0. Is there any way to fix this? Even something like adding a setvar or clearflag or whatever to the gym match script in Cinnabar, so that it works when you leave the gym...

Try changing the flag to 40F6. Tell me if that works.
 

thetripplenine

tripple.
98
Posts
11
Years
Well, my script somehow got all messed up, and now all she does is turn around

Here's my script:
Spoiler:
 

thetripplenine

tripple.
98
Posts
11
Years
@thetriplenine: Do you mean it doesn't even show msgbox @1 and @2? If so, what version of XSE are you using?

I'm using the newest version, it gives you the first and second msgbox and then she turns around, battles you and gives you the other messages, she doesn't walk away or anything, and if you talk to her again the message in "later" gets repeated and she still doesn't walk away.
 
947
Posts
11
Years
Oh ok, well, your script seems totally fine to me... This will sound stupid, but try to add a lock at the begining of @start and remove release than comes trainerbattle ...
 

thetripplenine

tripple.
98
Posts
11
Years
So thanks to KarateKid552 I got my script working perfectly.
Later I realised something need to be added to the script.
My scripts is basically an introduction. Oak greets you and gives you a new pokemon. When I realised that if you talk to him again that he will give you the pokemon another time. So I tried to take that away but adding in a message which will just say something rather then repeat the script.

#dyn 0x740000
#org @main
lock
faceplayer
message @intro
callstd MSG_NORMAL
setflag 0x200
checkflag 0x203
if == jump @complete
checkflag 0x201
if 0x1 jump @end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon EEVEE 0x5 ORANBERRY 0 0 0
setflag 0x201
storepokemon 0 EEVEE
message @getmsg
fanfare 0x101
showmsg
waitfanfare
waitbutton
@end
release
end

#org @complete
setflag 0x203
message @finish
callstd MSG_NORMAL
release
end

#org @noroom
msgbox @noroomlol
callstd MSG_NOCLOSE
release
end

#org @noroomlol
= You don't have enough room in your party.

#org @getmsg
= You got a \v\h02!\pNow, my Grandson will be waiting\nfor you in Dream City.\pWith him you will look for Martin.\pThe legend of Rayquaza might be\ntrue.\pFind Martin and he will tell you\neverything you need to know.
#org @intro
= Hello \v\h01!.\pIt is your 13th birthday and I\npromised that I would give you a...\pPokemon!!

#org @finish
= Be the best trainer that ever lived!

Any issues?

I wanted to simplify it, because yours was a little funky, you also don't need the no space thing because it's your first pokemon, am I right?
Spoiler:
 
48
Posts
13
Years
  • Seen Feb 13, 2016
I am using the following level script to try to have the player be greeted by an NPC upon entry and then after a short dialogue have the player move into the room and the NPC move back to his position. I am getting the following error when the script runs.
5ozbbs.png

Code:
//---------------
#org 0x80951F
applymovement 0x1 0x880910B
applymovement MOVE_PLAYER 0x8809517
waitmovement 0x0
msgbox 0x8809038 MSG_KEEPOPEN //"You... Did Professor Citrus send\n..."
closeonkeypress
msgbox 0x880907E MSG_KEEPOPEN //".................................."
closeonkeypress
msgbox 0x88090A3 MSG_KEEPOPEN //"Five of the poeople in the tavern\..."
closeonkeypress
applymovement MOVE_PLAYER 0x8809110
applymovement 0x1 0x880963C
waitmovement 0x0
setvar 0x4057 0x1
release
end


//---------
// Strings
//---------
#org 0x809038
= You... Did Professor Citrus send\nyou here? I see, so you must be...

#org 0x80907E
= ..................................

#org 0x8090A3
= Five of the poeople in the tavern\nare trainers.\lCome talk to me again after you\lhave beaten them all.


//-----------
// Movements
//-----------
#org 0x80910B
#raw 0x62 //Exclamation Mark (!)
#raw 0x2 //Face Left
#raw 0x12 //Step Left (Normal)
#raw 0xFE //End of Movements

#org 0x809517
#raw 0x3 //Face Right
#raw 0xFE //End of Movements

#org 0x809110
#raw 0x11 //Step Up (Normal)
#raw 0x11 //Step Up (Normal)
#raw 0xFE //End of Movements

#org 0x80963C
#raw 0x13 //Step Right (Normal)
#raw 0x1 //Face Up
#raw 0xFE //End of Movements
 

thetripplenine

tripple.
98
Posts
11
Years
Oh ok, well, your script seems totally fine to me... This will sound stupid, but try to add a lock at the begining of @start and remove release than comes trainerbattle ...

Lol, still didn't work, i've wrote this script 20 different ways and compiled it, the only problem is she's not moving.
 

Shadowraze

ur mum
794
Posts
11
Years
I am using the following level script to try to have the player be greeted by an NPC upon entry and then after a short dialogue have the player move into the room and the NPC move back to his position. I am getting the following error when the script runs.
5ozbbs.png

Code:
//---------------
#org 0x80951F
applymovement 0x1 0x880910B
applymovement MOVE_PLAYER 0x8809517
waitmovement 0x0
msgbox 0x8809038 MSG_KEEPOPEN //"You... Did Professor Citrus send\n..."
closeonkeypress
msgbox 0x880907E MSG_KEEPOPEN //".................................."
closeonkeypress
msgbox 0x88090A3 MSG_KEEPOPEN //"Five of the poeople in the tavern\..."
closeonkeypress
applymovement MOVE_PLAYER 0x8809110
applymovement 0x1 0x880963C
waitmovement 0x0
setvar 0x4057 0x1
release
end


//---------
// Strings
//---------
#org 0x809038
= You... Did Professor Citrus send\nyou here? I see, so you must be...

#org 0x80907E
= ..................................

#org 0x8090A3
= Five of the poeople in the tavern\nare trainers.\lCome talk to me again after you\lhave beaten them all.


//-----------
// Movements
//-----------
#org 0x80910B
#raw 0x62 //Exclamation Mark (!)
#raw 0x2 //Face Left
#raw 0x12 //Step Left (Normal)
#raw 0xFE //End of Movements

#org 0x809517
#raw 0x3 //Face Right
#raw 0xFE //End of Movements

#org 0x809110
#raw 0x11 //Step Up (Normal)
#raw 0x11 //Step Up (Normal)
#raw 0xFE //End of Movements

#org 0x80963C
#raw 0x13 //Step Right (Normal)
#raw 0x1 //Face Up
#raw 0xFE //End of Movements

I pretty much know your problem.

Try following the level script tutorial in this thread scroll down at the end of the OP and you should be able to see it. :3

You just forgot to open the map script offset and didn't changed those 0xFFFF. :3
 

Gyrath

Pokemon Lurid Creator
23
Posts
10
Years
I wanted to simplify it, because yours was a little funky, you also don't need the no space thing because it's your first pokemon, am I right?
Spoiler:

Thanks for the help.
I was using PKSV and I managed to fix it myself. I did as you said and took out the "noroom" thing.
So I took that out and all I had to do was change the "setflag" to the main script and I was set.
 
48
Posts
13
Years
  • Seen Feb 13, 2016
I pretty much know your problem.

Try following the level script tutorial in this thread scroll down at the end of the OP and you should be able to see it. :3

You just forgot to open the map script offset and didn't changed those 0xFFFF. :3
Thank you very much, that made it work perfectly! I've never had that problem with the other level scripts I have done. But I suppose I haven't done very many :P
 

thetripplenine

tripple.
98
Posts
11
Years
I didn't change much and it still doesn't work X_X

Here's my script:

Spoiler:
 

Shadowraze

ur mum
794
Posts
11
Years
I didn't change much and it still doesn't work X_X

Here's my script:

Spoiler:

I'm pretty sure there's no person event. 0. Change it to 1 look at the person event number not the other one. :/
 

thetripplenine

tripple.
98
Posts
11
Years
Hello! i have a question heres some info first though
Hacking: emerald
Tools of use: pokescript, XSE, Adv. Map
type of event: person script
topic of interest: wild/legendary pokemon battles
Question: okey, so i've been searching around the net for a few hours because i can't find the right codes to start the wild battle script on my emerald game, cause almost every-
where has the FR battle scripts but when i use them, it never starts the battle, the script (i think) would just skip the battle and do the fade in, fade out and then i would be free to move.
Spoiler:

so basicly i just want to know what i am doing wrong, and what to fix. (possibly the right codes to use)
thank you, Prinnykaze

I think you need the new version of xse if you are using that click here
blue = take out
red = put in

#dynamic 0x9C0000 (start off with that)
lock
faceplayer
checkflag 0x1200 (as you did setflag later on)
if 0x1 goto @done (this means if done go to the line, so it doesn't happen again)
cry 0xA1 404
#raw 0x33 (you might want to take that out, as it just moves nothing since you didn't put an applymovement part in it
pause 0x30 (pauses the game for 30 seconds, you might not need it)
message $cry(take that out the new xse doesn't use $'s
boxset 6 (doesn't use boxset's either)
msgbox @cry 0x6 (the 0x6 is for normal messages)
wildbattle 404 2 1(first of all xse is in hex not in dec, I don't know why you would want it to be level 2, and the 1 means it would be holding a masterball)
put this instead (wildbattle 0x194 0x2 0x1)
pause 0x70 (pauses the game for 70 seconds, you won't need it)
fadescreen 1 (does nothing because it doesn't have 0x infront)
fadescreen 0x1
removesprite 0x800F (no such thing)
setflag 0x1200 (put this in the event number of the person)
pause 0x10 (pauses game for 10 seconds)
fadescreen 0
fadescreen 0x0
release
end (ends the script)

#org @done (because i said if 0x1 goto @done)
hidesprite 0xthe event number of the person (put it down here)
release
end

#org @cry
=MMEEEOOOWW! (press cntrl t on xse to type better sentences)

All in all it's pretty much jumbled I recommend looking at diegoawesome's tutorial which pretty much explains everything you need to know. Link here
 

LaDestitute

Razor Sharp
84
Posts
10
Years
I need help debugging a starter Pokemon selection script I modified from the original in FR.
Nearly everything in the script works a-okay but when the player takes Dimetrus (the Water starter), and when the rival is supposed to take Eucuwala (the Grass starter), instead of moving down, down, then left like I want him to, he instead moves down, down, then up. The rest goes fine, all the way to the rival battle and end. As you can see, I modified the script to give a Pokemon egg instead of actual Pokemon, but it hatches right away via a Special command.

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
setvar 0x4001 0x0
setvar 0x4002 0x1
setvar 0x4003 0x4
setvar 0x4004 0x7
compare 0x4055 0x3
if 0x4 goto 0x8169DE4
compare 0x4055 0x2
if 0x1 goto 0x8169BE1
msgbox @1 0x6
closeonkeypress
release
end

'---------------
#org 0x169DE4
msgbox 0x818EA45 MSG_KEEPOPEN '"That's Prof. Pine's last Pokémon."
release
end

'---------------
#org 0x169BE1
applymovement 0x4 0x81A75EF
waitmovement 0x0
showpokepic 0x4002 0xA 0x3
textcolor 0x0
compare 0x4001 0x0
if 0x1 goto 0x8169C14
compare 0x4001 0x1
if 0x1 goto 0x8169C33
compare 0x4001 0x2
if 0x1 goto 0x8169C52
end

'---------------
#org 0x169C14
msgbox 0x818E272 MSG_YESNO '"Ah, you prefer Eucuwala. It's\nver..."
compare LASTRESULT 0x1
if 0x1 goto 0x8169C74
compare LASTRESULT 0x0
if 0x1 goto 0x8169C71
end

'---------------
#org 0x169C33
msgbox 0x818E207 MSG_YESNO '"Ah, you prefer Dimetrus. It's a\nb..."
compare LASTRESULT 0x1
if 0x1 goto 0x8169C74
compare LASTRESULT 0x0
if 0x1 goto 0x8169C71
end

'---------------
#org 0x169C52
msgbox 0x818E194 MSG_YESNO '"Ah, you prefer Kindlemur. It's\nqu..."
compare LASTRESULT 0x1
if 0x1 goto 0x8169C74
compare LASTRESULT 0x0
if 0x1 goto 0x8169C71
end

'---------------
#org 0x169C74
hidepokepic
hidesprite LASTTALKED
preparemsg 0x818E30D '"[player] received the Eucuwala egg..."
waitmsg
call 0x81A6675
setflag 0x291
giveegg 0x4002
setvar 0x8004 0x1
special 0xC2
copyvar 0x4031 0x4001
bufferpokemon 0x0 0x4002
fanfare 0x13E
waitfanfare
goto 0x8169CDC

'---------------
#org 0x169C71
hidepokepic
release
end

'---------------
#org 0x1A6675
copyvar 0x8012 0x8013
return

'---------------
#org 0x169CDC
closeonkeypress
compare 0x4001 0x0
if 0x1 goto 0x8169D0F
compare 0x4001 0x1
if 0x1 goto 0x8169D1F
compare 0x4001 0x2
if 0x1 goto 0x8169CFF
end

'---------------
#org 0x169D0F
applymovement 0x7 0x169D6B
waitmovement 0x0
goto 0x8169D2F

'---------------
#org 0x169D1F
applymovement 0x7 @movementfix
waitmovement 0x0
goto 0x8169D2F

'---------------
#org 0x169CFF
applymovement 0x7 0x169D62
waitmovement 0x0
goto 0x8169D2F

'---------------
#org 0x169D2F
textcolor 0x0
msgbox 0x818DD34 MSG_KEEPOPEN '"[rival]: I'll take this one, then!"
goto @spritecheck
end

#org @spritecheck
compare 0x4002 0x1
if 0x1 goto @check1
compare 0x4002 0x4
if 0x1 goto @check2
compare 0x4002 0x7
if 0x1 goto @check3
end

#org @check1
hidesprite 0xE
goto @rivalcontinue
end

#org @check2
hidesprite 0xD
goto @rivalcontinue
end

#org @check3
hidesprite 0xF
goto @rivalcontinue
end

#org @rivalcontinue
textcolor 0x3
bufferpokemon 0x0 0x4003
preparemsg 0x818DD52 '"[rival] received the [buffer1]\nfr..."
waitmsg
fanfare 0x13E
waitfanfare
setvar 0x4055 0x3
setflag 0x202
release
end

'---------------
#org 0x169D5C
setvar 0x4070 0x1
return


'---------
' Strings
'---------
#org @1
= Those are Pokémon eggs. They will\nhatch soon!

#org 0x18EA45
= That's Prof. Pine's last Pokémon\negg.

#org 0x18E272
= Ah, you prefer Eucuwala. It's\nvery friendly. So, [player], you want\lto go with the Grass Pokémon\lEucuwala?

#org 0x18E207
= Ah, you prefer Dimetrus. It's a\nbit hardy. So, [player], you want to go\lwith the Water Pokémon Dimetrus?

#org 0x18E194
= Ah, you prefer Kindlemur. It's\nquite agile. So, [player], you want to\lgo with the Fire Pokémon\lKindlemur?

#org 0x18E30D
= [player] received the Pokémon egg from\nProf. Pine! What? It's...hatching!

#org 0x18DD34
= [rival]: I'll take this one, then!

#org 0x18DD52
= [rival] received the [buffer1] egg from \nProf. Pine!

'-----------
' Movements
'-----------
#org 0x1A75EF
#raw 0x3 'Face Right
#raw 0xFE 'End of Movements

#org 0x169D6B
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @movementfix
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x11 'Step Left (Normal)
#raw 0xFE 'End of Movements

#org 0x169D62
#raw 0x10 'Step Down (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements
 

thetripplenine

tripple.
98
Posts
11
Years
I need help debugging a starter Pokemon selection script I modified from the original in FR.
Nearly everything in the script works a-okay but when the player takes Dimetrus (the Water starter), and when the rival is supposed to take Eucuwala (the Grass starter), instead of moving down, down, then left like I want him to, he instead moves down, down, then up. The rest goes fine, all the way to the rival battle and end. As you can see, I modified the script to give a Pokemon egg instead of actual Pokemon, but it hatches right away via a Special command.

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
setvar 0x4001 0x0
setvar 0x4002 0x1
setvar 0x4003 0x4
setvar 0x4004 0x7
compare 0x4055 0x3
if 0x4 goto 0x8169DE4
compare 0x4055 0x2
if 0x1 goto 0x8169BE1
msgbox @1 0x6
closeonkeypress
release
end

'---------------
#org 0x169DE4
msgbox 0x818EA45 MSG_KEEPOPEN '"That's Prof. Pine's last Pokémon."
release
end

'---------------
#org 0x169BE1
applymovement 0x4 0x81A75EF
waitmovement 0x0
showpokepic 0x4002 0xA 0x3
textcolor 0x0
compare 0x4001 0x0
if 0x1 goto 0x8169C14
compare 0x4001 0x1
if 0x1 goto 0x8169C33
compare 0x4001 0x2
if 0x1 goto 0x8169C52
end

'---------------
#org 0x169C14
msgbox 0x818E272 MSG_YESNO '"Ah, you prefer Eucuwala. It's\nver..."
compare LASTRESULT 0x1
if 0x1 goto 0x8169C74
compare LASTRESULT 0x0
if 0x1 goto 0x8169C71
end

'---------------
#org 0x169C33
msgbox 0x818E207 MSG_YESNO '"Ah, you prefer Dimetrus. It's a\nb..."
compare LASTRESULT 0x1
if 0x1 goto 0x8169C74
compare LASTRESULT 0x0
if 0x1 goto 0x8169C71
end

'---------------
#org 0x169C52
msgbox 0x818E194 MSG_YESNO '"Ah, you prefer Kindlemur. It's\nqu..."
compare LASTRESULT 0x1
if 0x1 goto 0x8169C74
compare LASTRESULT 0x0
if 0x1 goto 0x8169C71
end

'---------------
#org 0x169C74
hidepokepic
hidesprite LASTTALKED
preparemsg 0x818E30D '"[player] received the Eucuwala egg..."
waitmsg
call 0x81A6675
setflag 0x291
giveegg 0x4002
setvar 0x8004 0x1
special 0xC2
copyvar 0x4031 0x4001
bufferpokemon 0x0 0x4002
fanfare 0x13E
waitfanfare
goto 0x8169CDC

'---------------
#org 0x169C71
hidepokepic
release
end

'---------------
#org 0x1A6675
copyvar 0x8012 0x8013
return

'---------------
#org 0x169CDC
closeonkeypress
compare 0x4001 0x0
if 0x1 goto 0x8169D0F
compare 0x4001 0x1
if 0x1 goto 0x8169D1F
compare 0x4001 0x2
if 0x1 goto 0x8169CFF
end

'---------------
#org 0x169D0F
applymovement 0x7 0x169D6B
waitmovement 0x0
goto 0x8169D2F

'---------------
#org 0x169D1F
applymovement 0x7 @movementfix
waitmovement 0x0
goto 0x8169D2F

'---------------
#org 0x169CFF
applymovement 0x7 0x169D62
waitmovement 0x0
goto 0x8169D2F

'---------------
#org 0x169D2F
textcolor 0x0
msgbox 0x818DD34 MSG_KEEPOPEN '"[rival]: I'll take this one, then!"
goto @spritecheck
end

#org @spritecheck
compare 0x4002 0x1
if 0x1 goto @check1
compare 0x4002 0x4
if 0x1 goto @check2
compare 0x4002 0x7
if 0x1 goto @check3
end

#org @check1
hidesprite 0xE
goto @rivalcontinue
end

#org @check2
hidesprite 0xD
goto @rivalcontinue
end

#org @check3
hidesprite 0xF
goto @rivalcontinue
end

#org @rivalcontinue
textcolor 0x3
bufferpokemon 0x0 0x4003
preparemsg 0x818DD52 '"[rival] received the [buffer1]\nfr..."
waitmsg
fanfare 0x13E
waitfanfare
setvar 0x4055 0x3
setflag 0x202
release
end

'---------------
#org 0x169D5C
setvar 0x4070 0x1
return


'---------
' Strings
'---------
#org @1
= Those are Pokémon eggs. They will\nhatch soon!

#org 0x18EA45
= That's Prof. Pine's last Pokémon\negg.

#org 0x18E272
= Ah, you prefer Eucuwala. It's\nvery friendly. So, [player], you want\lto go with the Grass Pokémon\lEucuwala?

#org 0x18E207
= Ah, you prefer Dimetrus. It's a\nbit hardy. So, [player], you want to go\lwith the Water Pokémon Dimetrus?

#org 0x18E194
= Ah, you prefer Kindlemur. It's\nquite agile. So, [player], you want to\lgo with the Fire Pokémon\lKindlemur?

#org 0x18E30D
= [player] received the Pokémon egg from\nProf. Pine! What? It's...hatching!

#org 0x18DD34
= [rival]: I'll take this one, then!

#org 0x18DD52
= [rival] received the [buffer1] egg from \nProf. Pine!

'-----------
' Movements
'-----------
#org 0x1A75EF
#raw 0x3 'Face Right
#raw 0xFE 'End of Movements

#org 0x169D6B
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @movementfix
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x11 'Step Left (Normal)
#raw 0xFE 'End of Movements

#org 0x169D62
#raw 0x10 'Step Down (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

Did you change the applymovements, also try redoing it without the #org and the numbers, do like words and stuff.
 
947
Posts
11
Years
@LaDestiture, you're copying the content of the variable 0x4031 into the variable 0x4001, if I understood the script well, you're using 0x4001 to determine the movement to apply.. why didn't you use 0x4002 anyway? xD Also, to save some space, you can remove the comparisons after the 3 msgbox YES_NO and put "return" instead of "end" after each of those 3 msgboxes. Then, you make 1 single comparison in #org 0x169BE1. Do like this:
 
Last edited:
Status
Not open for further replies.
Back
Top