• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Archive] Script help thread

Status
Not open for further replies.
Script help!

Whenever I try to make a script and put into my hack, it doesn't work! I keep trying to enable the national dex, but whenever I talk to the person, a box with an arrow in the upper-right corner keeps appearing and then the rom will crash/freeze. Can anyone help me?
 
I decided to do a Pokemart script, everything works fine and great but I noticed something. Whenever I talk to the mart person he doesn't do a usual greeting (like "hey what do you need.") and it just shows the Buy, Sell, and See Ya option box. I thought it would be simple to fix and just smack in a textbox command with the appropriate greeting. Whenever I do I get weird results whatever textbox I do (6, 4, etc.)

So my question is how do I make a greeting appear in the beginning of a pokemart script without it messing up?

Here's the script.

HTML:
#org $start
lock
faceplayer
pokemart $values1
release
end

#org $values1
#binary int 0x1 0xD 0xE 0x12 0x0
 
The 0x205 flag is already set. That 0x250 is to make the overworlds permanently disappear.
 
I decided to do a Pokemart script, everything works fine and great but I noticed something. Whenever I talk to the mart person he doesn't do a usual greeting (like "hey what do you need.") and it just shows the Buy, Sell, and See Ya option box. I thought it would be simple to fix and just smack in a textbox command with the appropriate greeting. Whenever I do I get weird results whatever textbox I do (6, 4, etc.)

So my question is how do I make a greeting appear in the beginning of a pokemart script without it messing up?

Here's the script.

HTML:
#org $start
lock
faceplayer
pokemart $values1
release
end

#org $values1
#binary int 0x1 0xD 0xE 0x12 0x0

I cant fix it right now, but I beleive if you decompile a mart script in ScriptDec or XSE you can see what commands it uses, and the change the item options.
I'm not so fond of mart scripts, I'd rather just edit them in A-Mart. I'll edit this post in a few minutes, just lemme check :).
 
It didn't work. I think I'll ask Baro how he did his rival scripts.

Edit: I had to do the stupidest thing to get it to work. It turns out that another script that I had on the same tile was interfering. I am now having two other problems with it. 1.the #org $your message happens twice 2.you can step on the tile again and it will play the rival music and do the ! mark above the player's head. Here it is

#ORG $begin
checkflag 0x209
if b_true goto $done
checkflag 0x205
if b_true goto $battle
release
end

#ORG $done
release
end

#ORG $battle
playsound 0x13B
nop
nop
applymovement 0x01 $rivwalk
applymovement 0x03 $compan
pausemove 0
applymovement 0xFF $hr
pausemove 0
trainerbattle 1 0x147 $before $after $further
release
end

#ORG $rivwalk
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0xFE

#ORG $compan
#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0xFE

#ORG $hr
#RAW 0x01
#RAW 0x62
#RAW 0xFE

#ORG $before
$before 1 = Before we leave I want to kick\nyour butt.

#ORG $after
$after 1 = Wha?!

#ORG $further
message $your
boxset 6
applymovement 0x01 $again
applymovement 0x03 $again2
pausemove 0
#raw 0x53
#raw 0x01
#raw 0x00
#raw 0x53
#raw 0x03
#raw ox00
setflag 0x250
fadesound 0x117
nop
nop
setflag 0x209
release
end

#ORG $your
$your 1 = You're better than I thought...\p\v\h01.\p\v\h01.I'll win next time.

#ORG $again
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x13
#RAW 0x10
#RAW 0xFE

#ORG $again2
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x12
#RAW 0x10
#RAW 0xFE

Everything else works great.

I'm to sure why the message might repeat itself. Probably just a problem with compiling, but I'm not too sure.
About the second problem, the flag 0x209 isn't setting. I can tell because of this.

Code:
#ORG $battle
playsound 0x13B   'You said it activates the playsound
nop
nop
applymovement 0x01 $rivwalk   'Person isn't there for movement to activate?
applymovement 0x03 $compan   'Person isn't there for movement to activate?
pausemove 0
applymovement 0xFF $hr    'Your movement activates
pausemove 0
trainerbattle 1 0x147 $before $after $further   'Trainerbattle is skipped.
release
end  'end of script.
That's the way I saw it. Try moveing that setflag 0x209 before the fadesound, and see if that makes any difference.

