• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.
The game doesn't support having TMs and regular items in the same shop's inventory- notice how the interface used for the TM merchant in the department store is very different from the regular merchant:

[PokeCommunity.com] Script Help Thread (DO NOT REQUEST SCRIPTS)
[PokeCommunity.com] Script Help Thread (DO NOT REQUEST SCRIPTS)


The simplest solution would be to have a separate NPC selling the TMs like the Celadon Department Store does.
 
Spoiler:


Edit: I guess I took too long. DoesntKnowHowToPlay beat me to it, i'll put my text in a spoiler then.
 
Last edited:
#dynamic 0x800000
setvar 0x8003
#org @start
lock
faceplayer
cry 0x19 0x0
msgbox @roar 0x6
waitcry
wildbattle 0x19 0x5 0xCA
fadescreen 0x0
hidesprite 0x800F
fadescreen 0x1
setflag 0x300
release
end

#org @roar
= PIKACHU: PIKA!

can any1 tell me why this don't let me battle a shiny wild pikachu?
 
#dynamic 0x800000
setvar 0x8003
#org @start
lock
faceplayer
cry 0x19 0x0
msgbox @roar 0x6
waitcry
wildbattle 0x19 0x5 0xCA
fadescreen 0x0
hidesprite 0x800F
fadescreen 0x1
setflag 0x300
release
end

#org @roar
= PIKACHU: PIKA!

can any1 tell me why this don't let me battle a shiny wild pikachu?

Yes, you must set the var 0x8003 to a number, and it must be inside of the @start at least.


So, if you want 1 shiny pikachu:
setvar 0x8003 0x1

If you want the next 2 pokemon shiny:
setvar 0x8003 0x2
and so on and so forth...


And it requires Shinyizer, just for anyone else looking at this.
 
I'm trying to script, it's something I've never done before I got this:

#dynamic 0x801E60
#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= Hello \v\h01!\nIt sure is a cold day, eh?

When I copy and paste the Offest from XSE's compiler i get;
801EC0

But the game warps me to a strange black room with Celadon City music, and then it crashes. Halp!
 
I'm trying to script, it's something I've never done before I got this:

#dynamic 0x801E60
#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= Hello \v\h01!\nIt sure is a cold day, eh?

When I copy and paste the Offest from XSE's compiler i get;
801EC0

But the game warps me to a strange black room with Celadon City music, and then it crashes. Halp!

It looks so simple.... How could this have happened? But I might have your problem. When you compiled it, did you take the @start offset or the @1 offset? The game won't like reading a message without the msgbox command, and will try to execute it as it's own command by instead of reading text, reading the hex numbers as raw commands.

This is what I think happened. Sometimes XSE will auto select other offsets besides @start. It can get confused if you have @start2 or @begin and won't know which one to auto select for copying. Just recompile it and make sure you take the @start offset.
 
Thanks Doesnt and karatekid.

But now I'm having one small problem...

I'm copying the original mart text verbatim, only changing the beginning offset and the offset of the mart items (and of course, the mart items themselves). But now, when I test the marts in-game, some of them work and others don't bring up the buy menu, seemingly at random...

Here's an example of one that works:

Code:
'-----------------------
#org 0x8022B2
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
lock
faceplayer
msgbox2 0x81A6211 '"Hi, there!\nMay I help you?"
waitmsgbox
pokemart 0x88022DA
msgbox 0x81A5190 '"Please come again!"
callstd 0x4
release
end

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


'-----------
' MartItems
'-----------
#org 0x8022DA
#raw word 12C
#raw word 14D
#raw word 142
#raw word 148
#raw word 129
#raw word 147
#raw word 0


'---------
' Strings
'---------
#org 0x1A6211
= Hi, there!\nMay I help you?

#org 0x1A5190
= Please come again!
And here is one that doesn't:

Code:
'-----------------------
#org 0x802337
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
lock
faceplayer
msgbox2 0x880236A '"Hi, there!\nMay I help you?"
waitmsgbox
pokemart 0x880235F
msgbox 0x81A5190 '"Please come again!"
callstd 0x4
release
end

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


