Script Help Thread (DO NOT REQUEST SCRIPTS) Page 375

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

Joexv

ManMadeOfGouda
joexv.github.io

Age 25
Male
Oregon
Seen January 26th, 2023
Posted April 8th, 2022
1,035 posts
10.6 Years
I( got bored this afternoon and started making a simple emerald hack that just simplifies some parts of gameplay.
I have a script that when i try to compile it says checkitem should be integer. What can i do to fix this, and what other errors are in this script? sry im new to scripting.:)
heres the script
Spoiler:
#dyn 0x740000
#org @start
'-----------------------------------
special 0x187
compare LASTRESULT 2
if == jump :end
lockall
storeitem 0 EONTICKET
checkitem EONTICKET 1
compare LASTRESULT 0
if == jump @donthave ' Smaller Than
msgbox @havemsg ' This rock appears to...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT 0
if == jump :end
removeitem EONTICKET 1
msgbox @IusedThis ' \v\h02 used \v\h03!
callstd MSG_NOCLOSE ' Non-closing message
applymovement LASTTALKED @move ' rock_animate end
pauseevent 0
disappear LASTTALKED
:end
releaseall
end

#org @donthave
'-----------------------------------
special 0x187
compare LASTRESULT 2
if == jump :end
lockall
storeitem 0 AURORATICKET
checkitem AURORATICKET 1
compare LASTRESULT 0
if == jump @donthave1 ' Smaller Than
msgbox @havemsg ' This rock appears to...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT 0
if == jump :end
removeitem AURORATICKET 1
msgbox @IusedThis1 ' \v\h02 used \v\h03!
callstd MSG_NOCLOSE ' Non-closing message
applymovement LASTTALKED @move ' rock_animate end
pauseevent 0
disappear LASTTALKED
:end
releaseall
end

#org @donthave1
'-----------------------------------
special 0x187
compare LASTRESULT 2
if == jump :end
lockall
storeitem 0 MYSTICTICKETTICKET
checkitem MYSTICTICKET 1
compare LASTRESULT 0
if == jump @donthave2 ' Smaller Than
msgbox @havemsg ' This rock appears to...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT 0
if == jump :end
removeitem MYSTICTICKET 1
msgbox @IusedThis2 ' \v\h02 used \v\h03!
callstd MSG_NOCLOSE ' Non-closing message
applymovement LASTTALKED @move ' rock_animate end
pauseevent 0
disappear LASTTALKED
:end
releaseall
end

#org @donthave2
'-----------------------------------
special 0x187
compare LASTRESULT 2
if == jump :end
lockall
storeitem 0 OLDSEAMAP
checkitem OLDSEAMAP 1
compare LASTRESULT 0
if == jump @donthavemsg1 ' Smaller Than
msgbox @havemsg ' This rock appears to...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT 0
if == jump :end
removeitem OLDSEAMAP 1
msgbox @IusedThis3 ' \v\h02 used \v\h03!
callstd MSG_NOCLOSE ' Non-closing message
applymovement LASTTALKED @move ' rock_animate end
pauseevent 0
disappear LASTTALKED
:end
releaseall
end

#org @donthavemsg1
'-----------------------------------
msgbox @donthavemsg ' It's a cursed rock, ...
callstd MSG_SIGN
end


#org @havemsg
= Well looks like you have an ticket!\nWould you like to ride?

#org @IusedThis
= \v\h01 handed over the EON TICKET. 

#org @donthavemsg
= Im sorry but you need a ticket\nto ride.

#org @IusedThis1
= \v\h01 handed over the AURORA TICKET. 

#org @IusedThis2
= \v\h01 handed over the MYSTIC TICKET. 

#org @IusedThis3
= \v\h01 handed over the OLD SEA MAP. 

#org @move
m walk_up end
New living flesh vessel who dis?

Kurapika

Male
Lavendar Town
Seen 16 Hours Ago
Posted April 6th, 2023
943 posts
10.3 Years
@joexv, what scripting programming are you using?? Apparently, you're missing the implementation of items label recognition or whatever what that can be called, either you need to enable some option in the program you're using or the program file is missing the file that is used to recognise items.

