Script Help Thread (DO NOT REQUEST SCRIPTS) Page 276

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
What things should I look into if I want an event like this?
When you walk into a new area the screen moves down a bit to show some people beating this guy up and they run off dropping a few pokeball sprites and they come back to grab 2 of them. o.o I'm looking at diegoisawesome tut atm trying to figure this out.
For moving the screen, you need to use applymovement on camera (if I remember correctly it's 0x7F).
And then everything else is easily done with applymovement.
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List

Trev

i gave you everything...

Age 26
Male
Seen December 31st, 2021
Posted March 27th, 2019
1,505 posts
11 Years
Honestly hoping someone here can help me.

I'm trying to hack, but I'm horrible at scripting. I've read, like, 90 different tutorials, and the one thing I can't comprehend are flags.

So, here's my script. It's used to prevent the player from leaving the town until he/she goes to see the Professor. When the player steps on it, though, it just freezes the player, and you can't do anything but quit.

So, here's the script.

'---------------
#org 0x800027
lock
checkflag 0x1000
if 0x1 goto 0x880003A
clearflag 0x1000
release
end

'---------------
#org 0x80003A
pause 0x30
msgbox 0x8800058 MSG_NORMAL '"[player]: Wait a minute!\pI can't ..."
applymovement MOVE_PLAYER 0x88000E8
waitmovement 0xFF
setflag 0x1000
release
end


'---------
' Strings
'---------
#org 0x800058
= [player]: Wait a minute!\pI can't leave just yet!\pI need to go check with Professor\nOak. Mom said he needed me for\lsomething important.\pI better go[.]


'-----------
' Movements
'-----------
#org 0x8000E8
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements
That's the script as it is now. AFAIK, there's nothing wrong with it. I assumed it had something to do with the map script, so I added this as a map script:

'---------------
#org 0x8000EA
checkflag 0x1001
if 0x0 goto 0x88000F5
end

'---------------
#org 0x8000F5
setflag 0x1000
end
The first script doesn't work no matter what; having the map script doesn't seem to do anything. I haven't edited the inside of any of the houses yet, but it should work just fine because I'm starting with flags at 1000. Is there any reason that this script isn't working right?
Seen February 10th, 2013
Posted January 27th, 2013
29 posts
14.1 Years


You forgot the "waitmovement" command after your "applymovement" command.
Sorry, I was loading my script (So I'd have the version with pointers and before compilation. When I decompile it doesn't really do anything :/

I did have waitmovement 0x0, it didn't work. Then I thought I might need it to be 0xF, since that was my sprite's event number. It still doesn't work, not sure why.

Can anyone help me with this?

Here's the compiled version:
Spoiler:

'---------------
#org 0xE00AA0
lock
faceplayer
checkflag 0x904
if 0x1 goto 0x8E00AE6
checkflag 0x903
if 0x1 goto 0x8E00ABF
msgbox 0x8E00AE9 MSG_NORMAL '"Sorry dude, boss says\nnobody's al..."
release
end

'---------------
#org 0xE00AE6
release
end

'---------------
#org 0xE00ABF
msgbox 0x8E00B16 MSG_FACE '"Hey man, my boss told me\nto let y..."
applymovement 0xF 0x8E00AD7
waitmovement 0xF
hidesprite 0xF
setflag 0x904
if 0x7 call 0x4040407
call 0x4040404
call 0x6C00FE04
end


'---------
' Strings
'---------
#org 0xE00AE9
= Sorry dude, boss says\nnobody's allowed in!

#org 0xE00B16
= Hey man, my boss told me\nto let you in!\pGuess it's your lucky day,\nand that means my job's done!


'-----------
' Movements
'-----------
#org 0xE00AD7
#raw 0x7 'Step Right (Slow)
#raw 0x7 'Step Right (Slow)
#raw 0x7 'Step Right (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0xFE 'End of Movements



#org 0x800027
lock
checkflag 0x1000
if 0x1 goto 0x880003A
clearflag 0x1000
release
end
Well, first of all, why are you clearing a flag right there? If you check your flag and use goto to go to another section of your script you never get to the clearflag. In other words, if the first checkflag succeeds, it 'teleports' to the next section of the script, but if it fails it does a clearflag, releases, and ends. If it fails, the flag is not set, meaning no reason to clear the flag. Maybe you're trying to say this?

checkflag 0x1000
if 0x0 goto 0x880003A
clearflag 0x1000
But even then I have no idea why you'd ever want to set that flag anyways, seeing as how it would just set it and clear it as soon as you talked to him again.

After thinking about this again I just realized you could easily do something like this:

lock
faceplayer
checkflag 0x1000
if 0x1 goto LET_PLAYER_PASS_OR_REMOVE_THE_GUYS_SPRITE
msgbox @sayinstuff 0x6
APPLYOVEMENTS HERE
release
end
Then have some other event somewhere else set flag 0x1000 and you're set!
[/CODE]

Trev

i gave you everything...

Age 26
Male
Seen December 31st, 2021
Posted March 27th, 2019
1,505 posts
11 Years
Well, first of all, why are you clearing a flag right there? If you check your flag and use goto to go to another section of your script you never get to the clearflag. In other words, if the first checkflag succeeds, it 'teleports' to the next section of the script, but if it fails it does a clearflag, releases, and ends. If it fails, the flag is not set, meaning no reason to clear the flag. Maybe you're trying to say this?

checkflag 0x1000
if 0x0 goto 0x880003A
clearflag 0x1000
But even then I have no idea why you'd ever want to set that flag anyways, seeing as how it would just set it and clear it as soon as you talked to him again.

After thinking about this again I just realized you could easily do something like this:

lock
faceplayer
checkflag 0x1000
if 0x1 goto LET_PLAYER_PASS_OR_REMOVE_THE_GUYS_SPRITE
msgbox @sayinstuff 0x6
APPLYOVEMENTS HERE
release
end
Then have some other event somewhere else set flag 0x1000 and you're set!
[/CODE]
Er, I wasn't really using a person, just a script trap. I guess using a person would be better.

So, what you're saying is, I should just program the script without setflag/clearflag stuff, and have another script work all of that out instead?
Age 28
Male
USA
Seen July 14th, 2012
Posted July 12th, 2012
4 posts
11 Years
hi dude would you please help me i'm making a hack for pokemon ruby and i wanted to make a script using PKSV to allow the pokemon picture to appear while talking to the person like in the hack which is called : Pokemon Ruby Destiny-Life of Guardian i think so and i did every thing right but when i talk to him the pokemon colors appears to different like this/imageshackDOTus/photo/my-images/72/imageerrorDOTpng/
Ill be really happy if you helped and sorry if it was a long message :)
Seen February 10th, 2013
Posted January 27th, 2013
29 posts
14.1 Years
Er, I wasn't really using a person, just a script trap. I guess using a person would be better.

So, what you're saying is, I should just program the script without setflag/clearflag stuff, and have another script work all of that out instead?
Yeah, the only thing your current script would have to do is check your flag. The person vs. script trap thing is whatever you want it to be, if your story (Or whatever you're doing) applies more to a person blocking your way, use a person. If, say, you want a script to block you from going out to sea because the tides are too strong, you'd throw in some character judgement and use a script trap.

Like I said, totally up to you, I just recommend that you use an event to trigger your current script, or if you want you could even do it all with one script and every time you run this script have a line that checks if you've done something. If so it checks your flag and continues with the other script, then stops checking the old flag.

If the last part was confusing I'd just stick with another event triggering it like I was saying earlier, the all-in-one-script method would be an unnecessary amount of work if you don't understand it.

hi dude would you please help me i'm making a hack for pokemon ruby and i wanted to make a script using PKSV to allow the pokemon picture to appear while talking to the person like in the hack which is called : Pokemon Ruby Destiny-Life of Guardian i think so and i did every thing right but when i talk to him the pokemon colors appears to different like this/imageshackDOTus/photo/my-images/72/imageerrorDOTpng/
Ill be really happy if you helped and sorry if it was a long message :)
I don't care about the length (That's what she said xD), I myself tend to write really long messages too.