'-----------
' MartItems
'-----------
#org 0x80235F
#raw word 124
#raw word 128
#raw word 130
#raw word 141
#raw word 0


'---------
' Strings
'---------
#org 0x80236A
= Hi, there!\nMay I help you?

#org 0x1A5190
= Please come again!
 
'-----------------------
#org 0x800200
lock
faceplayer
msgbox 0x826D3BD '"Have fun [player]!\nYour mother wil..."
release
end


'---------
' Strings
'---------
#org 0x26D3BD
= Have fun [player]!\nYour mother will wait here at home.

This is a script that's been compiled I made.

Talking to the NPC does nothing.
 
You need a callstd 0x__ (probably 4, maybe 6...I forget what each does) after the msgbox.

Or msgbox @whatever 0x__ if you have an updated version...(i think)
 
I'm back again.

'-----------------------
#org 0x800300
checkflag 0x7
if 0x1 goto 0x8800338
lock
applymovement 0x1 0x880033B
callstd 0x6
msgbox 0x880033E '"Mum: Oh [player]!\n You're up!"
applymovement 0x1 0x880035C
waitmovement 0x0
msgbox 0x8800361 '"Mum: A letter came for you today.\n..."
applymovement 0x1 0x88004C2
release
end

'-----------------------
#org 0x800338
release
end


'-----------
' Movements
'-----------
#org 0x80033B
#raw 1 'Face Up

#org 0x80035C
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 13 'Step Right (Normal)
#raw 13 'Step Right (Normal)

#org 0x8004C2
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)


'---------
' Strings
'---------
#org 0x80033E
= Mum: Oh [player]!\n You're up!

#org 0x800361
= Mum: A letter came for you today.\nHere I'll read it:\p''Dear [player],\nWe've recieved a Parcel for you from Maxi,\pplease make haste and collect it\nFrom, Worseth Town PO.\pMum: Hmmm, A parcel huh?\nGo ask Maxi, he might help ya!\pBut ... I guess this means, you'll\nbe leaving on a journey.\pHuh, me?\nOh don't worry, I'll be fine.\pGo have some fun.

just gives me this:

[PokeCommunity.com] Script Help Thread (DO NOT REQUEST SCRIPTS)
 
I'm not sure if this will fix everything, but callstd should come after the msgbox.

EDIT: and make sure you have another callstd after the second msgbox.
 
Why are you using checkflag 0x7? Unless it's specifically set earlier, you'll want to use an otherwise unused flag.

https://www.pokecommunity.com/posts/6829256/

Here is a list of already used flags.

EDIT: Also, I believe you need a #Raw FE at the end of all your movements.
 
It sort of work now.

She walks up to the player, talks then stops like planned.
But she does not walk back to her seat, and the script can happen again when re stepped on.

'-----------------------
#org 0x800300
checkflag 0x7
if 0x1 goto 0x8800338
applymovement 0x1 0x880033B
msgbox 0x880033E '"Mum: Oh [player]!\n You're up!"
callstd 0x6
applymovement 0x1 0x880035C
msgbox 0x8800361 '"Mum: A letter came for you today.\n..."
callstd 0x6
applymovement 0x1 0x88004C2
release
end

'-----------------------
#org 0x800338
release
end


'-----------
' Movements
'-----------
#org 0x80033B
#raw 62 'Exclamation Mark (!)
#raw 1 'Face Up
#raw FE 'End of Movements

#org 0x80035C
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 3 'Face Right
#raw FE 'End of Movements

#org 0x8004C2
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw 2 'Face Left
#raw FE 'End of Movements


'---------
' Strings
'---------
#org 0x80033E
= Mum: Oh [player]!\nYou're up!

#org 0x800361
= Mum: A letter came for you today.\nHere I'll read it:\p''Dear [player],\nWe've recieved a Parcel for you from\pMaxi, please make haste and collect it\nFrom, Worseth Town PO.\pMum: Hmmm, A parcel huh?\nGo ask Maxi, he might help ya!\pBut ... I guess this means, you'll\nbe leaving on a journey.\pHuh, me?\nOh don't worry, I'll be fine.\pGo have some fun.
 