I decided to do a Pokemart script, everything works fine and great but I noticed something. Whenever I talk to the mart person he doesn't do a usual greeting (like "hey what do you need.") and it just shows the Buy, Sell, and See Ya option box. I thought it would be simple to fix and just smack in a textbox command with the appropriate greeting. Whenever I do I get weird results whatever textbox I do (6, 4, etc.)

So my question is how do I make a greeting appear in the beginning of a pokemart script without it messing up?

Here's the script.

HTML:
#org $start
lock
faceplayer
pokemart $values1
release
end

#org $values1
#binary int 0x1 0xD 0xE 0x12 0x0

I don't know, why boxset 4 won't work for you. I just tried this in a rom and it worked fine.
Code:
#org $start
lock
faceplayer
message $1
boxset 4
pokemart $values1
#raw 0x68
release
end

#org $1
$1 1 =Hi.

#org $values1
#binary int 0x1 0xD 0xE 0x12 0x0
You probably should be using msgbox2 but it's not coded into pokescript, so you'd have to put the text into the rom through hex. Just ask about that if you're interested.
If not the boxset 4 does pretty much the same thing.
 
*looks for scripting help all over the place*

How the heck did I miss this topic? XD

Well, I posted this in the "Simple questions" topic because somehow, I didn't notice this topic was here.

Okay, this isn't much of a question as it is a request.

I've been trying to learn scripting but I just can't get it right. All of my scripts don't work, and this whole ScriptED VS Pokescript thing is making my head spin.

I use Diamondcutter to apply my scripts to my game, so judging by the format, I think I need ScriptED formatted scripts.

A simple request, all I need is one easily editable script that attatches to a person or object that when you walk up to it and talk to it, it activates a one-time-only wild pokemon battle with a pokemon of choice at a level of choice. Kind of like Articuno, Zapdos, Moltres, Lugia, and Ho-Oh in Fire Red (which is the version I'm hacking).

I would GREATLY appreciate anyone who helps me out. I've been at this for months and I'm getting more and more discouraged by the week...

Okay, so far, I've only had ONE working script (and I kinda stole it directly from a tutorial, so you know I'm having problems with scripting)

The following is the one script that worked

Code:
#org 0x800000
lock
faceplayer
checkflag 0x10A
if 1 jump 0x800050
special 0x16F
setflag 0x10A
fanfare 0x13E
msgbox 0x800100
callstd 0x6
waitfanfare
release
end
#org 0x800050
msgbox 0x800070
callstd 0x6
release
end
#org 0x800070
= Enjoy your National Dex.
#org 0x800100
= Your POKéDEX was upgraded!

So, can someone give me the script I requested, but in the same format as the above posted script?

or at least point me in the direction of a tutorial that uses this format AND explains how to do what I need done... So far, all the tutorials I've found show how to do it, but in the wrong format, or show me how to script in the right format but not how to script this particular event.

Just in case anyone willing to help is unclear on what I'm looking for, the script should do the following.

1) Can be applied to an object or person
2) Only activates when clicked on/spoken to
3) Makes the screen shake a bit
4) Initiates a Pokemon Cry of choice
5) Text box goes here (I can edit this myself)
6) Initiates a pokemon battle against a specified pokemon of specified level
7) After the battle, the event cannot be re-triggered unless game is reset to a point before the event took place.

I'll worship anyone who helps me get this thing over with. I've been gnawing at this for months ;_;
 
Last edited:
It worked, but now this one, which is almost exactly the same, except it checks for a different pokemon doesn't work.

#ORG $begin
checkflag 0x209
if b_true goto $done
checkflag 0x207
if b_true goto $battle
release
end

#ORG $done
release
end

#ORG $battle
setflag 0x209
playsound 0x13B
nop
nop
applymovement 0x01 $rivwalk
applymovement 0x03 $compan
pausemove 0
applymovement 0xFF $hr
pausemove 0
trainerbattle 1 0x148 $before $after $further
release
end

#ORG $rivwalk
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0xFE

#ORG $compan
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0xFE

#ORG $hr
#RAW 0x01
#RAW 0x62
#RAW 0xFE

#ORG $before
$before 1 = Before we leave I want to kick\nyour butt.

#ORG $after
$after 1 = Wha?!

#ORG $further
message $your
boxset 6
applymovement 0x01 $again
applymovement 0x03 $again2
pausemove 0
#raw 0x53
#raw 0x01
#raw 0x00
#raw 0x53
#raw 0x03
#raw ox00
setflag 0x250
fadesound 0x117
nop
nop
release
end