Can you post your script here? I haven't really done that recently so I'm not really sure without reading through.

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 3 Days Ago
Posted March 24th, 2023
8,579 posts
16 Years
Sorry, I was loading my script (So I'd have the version with pointers and before compilation. When I decompile it doesn't really do anything :/

I did have waitmovement 0x0, it didn't work. Then I thought I might need it to be 0xF, since that was my sprite's event number. It still doesn't work, not sure why.

Can anyone help me with this?

Here's the compiled version:
Spoiler:

'---------------
#org 0xE00AA0
lock
faceplayer
checkflag 0x904
if 0x1 goto 0x8E00AE6
checkflag 0x903
if 0x1 goto 0x8E00ABF
msgbox 0x8E00AE9 MSG_NORMAL '"Sorry dude, boss says\nnobody's al..."
release
end

'---------------
#org 0xE00AE6
release
end

'---------------
#org 0xE00ABF
msgbox 0x8E00B16 MSG_FACE '"Hey man, my boss told me\nto let y..."
applymovement 0xF 0x8E00AD7
waitmovement 0xF
hidesprite 0xF
setflag 0x904
if 0x7 call 0x4040407
call 0x4040404
call 0x6C00FE04
end


'---------
' Strings
'---------
#org 0xE00AE9
= Sorry dude, boss says\nnobody's allowed in!

#org 0xE00B16
= Hey man, my boss told me\nto let you in!\pGuess it's your lucky day,\nand that means my job's done!


'-----------
' Movements
'-----------
#org 0xE00AD7
#raw 0x7 'Step Right (Slow)
#raw 0x7 'Step Right (Slow)
#raw 0x7 'Step Right (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0xFE 'End of Movements
I think it's because of this line of code...
...
#org 0xE00ABF
msgbox 0x8E00B16 MSG_FACE '"Hey man, my boss told me\nto let y..."
applymovement 0xF 0x8E00AD7
waitmovement 0xF
hidesprite 0xF
setflag 0x904
if 0x7 call 0x4040407
call 0x4040404
call 0x6C00FE04
end
There are no commands before that(in red) that requires an 'if' statement.
Also, where does the 4040404 address even lead?
I guess is that this script has glitched up at the very end.
Try and compile your script again in a different free space address.

Male
Seen August 21st, 2013
Posted June 26th, 2013
90 posts
11 Years
First time doing apply movement trying to make it so when you walk on the script event you look around but it freezes for me. I didn't add anything to the side panel of the event but the script offset couldn't understand what he was doing on diegos script tutorial but yeah. FireRed
Spoiler:
#dynamic 0x800383

#org @start
applymovement 0x1 @move1
waitmovement 0x1
applymovement 0x1 @move2
waitmovement 0x1
applymovement 0x1 @move3
waitmovement 0x1
applymovement 0x1 @move4
waitmovement 0x1
msgbox @lonely 0x6
release
end

#org @move1
#raw 0x2
#raw 0xFE

#org @move2
#raw 0x1
#raw 0xFE

#org @move3
#raw 0x3
#raw 0xFE

#org @move4
#raw 0x4
#raw 0xFE

#org @lonely
= ..........\nWhere the hell am I?

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 4 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
First time doing apply movement trying to make it so when you walk on the script event you look around but it freezes for me. I didn't add anything to the side panel of the event but the script offset couldn't understand what he was doing on diegos script tutorial but yeah. FireRed
Spoiler:
#dynamic 0x800383

#org @start
applymovement 0x1 @move1
waitmovement 0x1
applymovement 0x1 @move2
waitmovement 0x1
applymovement 0x1 @move3
waitmovement 0x1
applymovement 0x1 @move4
waitmovement 0x1
msgbox @lonely 0x6
release
end

#org @move1
#raw 0x2
#raw 0xFE

#org @move2
#raw 0x1
#raw 0xFE

#org @move3
#raw 0x3
#raw 0xFE

#org @move4
#raw 0x4
#raw 0xFE

#org @lonely
= ..........\nWhere the hell am I?
The reason why it is freezing is because, as you said, you haven't edited the side panel. Just copy exactly what diegoisawesome has done in his tutorial unless you have used the variable 0x4050 beforehand. If you have used it previously then place another variable that you aren't using. Also, that script is going to activate every time you step on it so I would advise placing a setflag command so it doesn't trip when it is no longer necessary, or put in a set/add/subvar command that changes the variable which you put into the side panel (If the variable's value is not equal to the number in the 'Var value' box then the screen script will not activate).
Male
Seen August 21st, 2013
Posted June 26th, 2013
90 posts
11 Years
The reason why it is freezing is because, as you said, you haven't edited the side panel. Just copy exactly what diegoisawesome has done in his tutorial unless you have used the variable 0x4050 beforehand. If you have used it previously then place another variable that you aren't using. Also, that script is going to activate every time you step on it so I would advise placing a setflag command so it doesn't trip when it is no longer necessary, or put in a set/add/subvar command that changes the variable which you put into the side panel (If the variable's value is not equal to the number in the 'Var value' box then the screen script will not activate).
Well where he put 300 in unknown I can't b/c I only have enough spaces for 2 numbers, the text does go off though just doesn't move.

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 4 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
Well where he put 300 in unknown I can't b/c I only have enough spaces for 2 numbers, the text does go off though just doesn't move.
Ah, you must be using Advance Map 1.95 rather than 1.92 like he was. Put 03 in the unknown box instead.
Male
Seen August 21st, 2013
Posted June 26th, 2013
90 posts
11 Years
Eh I still think I'm doing something wrong,ima noob.... :pirate:
Spoiler:
#dynamic 0x800383