If you can't find how to fix it, try to replace items names by their respective ID in hexadecimal.
f.e.: EONTICKET's ID in Emerald is 275 which is 0x113 in hexadecimal.
checkitem EONTICKET 1 becomes checkitem 0x113 0x1

P.S.: Use Item Editor to get the ID (index) of an Item.
Use FFS or Windows' calculator to convert the ID from decimal to hexadecimal.
G3T - GEN 3 TOOLS ( Windows / Android )


Controversial?

Bored musician, bad programmer

Non-binary
UK
Seen October 11th, 2020
Posted April 24th, 2020
639 posts
12.4 Years
Hey all, I'm completely new to scripting and tried to make a trigger event (that triggers in the first area of my hack) but for some reason whenever I step on the trigger the game freezes... why? When I made it a person event it worked perfectly well..

Spoiler:

#dynamic 0x800000

#org @start
lockall
applymovement 0xFF @move
waitmovement 0x20
msgbox @1
callstd 0x2
waitmovement 0x10
applymovement 0x1 @move2
msgbox @2
waitmovement 0x10
warp 0x4 0x1 0xFF 0x02 0x05
releaseall
end

#org @move
#raw 0xC
#raw 0xE
#raw 0xC
#raw 0x1
#raw 0XFE

#org @move2
#raw 0x3
#raw 0xFE

#org @1
= PRIEST: Good afternoon.\pWe are gathered here today to mourn\nthe loss of a great man, a kind\lhusband and a loving father.\pFor many, Jonah Ghostflower could\nbe considered a great role model,\lsomeone to aspire to be like.\pFor some, he was a great partner;\nalways keeping a calm head and\lknowing the best course of action.\pBut we can all agree that despite\nanything, he was a figure who\ltouched all our lives in a positive\lmanner.\pHis tragic passing has hit us all\ngravely, but Jonah will never be\lforgotten in our hearts.\pMay his soul rest in peace.

#org @2
= MUM: How are you, \v\h01?\pCome on, honey[...]\nLet's go home.
???

Spherical Ice

Age 25
Leicester, UK
Seen 16 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
The script tile needs to have the first Unknown in Advance Map set to 0003, and you should assign it a Var number. If you set the var number to, say, 4054, then, if you setvar 0x4054 to anything other than the Var value (i.e., 0000), the script will then no longer activate.

Controversial?

Bored musician, bad programmer

Non-binary
UK
Seen October 11th, 2020
Posted April 24th, 2020
639 posts
12.4 Years
The script tile needs to have the first Unknown in Advance Map set to 0003, and you should assign it a Var number. If you set the var number to, say, 4054, then, if you setvar 0x4054 to anything other than the Var value (i.e., 0000), the script will then no longer activate.
Okay thanks :) that explains why it worked perfectly when I accidentally put it on a person...xD
???

Joexv

ManMadeOfGouda
joexv.github.io

Age 25
Male
Oregon
Seen January 26th, 2023
Posted April 8th, 2022
1,035 posts
10.6 Years
@joexv, what scripting programming are you using?? Apparently, you're missing the implementation of items label recognition or whatever what that can be called, either you need to enable some option in the program you're using or the program file is missing the file that is used to recognise items.

If you can't find how to fix it, try to replace items names by their respective ID in hexadecimal.
f.e.: EONTICKET's ID in Emerald is 275 which is 0x113 in hexadecimal.
checkitem EONTICKET 1 becomes checkitem 0x113 0x1

P.S.: Use Item Editor to get the ID (index) of an Item.
Use FFS or Windows' calculator to convert the ID from decimal to hexadecimal.
@Kurapika Im using pksvui, and i figured out what i did wrong, in the storeitem line i put the 0 before the item. Once i fixed that it compiled just fine. Now hopefully it doesnt give me a white screen.
Edit: Turns out it does give me a white screen. Ill try it on a fresh rom to see if thats whats causing it. Ok so it was something else causing the white screen this script works! Yay!
New living flesh vessel who dis?
Male
Seen 2 Weeks Ago
Posted December 22nd, 2022
498 posts
10.2 Years
FireRed hack: I was trying to make the guy from Game Freak to give me a Pokémon instead of the diploma once I catch the first X number of Pokémon. However, it seems the diploma is not considered an item and the script of the guy doesn't help either:

Spoiler:
'---------------
#org 0x16C3F6
lock
faceplayer
special2 LASTRESULT 0x14F
compare LASTRESULT 0x1
if 0x1 goto 0x816C412
msgbox 0x8196356 MSG_KEEPOPEN '"Is that right?\pI'm the game desig..."
release
end

'---------------
#org 0x16C412
goto 0x816C418

'---------------
#org 0x16C418
preparemsg 0x81963CD '"Wow! Excellent!\nYou completed you..."
waitmsg
pause 0x3C
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x108
waitstate
release
end

'---------------
#org 0x1A7AE0
release
end


'---------
' Strings
'---------
#org 0x196356
= Is that right?\pI'm the game designer!\pFilling up your POKéDEX is tough,\nbut don't quit!\pWhen you finish, come tell me!

#org 0x1963CD
= Wow! Excellent!\nYou completed your POKéDEX!\lCongratulations!\l[.]


Any help?

Thanks in advance.

Spherical Ice

Age 25
Leicester, UK
Seen 16 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
FireRed hack: I was trying to make the guy from Game Freak to give me a Pokémon instead of the diploma once I catch the first X number of Pokémon. However, it seems the diploma is not considered an item and the script of the guy doesn't help either:

Spoiler:
'---------------
#org 0x16C3F6
lock
faceplayer
special2 LASTRESULT 0x14F
compare LASTRESULT 0x1
if 0x1 goto 0x816C412
msgbox 0x8196356 MSG_KEEPOPEN '"Is that right?\pI'm the game desig..."
release
end

'---------------
#org 0x16C412
goto 0x816C418

'---------------
#org 0x16C418
preparemsg 0x81963CD '"Wow! Excellent!\nYou completed you..."
waitmsg
pause 0x3C
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x108
waitstate
release
end

'---------------
#org 0x1A7AE0
release
end


'---------
' Strings
'---------
#org 0x196356
= Is that right?\pI'm the game designer!\pFilling up your POKéDEX is tough,\nbut don't quit!\pWhen you finish, come tell me!

#org 0x1963CD
= Wow! Excellent!\nYou completed your POKéDEX!\lCongratulations!\l[.]


Any help?

Thanks in advance.
Remove special 0x108 (and waitstate) and use the givepokemon command.
Male
Seen 2 Weeks Ago
Posted December 22nd, 2022
498 posts
10.2 Years
Remove special 0x108 (and waitstate) and use the givepokemon command.
Thanks for the reply. So special 0x108 is for the diploma? IIRC, there should be two, one for regional and another for national dex, right? Where is the other one? And where do I change the amount of Pokémon for the national dex?

Thanks in advance.
Male
Seen March 7th, 2014
Posted February 20th, 2014
48 posts
9.5 Years
Hey guys. Can someone help me get my script to work which starts a wild battle after defeating a trainer? I have this so far, but as of now, the game exits the script and only battles after I click on the same sprite again. I can't seem to identify what is wrong, and it shouldn't even be that difficult. Help?

Spoiler:

#dynamic 0x80BEBE

#org @start
trainerbattle 0x0 0x00F 0x0 @before @after
wildbattle 0x9F 0x19 0xD1
fadescreen 0x1
fadescreen 0x0
msgbox @beaten 0x6
fadescreen 0x0
//Hidesprites are so that you can only challenge one of the trainers
hidesprite 0x7
hidesprite 0x8
hidesprite 0x9
setflag 0x1212
release
end

#org @before
= Sorry, to break it to you, but I'm\nnot about to let you pass.\pUnless you think you can beat me?

#org @after
= Y-You... You're tough! TRUDLEY and\nFOLLY can't be blamed for losing!\pI guess I have to use my SHADOW\nPOKEMON!

#org @beaten
= You haven't seen the last of us!
Gotta Snag Em All

Pokemon Colosseum (For GBA)

Spherical Ice

Age 25
Leicester, UK
Seen 16 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
Hey guys. Can someone help me get my script to work which starts a wild battle after defeating a trainer? I have this so far, but as of now, the game exits the script and only battles after I click on the same sprite again. I can't seem to identify what is wrong, and it shouldn't even be that difficult. Help?

Spoiler:

#dynamic 0x80BEBE

#org @start
trainerbattle 0x0 0x00F 0x0 @before @after
wildbattle 0x9F 0x19 0xD1
fadescreen 0x1
fadescreen 0x0
msgbox @beaten 0x6
fadescreen 0x0
//Hidesprites are so that you can only challenge one of the trainers
hidesprite 0x7
hidesprite 0x8
hidesprite 0x9
setflag 0x1212
release
end

#org @before
= Sorry, to break it to you, but I'm\nnot about to let you pass.\pUnless you think you can beat me?

#org @after
= Y-You... You're tough! TRUDLEY and\nFOLLY can't be blamed for losing!\pI guess I have to use my SHADOW\nPOKEMON!

#org @beaten
= You haven't seen the last of us!
You need to use trainerbattle 0x1

#dynamic 0x80BEBE

#org @start
trainerbattle 0x1 0x00F 0x1 @before @after @snippet1

#org @snippet1
wildbattle 0x9F 0x19 0xD1
fadescreen 0x1
fadescreen 0x0
msgbox @beaten 0x6
fadescreen 0x0
//Hidesprites are so that you can only challenge one of the trainers
hidesprite 0x7
hidesprite 0x8
hidesprite 0x9
setflag 0x1212
release
end

#org @before
= Sorry, to break it to you, but I'm\nnot about to let you pass.\pUnless you think you can beat me?

#org @after
= Y-You... You're tough! TRUDLEY and\nFOLLY can't be blamed for losing!\pI guess I have to use my SHADOW\nPOKEMON!

#org @beaten
= You haven't seen the last of us!
edit the flag you're using is unsafe. iirc, 0x200 to 0x400 are the only truly safe flags, definitely 0x200 to 0x2ff
Male
Seen 2 Weeks Ago
Posted December 22nd, 2022
498 posts
10.2 Years
Thanks for the reply. So special 0x108 is for the diploma? IIRC, there should be two, one for regional and another for national dex, right? Where is the other one? And where do I change the amount of Pokémon for the national dex?

Thanks in advance.
Can anyone clarify this, please?

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
Can anyone clarify this, please?
Actually, they're the same special. They just check what dex you currently own, and then choose the text and tilemap that go with it. That's all. It has a few branches in between that decide this.
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
Seen 2 Weeks Ago
Posted December 22nd, 2022
498 posts
10.2 Years
Actually, they're the same special. They just check what dex you currently own, and then choose the text and tilemap that go with it. That's all. It has a few branches in between that decide this.
But if I replace it by the command givepokemon, as mentioned above, how does it check the dex I have? My plan was to give one pokémon after completing the regional dex, and another after completing the national dex. But if I understood you correctly, if I remove the special it doesn't check anything, right?
Female
Seen August 10th, 2015
Posted March 6th, 2014
26 posts
11.1 Years
Game: FireRed
Editor: XSE

Hello, so my problem is that this is supposed to be a starter battle (like a rival battle in the beginning of the game) my problem is that if I lose I black out and reappear in my house, is there a way to get the script to continue even if I lose the battle?

Someone already told me to switch trainerbattle 0x9 0x03A 0x0 -> trainerbattle 0x9 0x03A 0x3
But that didn't make a difference in the game :/

Spoiler:
#dynamic 0x7238FF

#org @start
checkflag 0x203
if 0x1 goto @vaporeon
checkflag 0x204
if 0x1 goto @jolteon
release
end

#org @jolteon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk7
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03A 0x0 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk8
waitmovement 0x6
special 0x0
msgbox @talk4 0x6
trainerbattle 0x9 0x03F 0x0 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
special 0x0
release
end

#org @walk8
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @walk7
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE



#org @vaporeon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk3
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03B 0x0 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk4
waitmovement 0x6
special 0x0
msgbox @talk4 0x6
trainerbattle 0x9 0x03E 0x0 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
special 0x0
release
end

#org @talk4
= Emily: It's my turn now!

#org @talk3
= Ethan: Let's have a Pokémon\nbattle!

#org @walk6
#raw 0x2
#raw 0xFE

#org @walk5
#raw 0x12
#raw 0x3
#raw 0xFE

#org @pasgagne
= Emily: Yay! I won!