#ORG $your
$your 1 = You're better than I thought...\p\v\h01.\p\v\h01.I'll win next time.

#ORG $again
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x13
#RAW 0x10
#RAW 0xFE

#ORG $again2
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x12
#RAW 0x10
#RAW 0xFE

It does nothing. I only changed the trainer battle #, the movements, and one of the checkflags.
 
Thx Aquila, it finally compiled.
The problem is, it doesn't burn.
It says enter offset for $3, but I can't see the mistake O.o

edit: figured it out, you use $binary instead of #binary.
 
Last edited:
Thx Aquila, it finally compiled.
The problem is, it doesn't burn.
It says enter offset for $3, but I can't see the mistake O.o

edit: figured it out, you use $binary instead of #binary.

Ups, I was kinda tired(excuse...)
 
You probably should be using msgbox2 but it's not coded into pokescript, so you'd have to put the text into the rom through hex. Just ask about that if you're interested.
If not the boxset 4 does pretty much the same thing.
Yeah, boxset 4 does work but the problem with using it is that the message shows up but, you need to press A in order for the script to continue after the message. I want the script to happen like in the game, the greeting comes up and the box with the options pops up instantaneously and by itself.

If I need to insert that into hex, I'm willing to. I'll be more than happy to learn how to.
 
The problem is that this one does absolutely nothing, while as this one works perfectly.

#ORG $begin
checkflag 0x209
if b_true goto $done
checkflag 0x205
if b_true goto $battle
release
end

#ORG $done
release
end

#ORG $battle
playsound 0x13B
nop
nop
applymovement 0x01 $rivwalk
applymovement 0x03 $compan
pausemove 0
applymovement 0xFF $hr
pausemove 0
trainerbattle 1 0x147 $before $after $further
release
end

#ORG $rivwalk
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0xFE

#ORG $compan
#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0xFE

#ORG $hr
#RAW 0x01
#RAW 0x62
#RAW 0xFE

#ORG $before
$before 1 = Before we leave I want to kick\nyour butt.

#ORG $after
$after 1 = Wha?!

#ORG $further
message $your
boxset 6
applymovement 0x01 $again
applymovement 0x03 $again2
pausemove 0
#raw 0x53
#raw 0x01
#raw 0x00
#raw 0x53
#raw 0x03
#raw ox00
setflag 0x250
fadesound 0x117
nop
nop
setflag 0x209
release
end

#ORG $your
$your 1 = You're better than I thought...\p\v\h01.\p\v\h01.I'll win next time.

#ORG $again
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x13
#RAW 0x10
#RAW 0xFE

#ORG $again2
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x12
#RAW 0x10
#RAW 0xFE
 
Can i post a Gold/Silver scripting problem?

This is a topic to help you with your scripts. It doesn't matter what game it is as long as it's a script. Feel free to post whatever you want.
 
Hi guys!
I made a script and it doesn't work how I wanted (everytime I make a script, the script does do cra*)

I want to check 9 trainers if they're beaten.
If yes, then he says something and moves.
When not, then he only print a message.

Here's the script :

#org $sailor
setflag 0x200
checkflag 0x200
if_B_true goto $checktrainer1

#org $checktrainer1
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer2

#org $checktrainer2
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer3

#org $checktrainer3
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer4

#org $checktrainer4
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer5

#org $checktrainer5
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer6

#org $checktrainer6
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer7

#org $checktrainer7
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer8

#org $checktrainer8
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $checktrainer9

#org $checktrainer9
#raw 0x61 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $allchecked

#org $notchecked
message $0

#ORG $0
$0 1 = It takes some time to travel from one\nplace to an other place.\nIf you're bored off, then ask ym brother.\pMaybe he have some work for you...

#org $allchecked
message $1
applymovement 0x01 $sailormove

#org $1
$1 1 = We're in Vermillion City!\pI hope you enjoyed our travel!\pGo downstairs, if you want to leave the ship.

#org $sailormove
#raw 0x01 0x31 0xFE

You open the rom --> a white background appears (the game froze before the intro).

-----------------------------------------------------------------------------------------------------------------------

I have also a problem with this simple GiveEgg-Script (a person gives you a Dratini Egg and says something) :