#org @start
checkflag 0x828
applymovement 0xFF @move1
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0xFF @move4
waitmovement 0x0
msgbox @lonely 0x6
setflag 0x828
release
end

#org @move1
#raw 0x2
#raw 0xFE

#org @move2
#raw 0x1
#raw 0xFE

#org @move3
#raw 0x3
#raw 0xFE

#org @move4
#raw 0x4
#raw 0xFE

#org @lonely
clearflag 0x828
= ..........\nWhere the hell am I?

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 4 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
Eh I still think I'm doing something wrong,ima noob....
Spoiler:
#dynamic 0x800383

#org @start
checkflag 0x828
applymovement 0xFF @move1
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0xFF @move4
waitmovement 0x0
msgbox @lonely 0x6
setflag 0x828
release
end

#org @move1
#raw 0x2
#raw 0xFE

#org @move2
#raw 0x1
#raw 0xFE

#org @move3
#raw 0x3
#raw 0xFE

#org @move4
#raw 0x4
#raw 0xFE

#org @lonely
clearflag 0x828
= ..........\nWhere the hell am I?
Your flag commands are all over the place. You have no 'if' command after your checkflag to determine whether you've been there and there should not be a clearflag anywhere in your script, particularly under the @lonely pointer which is for text rather than commands.