#org @gagne
= Emily: Awwn, I lost..



#org @walk4
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @lose
= Ethan: Better luck next time


#org @win
= Ethan: You're really good \v\h01!



#org @walk3
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @walk1
#raw 0x0
#raw 0xFE

#org @walk2
#raw 0x1
#raw 0xFE

#org @talk1
= Ethan: Wait \v\h01!
Age 25
Male
California
Seen December 26th, 2019
Posted February 23rd, 2014
98 posts
10.4 Years
Game: FireRed
Editor: XSE

Hello, so my problem is that this is supposed to be a starter battle (like a rival battle in the beginning of the game) my problem is that if I lose I black out and reappear in my house, is there a way to get the script to continue even if I lose the battle?

Someone already told me to switch trainerbattle 0x9 0x03A 0x0 -> trainerbattle 0x9 0x03A 0x3
But that didn't make a difference in the game :/

Spoiler:
#dynamic 0x7238FF

#org @start
checkflag 0x203
if 0x1 goto @vaporeon
checkflag 0x204
if 0x1 goto @jolteon
release
end

#org @jolteon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk7
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03A 0x0 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk8
waitmovement 0x6
special 0x0
msgbox @talk4 0x6
trainerbattle 0x9 0x03F 0x0 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
special 0x0
release
end

#org @walk8
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @walk7
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE



#org @vaporeon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk3
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03B 0x0 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk4
waitmovement 0x6
special 0x0
msgbox @talk4 0x6
trainerbattle 0x9 0x03E 0x0 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
special 0x0
release
end

#org @talk4
= Emily: It's my turn now!

#org @talk3
= Ethan: Let's have a Pokémon\nbattle!

#org @walk6
#raw 0x2
#raw 0xFE

#org @walk5
#raw 0x12
#raw 0x3
#raw 0xFE

#org @pasgagne
= Emily: Yay! I won!

#org @gagne
= Emily: Awwn, I lost..



#org @walk4
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @lose
= Ethan: Better luck next time


#org @win
= Ethan: You're really good \v\h01!



#org @walk3
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @walk1
#raw 0x0
#raw 0xFE

#org @walk2
#raw 0x1
#raw 0xFE

#org @talk1
= Ethan: Wait \v\h01!
Try changing the 0x0 to 0x3 in the trainerbattle part that allows the script to continue after you lose.
Female
Seen August 10th, 2015
Posted March 6th, 2014
26 posts
11.1 Years
Try changing the 0x0 to 0x3 in the trainerbattle part that allows the script to continue after you lose.
:D thanks that worked, but now my problem is that there are two battles, back-to-back, and adding 0x03 makes it repeat oaks script :/ is there a way to bypass that?
Age 25
Male
California
Seen December 26th, 2019
Posted February 23rd, 2014
98 posts
10.4 Years
:D thanks that worked, but now my problem is that there are two battles, back-to-back, and adding 0x03 makes it repeat oaks script :/ is there a way to bypass that?
Can you show what the new script looks like, and the part that repeats itself.

I have no idea what part is Oak's.
Female
Seen August 10th, 2015
Posted March 6th, 2014
26 posts
11.1 Years
Can you show what the new script looks like, and the part that repeats itself.

I have no idea what part is Oak's.

Spoiler:
#dynamic 0x7238FF

#org @start
checkflag 0x203
if 0x1 goto @vaporeon
checkflag 0x204
if 0x1 goto @jolteon
release
end

#org @jolteon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk7
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03A 0x3 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk8
waitmovement 0x6
special 0x0
msgbox @talk4 0x6
trainerbattle 0x9 0x03F 0x3 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
special 0x0
release
end

#org @walk8
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @walk7
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE



#org @vaporeon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk3
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03B 0x3 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk4
waitmovement 0x6
special 0x0
msgbox @talk4 0x6
trainerbattle 0x9 0x03E 0x3 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
special 0x0
release
end

#org @talk4
= Emily: It's my turn now!

#org @talk3
= Ethan: Let's have a Pokémon\nbattle!

#org @walk6
#raw 0x2
#raw 0xFE

#org @walk5
#raw 0x12
#raw 0x3
#raw 0xFE