#org dratiniegg
lock
faceplayer
message wait
boxset 6
#raw 0x7A 0x93 0x00
release
end

#org $wait
$wait 1 = Hey, [\PLAYER]! Are you leaving now?\nI will miss you. But before you\ngo, I want you to obtain this.\pTake care of it, okay?

-----------------------------------------------------------------------------------------------------------------------

I would be glad if you can help me.
Thanks in Advance.
 
Last edited:
megiddo, I think I found the problem to your script...
the script that worked, well, worked fine, why?
Because the flag 209 isn't set yet, but after the script was finished, the flag was set...

And in the second script, and since the flag 209 was already set, it automatically proceeds to #org $done...
I hope you get what I meant...
Code:
#ORG $begin
checkflag 0x209
if b_true goto $done
checkflag 0x205
if b_true goto $battle
release
end

#ORG $done
release
end

#ORG $battle
playsound 0x13B
nop
nop
applymovement 0x01 $rivwalk
applymovement 0x03 $compan
pausemove 0
applymovement 0xFF $hr
pausemove 0
trainerbattle 1 0x147 $before $after $further
release
end

#ORG $rivwalk
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0xFE

#ORG $compan
#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0xFE

#ORG $hr
#RAW 0x01
#RAW 0x62
#RAW 0xFE

#ORG $before
$before 1 = Before we leave I want to kick\nyour butt.

#ORG $after
$after 1 = Wha?!

#ORG $further
message $your
boxset 6
applymovement 0x01 $again
applymovement 0x03 $again2
pausemove 0
#raw 0x53
#raw 0x01
#raw 0x00
#raw 0x53
#raw 0x03
#raw ox00
setflag 0x250
fadesound 0x117
nop
nop
[U]setflag 0x209[/U]
release
end

#ORG $your
$your 1 = You're better than I thought...\p\v\h01.\p\v\h01.I'll win next time.

#ORG $again
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x13
#RAW 0x10
#RAW 0xFE

#ORG $again2
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x12
#RAW 0x10
#RAW 0xFE
Code:
#ORG $begin
[U]checkflag 0x209
if b_true goto $done[/U]
checkflag 0x207
if b_true goto $battle
release
end

#ORG $done
release
end

#ORG $battle
setflag 0x209
playsound 0x13B
nop
nop
applymovement 0x01 $rivwalk
applymovement 0x03 $compan
pausemove 0
applymovement 0xFF $hr
pausemove 0
trainerbattle 1 0x148 $before $after $further
release
end

#ORG $rivwalk
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0xFE

#ORG $compan
#RAW 0x12
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0xFE

#ORG $hr
#RAW 0x01
#RAW 0x62
#RAW 0xFE

#ORG $before
$before 1 = Before we leave I want to kick\nyour butt.

#ORG $after
$after 1 = Wha?!

#ORG $further
message $your
boxset 6
applymovement 0x01 $again
applymovement 0x03 $again2
pausemove 0
#raw 0x53
#raw 0x01
#raw 0x00
#raw 0x53
#raw 0x03
#raw ox00
setflag 0x250
fadesound 0x117
nop
nop
release
end

#ORG $your
$your 1 = You're better than I thought...\p\v\h01.\p\v\h01.I'll win next time.

#ORG $again
#RAW 0x12
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x13
#RAW 0x10
#RAW 0xFE

#ORG $again2
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x10
#RAW 0x12
#RAW 0x10
#RAW 0xFE
 
No. It was when the 209 was not set. Instead of checking for one starter, it checks for another. Only one event happens.
 
Yeah, boxset 4 does work but the problem with using it is that the message shows up but, you need to press A in order for the script to continue after the message. I want the script to happen like in the game, the greeting comes up and the box with the options pops up instantaneously and by itself.

If I need to insert that into hex, I'm willing to. I'll be more than happy to learn how to.

Well then you'll want 'msgbox2' and 'waitmsgbox'. You'll have to go to an empty spot in the rom and type in text using a table. Let's say you put the text at 0x123456 (just an example). You have to of course have the pointer reversed.
The script would look like this.

Code:
#org $start
lock
faceplayer
#raw 0x67 0x56 0x34 0x12 0x08   'Reversed 08 12 34 56 ; 56 34 12 08
#raw 0x66
pokemart $bla
release
end

#org $bla
#binary int 0x4 0x0
 
Status
Not open for further replies.
Back
Top