Try this (changes in red):

Spoiler:
#dynamic 0x800000 // Script will be automatically in the first offset that is free when using #dynamic

#org @start
checkflag 0x828
if 0x1 goto @skip // The if command allows you to check the compare a value to the last thing you queried (your checkflag). n this case we are determining whether you have it set and if you do you should jump to the @skip pointer
applymovement 0xFF @move1
pause 0x10 // I've removed the waitmovement commands and added short pauses after each applymovement because the animations change very fast and you would hardly see the player turn around
applymovement 0xFF @move2
pause 0x10
applymovement 0xFF @move3
pause 0x10
applymovement 0xFF @move4
pause 0x10
msgbox @lonely 0x6
setflag 0x828
release
end

#org @skip
release
end


#org @move1
#raw 0x2
#raw 0xFE

#org @move2
#raw 0x1
#raw 0xFE

#org @move3
#raw 0x3
#raw 0xFE

#org @move4
#raw 0x4
#raw 0xFE

#org @lonely
= ..........\nWhere the hell am I?
Male
Seen August 21st, 2013
Posted June 26th, 2013
90 posts
11 Years
Okay I got it to work thanks but how do I set up the flags or w.e if I wanted a script to stop you from leaving the map until you talk to something like a pc for example? How do I tie them both together? :pirate:

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x1 goto @skip
applymovement 0xFF @move1
pause 0x20
msgbox @nohoe 0x6
setflag 0x200
end

#org @skip
release
end

#org @move1
#raw 0x4
#raw 0xFE

#org @nohoe
= Should look around for clues first.

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 4 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
Okay I got it to work thanks but how do I set up the flags or w.e if I wanted a script to stop you from leaving the map until you talk to something like a pc for example? How do I tie them both together? :pirate:

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x1 goto @skip
applymovement 0xFF @move1
pause 0x20
msgbox @nohoe 0x6
setflag 0x200
end