#org @pasgagne
= Emily: Yay! I won!

#org @gagne
= Emily: Awwn, I lost..



#org @walk4
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @lose
= Ethan: Better luck next time


#org @win
= Ethan: You're really good \v\h01!



#org @walk3
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE

#org @walk1
#raw 0x0
#raw 0xFE

#org @walk2
#raw 0x1
#raw 0xFE

#org @talk1
= Ethan: Wait \v\h01!


The red parts are the two back-to-back battles that are the initial rival battles, my original problem was that if I lost the battle, it blacked out, this was fixed by replacing the 0x0 with 0x3 in the trainerbattle line, but now my problem is that the 0x3 initiates Oak's script (which is basically him teaching you how to fight in the beginning of the game) but if I add this to both the trainerbattles then Oak's script repeats itself in both battles

My question would be is it be possible to have my battle script continue even if I lose, but without having to have Oak's script there?
Age 32
Male
Faraway place
Seen May 14th, 2019
Posted June 15th, 2017
267 posts
11.3 Years
Editor: BSP

Is it possible to call an asm routine from within a battle script? I'm trying to make some new move effects, but unlike overworld scripting it doesn't seem to have a callasm command predefined.
Pokemon Sigma Σmerald:
(now under management by DraconianWing)

A Gen 3 remake de-make, featuring many new encounters and Gen VI mechanics

Rezordaxx

Asks many questions!

Age 24
Male
The Netherlands
Seen January 15th, 2017
Posted June 17th, 2015
290 posts
9.7 Years
made this script looks fine to me compiles fine but then if i open it again it looks wierd

I took 1000 bytes space
editor is XSE

original
Spoiler:
'---------------
#dynamic 0x80DCEE

#org @start
lockall
faceplayer
checkflag 0x206
if 0x1 goto @done
showpokepic 0x4 0x0 0x4
msgbox @002 0x6
hidepokepic
trainerbattle 0x4 0x19 0x0 @beforematch @aftermatch @later
end

#org @beforematch
= LETS RUMBLE!

#org @aftermatch
= NO YOU FOOL!\nYOU kILLED US BOTH!

#org @later
showpokepic 0x4 0x0 0x4
msgbox @003 0x6
hidepokepic
closeonkeypress
setflag 0x206
fadescreen 0x1
hidesprite 0x1
fadescreen 0x0
showpokepic 0x1 0x0 0x4
message @5 MSG_NORMAL
hidepokepic
fadescreen 0x1
warp 0x12 0x2 0x0 0x14 0x11
fadescreen 0x0
releaseall
end

#org @done
release
end


#org @002
= You fool!\nYou came to get your son back?
#org @003
= NOW WE BOTH GO TO ANOTHER DIMENSION!\nAAAAAHRG\pTwo other Saiyans are on there way to earth\nlet me tell you a secret\pthey are much stronger than me\nHAHAHAHAHA!

#org @5
= Guys,\nI really need to get going\pTell the others not to wish\nme back until the Saiyans arrive!\pI am going to train in otherword!\nGoodbye!


after compile and save
Spoiler:
'---------------
#org 0x80DCEE
lockall
faceplayer
checkflag 0x206
if 0x1 goto 0x880DD83
showpokepic 0x4 0x0 0x4
msgbox 0x880DD86 MSG_NORMAL '"You fool!\nYou came to get your so..."
hidepokepic
trainerbattle 0x4 0x19 0x0 0x880DD1B 0x880DD2A 0x880DD4D
end

'---------------
#org 0x80DD83
release
end


'---------
' Strings
'---------
#org 0x80DD86
= You fool!\nYou came to get your son back?

#org 0x80DD1B
= LETS RUMBLE!

#org 0x80DD2A
= NO YOU FOOL!\nYOU kILLED US BOTH!