Assuming you're using a-map, for the script happening again and again, you'll want to set the var # of the script to something unused (like 7000, for ex.) then at the beginning of your script use "setvar 0x7000 0x1". This allows the script to happen only once.

I'm not sure about the movements yet...I'll keep working at it.

EDIT: When she walks up to you, does the message show? Knowing exactly when it stops working would be helpful.
 
Last edited:
@Nintendork - In the movements, it points to 0x8004C2. However, you have the applymovement pointing to 0x88004C2 in the actual script. Remove the duplicate "8" up top.

It does that automatically when it compiles.

Assuming you're using a-map, for the script happening again and again, you'll want to set the var # of the script to something unused (like 7000, for ex.) then at the beginning of your script use "setvar 0x7000 0x1". This allows the script to happen only once.

I'm not sure about the movements yet...I'll keep working at it.

EDIT: When she walks up to you, does the message show? Knowing exactly when it stops working would be helpful.

Did nothing ?

Spoiler:
 
Really? Are you sure you set the var # and not the var value? If you did, and it's still not working, then idk.

On the movements, try adding waitmovement 0x0 after each? I'm really at the end of my knowledge now...

EDIT: also, it seems you're missing a lock at the beginning. IDK if that will help but since you release at the end it might be confusing it...
 
Thanks Doesnt and karatekid.

But now I'm having one small problem...

I'm copying the original mart text verbatim, only changing the beginning offset and the offset of the mart items (and of course, the mart items themselves). But now, when I test the marts in-game, some of them work and others don't bring up the buy menu, seemingly at random...

Here's an example of one that works:

Code:
'-----------------------
#org 0x8022B2
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
lock
faceplayer
msgbox2 0x81A6211 '"Hi, there!\nMay I help you?"
waitmsgbox
pokemart 0x88022DA
msgbox 0x81A5190 '"Please come again!"
callstd 0x4
release
end

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


'-----------
' MartItems
'-----------
#org 0x8022DA
#raw word 12C
#raw word 14D
#raw word 142
#raw word 148
#raw word 129
#raw word 147
#raw word 0


'---------
' Strings
'---------
#org 0x1A6211
= Hi, there!\nMay I help you?

#org 0x1A5190
= Please come again!
And here is one that doesn't:

Code:
'-----------------------
#org 0x802337
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
lock
faceplayer
msgbox2 0x880236A '"Hi, there!\nMay I help you?"
waitmsgbox
pokemart 0x880235F
msgbox 0x81A5190 '"Please come again!"
callstd 0x4
release
end

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


'-----------
' MartItems
'-----------
#org 0x80235F
#raw word 124
#raw word 128
#raw word 130
#raw word 141
#raw word 0


'---------
' Strings
'---------
#org 0x80236A
= Hi, there!\nMay I help you?

#org 0x1A5190
= Please come again!


Whoa, that was weird!!! I compiled your script in XSE 1.0.0 and, just like you said, it didn't work. However, then I compiled it in XSE 1.1.1, making the small syntax changes it required, such as shifting the callstd to an inline command and changing waitmsgbox to waitmsg and..... It worked perfectly. All I did was change syntax, the exact same basic structure was there. I honestly don't get it. I'm going to look at the hex value differences and see what I can find.
 
Whoa, that was weird!!! I compiled your script in XSE 1.0.0 and, just like you said, it didn't work. However, then I compiled it in XSE 1.1.1, making the small syntax changes it required, such as shifting the callstd to an inline command and changing waitmsgbox to waitmsg and..... It worked perfectly. All I did was change syntax, the exact same basic structure was there. I honestly don't get it. I'm going to look at the hex value differences and see what I can find.

Well, if it works in 1.1.1, then I guess I should upgrade...thanks for checking into it. It totally baffled me!
 
Status
Not open for further replies.
Back
Top