#org @skip
release
end

#org @move1
#raw 0x4
#raw 0xFE

#org @nohoe
= Should look around for clues first.
You should set a flag in the script that the player must complete before they are allowed to leave - In this instance you would remove the 'setflag 0x828' command from the script you've provided and put that exact same command into the PC script. This way once the player has interacted with the first script they will have everything necessary to get by the second one.
Male
Seen August 21st, 2013
Posted June 26th, 2013
90 posts
11 Years
Okay well everything worked fine but when I go back to the room the script resets. Also how do you do move camera don't see it in diegos tut.

PC
Spoiler:
'---------------
#org 0x800184
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x88001E5
msgbox 0x88001AF MSG_YESNO '"It's an email from Kira, would\nyo..."
compare LASTRESULT 0x1
if 0x0 goto 0x88001AC
setflag 0x200
goto 0x88001E5

'---------------
#org 0x8001E5
msgbox 0x88001F3 MSG_NORMAL '"Hi [player], this is Kira. I\nwent..."
release
end

'---------------
#org 0x8001AC
release
end


'---------
' Strings
'---------
#org 0x8001AF
= It's an email from Kira, would\nyou like to open it?

#org 0x8001F3
= Hi [player], this is Kira. I\nwent outside today to train\land my pokemon vanished right in\lfront of me! What could cause\lthis to happen?! Meet me at\lthe hideout behind the gym in\lWolkey Town, be careful [player].


Script
Spoiler:
#dynamic 0x800885

#org @start
checkflag 0x200
if 0x1 goto @skip
msgbox @nohoe 0x6
applymovement 0xFF @move1
pause 0x20
end

#org @skip
clearflag 0x200
release
end

#org @move1
#raw 0x4
#raw 0x1D
#raw 0xFE

#org @nohoe
= Should look around for clues first.

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 3 Days Ago
Posted March 24th, 2023
8,579 posts
16 Years
Okay well everything worked fine but when I go back to the room the script resets. Also how do you do move camera don't see it in diegos tut.

PC
Spoiler:
'---------------
#org 0x800184
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x88001E5
msgbox 0x88001AF MSG_YESNO '"It's an email from Kira, would\nyo..."
compare LASTRESULT 0x1
if 0x0 goto 0x88001AC
setflag 0x200
goto 0x88001E5

'---------------
#org 0x8001E5
msgbox 0x88001F3 MSG_NORMAL '"Hi [player], this is Kira. I\nwent..."
release
end

'---------------
#org 0x8001AC
release
end


'---------
' Strings
'---------
#org 0x8001AF
= It's an email from Kira, would\nyou like to open it?

#org 0x8001F3
= Hi [player], this is Kira. I\nwent outside today to train\land my pokemon vanished right in\lfront of me! What could cause\lthis to happen?! Meet me at\lthe hideout behind the gym in\lWolkey Town, be careful [player].


Script
Spoiler:
#dynamic 0x800885

#org @start
checkflag 0x200
if 0x1 goto @skip
msgbox @nohoe 0x6
applymovement 0xFF @move1
pause 0x20
end

#org @skip
clearflag 0x200
release
end

#org @move1
#raw 0x4
#raw 0x1D
#raw 0xFE

#org @nohoe
= Should look around for clues first.
Your PC script is fine.
The only thing that's wrong there is this line...
...#org @skip
clearflag 0x200
release
end
...
In that line of code, you are telling the ROM to clear the flag again, so of course, the scripts that uses to check that flag will reset.

Trev

i gave you everything...

Age 26
Male
Seen December 31st, 2021
Posted March 27th, 2019
1,505 posts
11 Years
Okay well everything worked fine but when I go back to the room the script resets. Also how do you do move camera don't see it in diegos tut.

PC
Spoiler:
Unfixed script goes here


Script
[spoiler]Other unfixed script goes here
I can see the problems in the first script, the one for the PC. Try this one instead:

Spoiler:
'---------------
#org 0x800184
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x88001E5
msgbox 0x88001AF MSG_YESNO '"It's an email from Kira, would\nyo..."
compare LASTRESULT 0x1
if 0x1 goto 0x88001AC
release
end