#org 0x80DD4D
= \h75Ç ÇÔ ["]i\h80ËÌÉ\h76âñÉÁ\h97À[PK]À \h97 \h75À ÇÔ ¿j\h80ËÌÉ\h76\h97À\h39ÚÁ Ñ Ù \h97 \h6BÁ

My hack
Age 34
Male
Seen March 16th, 2022
Posted February 8th, 2019
416 posts
10.3 Years
try changing your battle style from 0x4 to 0x1... 0x1 is a continuation battle, 0x4 is a double battle, I see by your text that you have a double battle there... but for the fight you select double battle in A-trainer. the 0x4 battle type is for connecting 2 sprites into a double battle I think... and Im not sure how it works. but making that a 0x1 should fix your script.

If that fails... try making it a 0x3 battle with an actual text box for the script before the battle, and only one offset to the text when you win the battle. then dont jump to another offset...

something like this:

...
hidepokepic
msgbox @beforematch
showmsg
trainerbattle 0x3 0x19 @aftermatch
showpokepic 0x4 0x0 0x4
msgbox @003 0x6
...

#org @beforematch
= LETS RUMBLE!

#org @aftermatch
= NO YOU FOOL!\nYOU kILLED US BOTH!
Male
Seen December 3rd, 2016
Posted March 7th, 2014
21 posts
11 Years
I'm trying to test this script out on my new, upcoming hack (Pokemon Asper). However, it seems very glitchy for some unknown reason. Plus, the person is not in the location it's supposed to be. Here is my script: (editor is XSE, idea is that an old man moves up to you, gives you a pkmn and then moves to the side of the 'Steels Cave')

Spoiler:
#dynamic 0x29FAD4
#org @start
checkflag 0x1200
if 0x1 goto @done
msgbox @text1 0x6
applymovement 0x01 @move1
waitmovement 0x0
msgbox @text2 0x6
givepokemon 0x304 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x6
waitfanfare
closeonkeypress
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 call @name
msgbox @5 0x6
applymovement 0x01 @move2
waitmovement 0x0
setflag 0x1200
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @text1
= Wait, young man!

#org @move1
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0xFE

#org @move2
#raw 0x13
#raw 0x13
#raw 0x0
#raw 0xFE

#org @text2
= Don't leave without one of these!\nYou wouldn't be safe!

#org @2
= [cyan_fr]\v\h01 received an Aron!

#org @4
= Would you like to nickname it?

#org @5
= Take care of it for me.

#org @6
= How is Aron doing?

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
I'm trying to test this script out on my new, upcoming hack (Pokemon Asper). However, it seems very glitchy for some unknown reason. Plus, the person is not in the location it's supposed to be. Here is my script: (editor is XSE, idea is that an old man moves up to you, gives you a pkmn and then moves to the side of the 'Steels Cave')

Spoiler:
#dynamic 0x29FAD4
#org @start
checkflag 0x1200
if 0x1 goto @done
msgbox @text1 0x6
applymovement 0x01 @move1
waitmovement 0x0
msgbox @text2 0x6
givepokemon 0x304 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x6
waitfanfare
closeonkeypress
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 call @name
msgbox @5 0x6
applymovement 0x01 @move2
waitmovement 0x0
setflag 0x1200
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @text1
= Wait, young man!

#org @move1
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0xFE

#org @move2
#raw 0x13
#raw 0x13
#raw 0x0
#raw 0xFE

#org @text2
= Don't leave without one of these!\nYou wouldn't be safe!

#org @2
= [cyan_fr]\v\h01 received an Aron!

#org @4
= Would you like to nickname it?

#org @5
= Take care of it for me.

#org @6
= How is Aron doing?
...
givepokemon 0x304 0x5 0x0 0x0 0x0 0x0
...
Converting the hex number 0x304 to decimal, and you get 772.
There is no PKMN (in the 3rd gen games) that has that number.
If you are confused with hex numbers, then I suggest you simply type...

givepokemon 304 0x5 0x0 0x0 0x0 0x0
...and XSE will automatically convert decimal numbers into hex.

...
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
...
If you are going to use the [closeonkeypress] command, the message should be 0x4 instead of 0x6.

the person is not in the location it's supposed to be.
Check that map if it has level scripts that moves the NPC elsewhere in the map.

Male
Seen December 3rd, 2016
Posted March 7th, 2014
21 posts
11 Years
[code]...
-snip-
Thanks a ton! I really appreciate the help.

I wasn't paying attention for the 0x304 part for givepokemon... -_- sigh... I rush too much.

I'm not home to try it at the moment but I will try it asap and report back on the "person isn't where it's supposed to be" issue.

Thanks again!