- 5,256
- Posts
- 17
- Years
- Age 27
- Leicester, UK
- Seen Mar 31, 2025
Try compiling it using XSE v1.1.1 instead. That should hopefully fix it.
I am making a hack of emerald and I need some help on scripting.
I want to add scripts for move tutor and I am not sure how to do so, Can someone explain and give me the move table for emerald too, also explain how to select a pokemon which can learn certain move. I will be very thankful to you :)
Hey,
I recently made a Steven trainer script. It basically progresses the trainer (Pokemon Fire Red) and after the battle the player needs to obtain a MysticTicket (for Navel Rock).
There are 2 problems:
1. When I win I don't get the item straight away. I need to talk to him again and then he'll give. But he'll keep on giving me the ticket which shouldn't be.
2. When I have the ticket I still can't go to Navel Rock (you need to activate a flag or something, but which flag, IDK).
Spoiler:#dyn 0x740000
#org @begin
checkflag 0x251
if 0x1 jump :end
trainerbattle 0x0 0x1 0x0 @intro @defeat
msgbox @afterwards
callstd msg_normal
copyvarifnotzero 0x8000 MYSTICTICKET
copyvarifnotzero 0x8001 1
callstd MSG_OBTAIN
setflag 0x250
:end
msgbox @afterwards2
callstd msg_normal
end
#org @intro
= For many years I trained hard[.]\nOnce I was the champion of the Hoenn region[.]\nI want to take you on, right now!
#org @defeat
= You're a true POKéMON trainer!
#org @afterwards
= Hmm, I think you'd like this:
#org @afterwards2
= It's a ticket to Navel Rock[.]\nIt's the island of Ho-Oh and Lugia.
Basically what needs to happen:
1. If the player hasn't fought Steven, show message with @intro.
2. Start the battle with Steven (trainer ID 001)
3. If the player win, show message with @afterwards
4. Give the player a MisticTicket and enable Navel Rock access.
5. Show message with @afterwards2
And after that if the player talks to Steven again:
1. Show message with @afterwards2
I hope somebody can help me. I'm no pro in scripting yet so I don't know what I'm doing wrong. I'm using PKSV-UI.
[FONT="Courier New"]#dynamic 0x800000
#include stditems.rbh
//---------------
#org @start
trainerbattle 0x1 0x1 0x0 @string1 @string2 @snippet1
msgbox @string3 MSG_FACE //"It's a ticket to Navel Rock[.]\nIt..."
end
//---------------
#org @snippet1
msgbox @string4 MSG_NORMAL //"Hmm, I think you'd like this."
giveitem ITEM_MYSTICTICKET 0x1 MSG_OBTAIN
setflag 0x250
release
end
//---------
// Strings
//---------
#org @string1
= For many years I trained hard[.]\pOnce I was the champion of the\nHoenn region[.]\pI want to take you on, right now!
#org @string2
= You're a true POKéMON trainer!
#org @string3
= It's a ticket to Navel Rock[.]\nIt's the island of Ho-Oh and Lugia.
#org @string4
= Hmm, I think you'd like this.[/FONT]
I'm sorry if I'm being stupid but won't it start the trainer battle every time you talk with this script?Here's what you'd want to do:
Spoiler:Code:[FONT="Courier New"]#dynamic 0x800000 #include stditems.rbh //--------------- #org @start trainerbattle 0x1 0x1 0x0 @string1 @string2 @snippet1 msgbox @string3 MSG_FACE //"It's a ticket to Navel Rock[.]\nIt..." end //--------------- #org @snippet1 msgbox @string4 MSG_NORMAL //"Hmm, I think you'd like this." giveitem ITEM_MYSTICTICKET 0x1 MSG_OBTAIN setflag 0x250 release end //--------- // Strings //--------- #org @string1 = For many years I trained hard[.]\pOnce I was the champion of the\nHoenn region[.]\pI want to take you on, right now! #org @string2 = You're a true POKéMON trainer! #org @string3 = It's a ticket to Navel Rock[.]\nIt's the island of Ho-Oh and Lugia. #org @string4 = Hmm, I think you'd like this.[/FONT]
I'm sorry if I'm being stupid but won't it start the trainer battle every time you talk with this script?
Nope! The trainerbattle command essentially checks if the trainer flag is cleared or not, and if it is it skips it entirely. You can take a look at how the vanilla trainer scripts are structured too, it works the same way.
I've made some decent progress now. ( I feel like a proud kid right now, "I did it all by myself!") Now, I don't have a specific problem but rather a question. Is it possible to set an NPC script to make changes depending on the direction they're facing when spoken to? The idea I have in mind will either require different movements depending on facing, or changing it to a level script instead.
Surely the easier option would be to check which tile the player is stood on and make the relevant changes from that? You'd need to look into the getplayerpos command.
Okay thanks, I might need a little help understanding how to set that up. If it's not too much trouble, can someone provide a simple sample script on using that command?
[FONT="Courier New"]...
getplayerpos 0x8000 0x8001 // the X co-ord of the player is stored in 0x8000, the Y in 0x8001
compare 0x8000 0x4 // if the player's X co-ord is 4
if 0x1 goto @snippet1 // goto @snippet1
...
[/FONT]
...
cleartrainerflag 0x300
trainerbattle 0x0 0x3D 0x0 @before @end
...
...
trainerbattle 0x0 0x3D 0x0 @before @end
cleartrainerflag 0x300
...
...
fadescreen 0x1
hidesprite 0x9
fadescreen 0x0
...
If you wanted to make Trainer 0x3D rematchable every time, you'd cleartrainerflag 0x3D as that is their Trainer ID. I think you're confused between the Person ID, for the event in A-Map, and the Trainer ID, for the Trainer, and their team, itself.
Set the overworld you want to disappear's person ID to the flag. In this case that would be 317.ahhh.. how noob I really am,
another 1,
this script makes the OW disappears but when the player moves, it appears again, even if I left the OW.
Spoiler:
#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x316
if true jump @done
showpokepic 0x118 0xA 0x3
setvar 0x4001 0x118
textcolor BLUE
msgbox @M1
callstd MSG_YESNO
call @1
compare LASTRESULT 0x1
if == jump @2
hidepokepic
release
end
#org @done
msgbox @M2
callstd MSG_NORMAL
fadescreen 0x1
disappear 0x8
setflag 0x317
fadescreen 0x0
release
end
#org @1
copyvar 0x8012 0x8013
return
#org @2
hidepokepic
addpokemon 0x4001 5 NONE 0x0 0x0 0x0
compare LASTRESULT 0x0
if == jump @3
compare LASTRESULT 0x1
if == jump @4
compare LASTRESULT 0x2
if == jump @5
release
end
#org @3
disappear LASTTALKED
storepokemon 0x0 0x4001
fanfare 0x101
message @M11
showmsg
waifanfare
setflag 0x316
msgbox @M3
callstd 0x5
compare LASTRESULT NO
if == jump @6
call @subvar
call @name
jump @6
#org @6
release
end
#org @4
disappear LASTTALKED
storepokemon 0x0 0x4001
fanfare 0x101
message @M11
showmsg
waifanfare
setflag 0x316
msgbox @M3
callstd 0x5
compare LASTRESULT NO
if == jump @7
call @8
jump @9
#org @9
call @10
jump @6
#org @10
storeboxname 0x0 0x4037
storepokemon 0x1 0x4001
checkflag 0x834
if false call @11
checkflag 0x834
if true call @12
return
#org @11
special2 LASTRESULT 0x165
compare LASTREULT 0x1
if == jump @13
msgbox @M4
callstd MSG_NOCLOSE
return
#org @13
special2 LASTRESULT 0x18A
storeboxname 0x2 0x800D
msgbox @M5
callstd MSG_NOCLOSE
return
#org @8
fadescreen FADEOUT_BLACK
special 0x166
waitspecial
lock
faceplayer
return
#org @5
textcolor GRAY
msgbox @M6
callstd MSG_NOCLOSE
release
end
#org @subvar
countpokemon
subtractvar LASTRESULT 0x1
copyvar 0x8004 LASTRESULT
return
#org @name
fadescreen FADEOUT_BLACK
special NAME_POKEMON
waitspecial
return
#org @12
special2 LASTRESULT 0x165
compare LASTRESULT 0x165
if == jump @666
msgbox @M7
callstd MSG_NOCLOSE
return
#org @666
special2 LASTREULT 0x18A
storeboxname 0x2 0x800D
msgbox @M8
callstd MSG_NOCLOSE
return
#org @M1
= Hi [player]!\nI am JOY LIZARAN GUNDAO\lof POKEMON ADDICTS(THE ORIGINAL).\pI'm here to give you a special and rare\lPokemon.\pWould you like to take care of this\ladorable TORCHIC?
#org @M2
= I should go back to our\nAdministration Hall,\pBye-Bye!
#org @M11
= \v\h01 received the \v\h02\nfrom ADMINISTRATOR JOY.
#org @M3
= Do you want to give a nickname to\nthis \v\h02?
#org @M4
= \v\h03 was transferred to\nSomeone's PC.\pIt was placed in \nBox "\v\h02.["]
#org @M5
= Box "\v\h04["] on\nSomeone's PC was full.\p\v\h03 was transferred to\nBox "\v\h02.["]
#org @M6
= There's no more room for Pok\emon!\pThe Pok\emon BoxES are full and\ncan't accept any more!
#org @M7
= \v\h03 was transferred to\nBill'S PC.\pIt was placed in \nBox "\v\h02.["]
#org @M8
= Box "\v\h04["] on\nBill'S PC was full.\p\v\h03 was transferred to\nBox "\v\h02.["]
Set the overworld you want to disappear's person ID to the flag. In this case that would be 317.