'---------------
#org 0x8001E5
msgbox 0x88001F3 MSG_NORMAL '"Hi [player], this is Kira. I\nwent..."
setflag 0x200
release
end

'---------------
#org 0x8001AC
release
end


'---------
' Strings
'---------
#org 0x8001AF
= It's an email from Kira, would\nyou like to open it?

#org 0x8001F3
= Hi [player], this is Kira. I\nwent outside today to train\land my pokemon vanished right in\lfront of me! What could cause\lthis to happen?! Meet me at\lthe hideout behind the gym in\lWolkey Town, be careful [player].


The problem was that, even if the player said no, it'd automatically go to the e-mail. Also, why was the flag being set at the end of the first script? And, for the "compare/if" commands you used for the "Yes/No" situation were unmatching (you were checking if the player said yes, but the "if" only worked if he/she said no). I moved setflag 0x200 to the end of the second script, removed the goto at the end of the first script, and fixed the error in the Compare/If commands. This modified version makes it so the e-mail can be read, and the PC will no longer execute the script afterwards.

This one is also very obvious.

Spoiler:
#dynamic 0x800885

#org @start
checkflag 0x200
if 0x1 goto @skip
msgbox @nohoe 0x6
applymovement 0xFF @move1
pause 0x20
end

#org @skip
release
end

#org @move1
#raw 0x4
#raw 0x1D
#raw 0xFE

#org @nohoe
= Should look around for clues first.


The clearflag under @skip would make the script repeat endlessly. You didn't need it.
Male
Seen August 21st, 2013
Posted June 26th, 2013
90 posts
11 Years
I'm trying to add a trainer script but his view radius isn't working I set it to 5 I have to talk to him for the battle to start.
Spoiler:
#dynamic 0x80117B

#org @start
trainerbattle 0x0 0x00A 0x0 @before @after
msgbox @beaten 0x6
release
end

#org @before
= Check out my pokemon.

#org @after
= As soon as I get good enough I'm going to go and beat all the gym leaders in Kenchi!

#org @beaten
= Good game.
Male
Seen July 29th, 2022
Posted May 30th, 2012
6 posts
11.4 Years
Thanks, Drfuji and redriders180! It was very helpful.

Now I have a new problem. Whenever I try to compile a specific script with XSE, XSE crashes. At first I thought it was happening because of an extremely long message (hence the multiple msgbox's), but now I have no idea what is causing the crash. This crash is happening on my laptop. I tried compiling it on another computer and I got the error "Subscript out of range" on lines 65, 71, and 74 which are messages 6, 8, and 9. What does this error mean?
EDIT: The problem must be with the messages because it was able to successfully compile without them.

#dynamic 0x71B791

#org @start
lock 
faceplayer
checkflag 0x829
if 0x1 goto @done
checkflag 0x26E
if 0x1 goto @choosepokemon
msgbox @1 0x6
msgbox @10 0x6
msgbox @11 0x6
msgbox @12 0x6
msgbox @13 0x6
msgbox @2 0x6
msgbox @3 0x6
setflag 0x26E
release
end

#org @choosepokemon
checkflag 0x828
if 0x1 goto @pokedex
msgbox @4 0x6
release
end

#org @pokedex
msgbox @6 0x6
fanfare 0x13E
msgbox @7 0x6
waitfanfare
setflag 0x829
special 0x181
setvar 0x407C 0x1
msgbox @8 0x6
msgbox @9 0x6
release
end

#org @done
msgbox @5 0x6
release
end


#org @1
= Ah, there you are, [player]! Today is a\nspecial day for you and [rival]. 

#org @2
= [rival]: Why does [player] get to choose\nfirst?

#org @3
= Oak: Be patient, [rival]. You will get\nyour turn soon enough.

#org @4
= Once you have chosen your Pokemon,\ndon't leave. I have something for\lyou.

#org @5
= How is your Pokedex coming along?

#org @6
= Oak: Before you and [rival] go off on\nyour adventure, I’d like to give\lyou something.

#org @7
= [player] received the Pokedex!

#org @8
= That is a Pokedex, a Pokemon\nencyclopedia. I invented it to\lmake a detailed record of Pokemon\lthat the user encounters and\lcaptures. The Pokedex records\lsome data when you encounter a\lPokemon, but it records a lot\lmore data when you capture a\lPokemon. Make sure to catch’em\lall!

#org @9
= [rival]: I bet I’ll catch more Pokemon\nthan you, [player]! Smell you later!

#org @10
= Today is the day that you will\nreceive your first Pokemon!

#org @11
= Beside me are the keepers of the\nstarters.

#org @12
= There are nine starters—three\ngrass, three fire, and three\lwater—to choose from; you may\lonly have one.

#org @13
= [player], why don’t you choose first?

Alignment

Revered with the stars

Male
Seen December 25th, 2016
Posted September 30th, 2012
308 posts
13.2 Years
Thanks, Drfuji and redriders180! It was very helpful.

Now I have a new problem. Whenever I try to compile a specific script with XSE, XSE crashes. At first I thought it was happening because of an extremely long message (hence the multiple msgbox's), but now I have no idea what is causing the crash. This crash is happening on my laptop. I tried compiling it on another computer and I got the error "Subscript out of range" on lines 65, 71, and 74 which are messages 6, 8, and 9. What does this error mean?
EDIT: The problem must be with the messages because it was able to successfully compile without them.

#dynamic 0x71B791
 
#org @start
lock 
faceplayer
checkflag 0x829
if 0x1 goto @done
checkflag 0x26E
if 0x1 goto @choosepokemon
msgbox @1 0x6
msgbox @10 0x6
msgbox @11 0x6
msgbox @12 0x6
msgbox @13 0x6
msgbox @2 0x6
msgbox @3 0x6
setflag 0x26E
release
end
 
#org @choosepokemon
checkflag 0x828
if 0x1 goto @pokedex
msgbox @4 0x6
release
end
 
#org @pokedex
msgbox @6 0x6
fanfare 0x13E
msgbox @7 0x6
waitfanfare
setflag 0x829
special 0x181
setvar 0x407C 0x1
msgbox @8 0x6
msgbox @9 0x6
release
end
 
#org @done
msgbox @5 0x6
release
end
 
 
#org @1
= Ah, there you are, [player]! Today is a\nspecial day for you and [rival]. 
 
#org @2
= [rival]: Why does [player] get to choose\nfirst?
 
#org @3
= Oak: Be patient, [rival]. You will get\nyour turn soon enough.
 
#org @4
= Once you have chosen your Pokemon,\ndon't leave. I have something for\lyou.
 
#org @5
= How is your Pokedex coming along?
 
#org @6
= Oak: Before you and [rival] go off on\nyour adventure, I’d like to give\lyou something.
 
#org @7
= [player] received the Pokedex!
 
#org @8
= That is a Pokedex, a Pokemon\nencyclopedia. I invented it to\lmake a detailed record of Pokemon\lthat the user encounters and\lcaptures. The Pokedex records\lsome data when you encounter a\lPokemon, but it records a lot\lmore data when you capture a\lPokemon. Make sure to catch’em\lall!
 
#org @9
= [rival]: I bet I’ll catch more Pokemon\nthan you, [player]! Smell you later!
 
#org @10
= Today is the day that you will\nreceive your first Pokemon!
 
#org @11
= Beside me are the keepers of the\nstarters.
 
#org @12
= There are nine starters—three\ngrass, three fire, and three\lwater—to choose from; you may\lonly have one.
 
#org @13
= [player], why don’t you choose first?
combine
msgbox @1 0x6
msgbox @10 0x6
msgbox @11 0x6
msgbox @12 0x6
msgbox @13 0x6
msgbox @2 0x6
msgbox @3 0x6

into one msgbox. Do the same with msgbox 8 &9. Don't forget the \n's and stuff.

hinkage

Everyone currently in an argument with this member: I really suggest you stop.

Seen October 3rd, 2021
Posted October 30th, 2020
378 posts
12.7 Years
I have a problem with free space.

I expanded my Emerald ROM to 32 MB. To avoid sound corruption, I have to use #dynamic 0xE3CF64 in scripts. However, when compiling in PKSV it assigns all offsets to 0x100001 no matter how big they are, and when compiling in XSE I get a "Not enough free space" error.

I tried HackMew's Free Space Finder, but it is dangerous because it can overwrite scripts if I'm not careful, so I can't use it.
How can I fix this? I don't know what to do. ;-;