• 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.

[Archive] Script help thread

Status
Not open for further replies.
Script freezes the whole game up, its in XSE if you know what is wrong please tell me, and dont just post the revised correct script, tell me why it was wrong.

Spoiler:
Thank you!

There's no need to split your script in all those parts, you're wasting all those goto. Also, after each applymovement(s) you need to put waitmovement.
After each setweather you need to use doweather, or it won't have any effect. After each msgbox/message you need to put callstd/boxset.
The cry command was wrong as well. Don't forget you must use setflag to hide a person permanently. In the fixed script I used flag 0x1001, don't forget to set the People ID accordingly.

Last, but not the lease... since I suppose it's a trigger script (those green "S" you can walk in), make sure you set the values like this:

[PokeCommunity.com] [Archive] Script help thread


Spoiler:


ok i have a script that is supposed to alert someone make them walk to me say somthing then make me follow them then give me a pokemon, i use notepad and pokescript, whenever i put the script in my game all that happens is it puts a ? above hiros head and asks yes or no, either you hit the screen goes pink
WHAT IS WRONG WITH IT:

Spoiler:

If you want you can use XSE, I'm pretty sure your fixed script will work fine:

Spoiler:



Hey I just started scripting and im trying to use a give pokemon script but its messed up when I talk to the guy it says "This tree looks like it can be cut down" heres the script.

Spoiler:


Can anyone help me?

Why not trying XSE? I fixed and adjusted the script for you:

Spoiler:



Ugh. I am sorry for being such a total noob at this, but I cannot get this damned scripting to work for the life of me. I'm also entirely unsure if I'm using XSE correctly, so allow me to throw myself at your mercy and admit my own lack of competence :(

Okay. So I have this PART of a script I'm working with.

Spoiler:


What I'm trying to do exactly is have this character walk into Oak's lab, walk up three spaces and over seven to the left, look up and then talk to him about whatever I choose. Then, select one of the three pokeballs between the two, with that nice little picture popping up and the "DO YOU CHOOSE SO AND SO TO BE YOUR LAWFULLY WEDDED WI--I MEAN POKEMON COMPANION" jazz to go on. However, I can't get the script to work and also, whenever I try to compile it I get two new numbers at the bottom, so I substitute those into the script and then I get two entirely new numbers.

Also, what would you suggest I should use to check for the unused flags? I don't really know what to use to do that.

As I said, I used to know what I was doing and now I do not. I've spent hours examining the scripts in the original game to do so, and I've confused myself into scripted oblivion. Help!

Your script is as confused as you, indeed.
See the fixed one, and hopefully you'll learn something new:

Spoiler:



English:
Exists some command that reads the byte ofrom a pointer in the RAM, and put in an variable to be able to use later (compare, addvar, subvar, …)?
I tried loadpointer (0F) and loadbytefrompointer (12) but they had not functioned.

No, there isn't. What are you trying to do?


Spoiler:


It resets if the player picks Yes, and freezes if the player pick no, on the first question box.

Well, please take a really close look to the fixed script:

Spoiler:
 
Code:
#dynamic 0x211211

#org 0x2DD30A
lock
faceplayer
msgbox 0x82DD400 MSG_NORMAL '"Hah! Hah! Hey there, kid! People\n..."
trainerbattle 0x1 0xB7 0x0 0x82DD445 0x82DD4C5 0x82DD328
end

'---------------
#org 0x2DD328
msgbox 0x82DD69F MSG_NORMAL '"Haha...You got lucky kid. That was..."
release
compare PLAYERFACING 0x2
if 0x0 goto 0x82DD71E
goto 0x82DD727

'---------------
#org 0x2DD71E
applymovement 0x5 0x82DDCF2
end

'---------------
#org 0x2DD727
applymovement 0x5 0x82DDCE9
end


'---------
' Strings
'---------
#org 0x2DD400
= Hah! Hah! Hey there, kid! People\ncall me the King of the Mountain!

#org 0x2DD445
= So what do you want?\p...\pWhat? You want to pass? Hah.\nAlright then.\pIf you, puny little kid, can beat\nme, I'll let you pass!\l

#org 0x2DD4C5
= No way!

#org 0x2DD69F
= Haha...You got lucky kid. That was\nmy weak team.\pA deal's a deal, I'll let you\npass.\pThis won't be the last time you\nsee me!


'-----------
' Movements
'-----------
#org 0x2DDCF2
#raw 12 'Step Left (Normal)
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 60 'Hide
#raw FE 'End of Movements

#org 0x2DDCE9
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 60 'Hide
#raw FE 'End of Movements
He doesn't move after the battle. Message, but no movement. :\
 
Ninja Caterpie, I think he doesn't move, because there isn't any waitmovement 0x0 under the applymovement commands
 
I'm trying my damned hardest but I'm just not figuring this out somehow.

#dynamic 0x801111
#org @start
lock
faceplayer
checkflag 0x1000
if b_true goto @snorlax
message @bulbasaur
boxset 6

#org @bulbasaur
= You received a BULBASAUR!
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
setflag 0x1000
release
end

#org @snorlax
release
end

That should make a Snorlax give you a bulbasaur lv.5 (don't ask) and not give you one again when you talk to this person, but when I compile it I get a few numbers (one for snorlax, start and bulbasaur). I'm not sure what to do with them and I'm not really ever getting any answers that help me out since I'm at a total loss when I try to script. Help?
 
I'm trying my damned hardest but I'm just not figuring this out somehow.

#dynamic 0x801111

#org @start
checkflag 0x1000
if b_true goto @snorlax
message @bulbasaur
boxset 2
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
setflag 0x1000
release
end

#org @bulbasaur
= You received a BULBASAUR!


#org @snorlax
release
end


That should make a Snorlax give you a bulbasaur lv.5 (don't ask) and not give you one again when you talk to this person, but when I compile it I get a few numbers (one for snorlax, start and bulbasaur). I'm not sure what to do with them and I'm not really ever getting any answers that help me out since I'm at a total loss when I try to script. Help?

The fixes are in Bold. Try it, and I advise you to look around some tutorials.
 
Code:
'---------------
#org 0x2DDCFC
faceplayer
msgbox 0x82DD400 MSG_NORMAL '"Hah! Hah! Hey there, kid! People\n..."
trainerbattle 0x1 0xB7 0x0 0x82DD445 0x82DD4C5 0x82DD328
end

'---------------
#org 0x2DD328
msgbox 0x82DD69F MSG_NORMAL '"Haha...You got lucky kid. That was..."
compare PLAYERFACING 0x2
if 0x0 goto 0x82DD9B5
goto 0x82DDB58

'---------------
#org 0x2DD9B5
applymovement 0x5 0x82DDD23
waitmovement 0x0
end

'---------------
#org 0x2DDB58
applymovement 0x5 0x82DDCE9
waitmovement 0x0
end


'---------
' Strings
'---------
#org 0x2DD400
= Hah! Hah! Hey there, kid! People\ncall me the King of the Mountain!

#org 0x2DD445
= So what do you want?\p...\pWhat? You want to pass? Hah.\nAlright then.\pIf you, puny little kid, can beat\nme, I'll let you pass!\l

#org 0x2DD4C5
= No way!

#org 0x2DD69F
= Haha...You got lucky kid. That was\nmy weak team.\pA deal's a deal, I'll let you\npass.\pThis won't be the last time you\nsee me!


'-----------
' Movements
'-----------
#org 0x2DDD23
#raw 12 'Step Left (Normal)
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 60 'Hide
#raw FE 'End of Movements

#org 0x2DDCE9
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 60 'Hide
#raw FE 'End of Movements

Still not working. :\

but when I compile it I get a few numbers (one for snorlax, start and bulbasaur). I'm not sure what to do with them and I'm not really ever getting any answers that help me out since I'm at a total loss when I try to script. Help?
Copy the one for start and put it into the "script offset" slot for the person event in AM.
 
Last edited:
Spoiler:

Still not working. :\

Indeed. You're not comparing the PLAYERFACING var correctly.

Code:
compare PLAYERFACING 0x2
if B_TRUE goto 0x82DD9B5

- or -

Code:
compare PLAYERFACING 0x2
if 0x1 goto 0x82DD9B5
 
No, there isn't. What are you trying to do?

English:
I want to read the current value of HP of pokémon team, and later being able to add/to sub some value from it.

Portuguse:
Eu quero ler o valor atual de HP dos pokémon da equipe, e depois poder adicionar/subtrair algum valor dele.
 
How would I go about making clock-based events and scripts in Ruby?
Is there a special or a command?
Also is there a command or way to make a script where the main player's OW changes? (Just like in CBM's Prism)
 
Also is there a command or way to make a script where the main player's OW changes? (Just like in CBM's Prism)

Yah, there's a super-secret way to change the OW via a level script. :\ Ask Darthatron to explain it, as I'm not really any good at it. :-)
 
whats wrong with this script? it is supposed to give me pokemon then activate both pokedex's, but it freezes, and yes i set the value to...
0003
4050
0000
0000



#org $start
lock
checkflag 0x217
if b_true goto $released
applymovement 0x04 $moveexclam
pause 0x7
applymovement 0xFF $moveexclam
pause 0x7
applymovement 0x04 $walktome
pausemove 0
applymovement 0x04 $finishwalk
pausemove 0
message $yourawake
boxset 6
applymovement 0x04 $computerroom
pausemove 0
applymovement 0xFF $computerroom
pausemove 0
message $pokemon
boxset 6
givepokemon 151 5 1
fanfare 0x13E
waitfanfare
message $11
boxset 2
fanfare 0x13E
message $22
boxset 6
setflag 0x829
special 0x16F
waitfanfare
setflag 0x209
setflag 0x828
setflag 0x217
message $goodluck
boxset 6
release
end

#org $released
release
end

#org $11
$11 1 = Oh, and he also left this for you.

#org $22
$22 1 = You received a PokeDex!
.
#org $moveexclam
#raw 0x63 0x62 0xFE

#org $walktome
#raw 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1E
0x1E 0x1E 0xFE

#org $finishwalk
#raw 0x20 0x1E 0x13 0x13 0xFE

#org $computerroom
#raw 0x12 0x12 0x12 0x12 0x10 0x10 0x10
#raw 0x10 0x10 0x10 0x13 0x13 0x13 0xFE

#org $yourawake
$yourawake 1 =Oh! Hey, \v\h01! I see you finnally\ndecided to wake up your DAD\lbrought you something but you wouldnt\lwake up.

#org $pokemon
$pokemon 1 =Here \v\h01! this is your 1st POKEMON\nYour DAD wanted you to have it\lYou can start your journey now.

#org $goodluck
$goodluck 1 =Good Luck!!\nTo lilfabbro! Okay This should be working\lHowever I may have forgot to\lset some variables.\lI can fix those after a next patch\lOr you can tell me what\lyou think.
 
whats wrong with this script? it is supposed to give me pokemon then activate both pokedex's, but it freezes, and yes i set the value to...
0003
4050
0000
0000



#org $start
lock
checkflag 0x828
if b_true goto $released
applymovement 0x04 $moveexclam
pause 0x7
applymovement 0xFF $moveexclam
pause 0x7
applymovement 0x04 $walktome
pausemove 0
applymovement 0x04 $finishwalk
pausemove 0
message $yourawake
boxset 6
applymovement 0x04 $computerroom
pausemove 0
applymovement 0xFF $computerroom
pausemove 0
message $pokemon
boxset 6
givepokemon 151 5 1
fanfare 0x13E
waitfanfare
message $11
boxset 2
fanfare 0x13E
message $22
boxset 6
setflag 0x829
special 0x16F
waitfanfare
setflag 0x828
message $goodluck
boxset 6
release
end

#org $released
release
end

#org $11
$11 1 = Oh, and he also left this for you.

#org $22
$22 1 = You received a PokeDex!
.
#org $moveexclam
#raw 0x63 0x62 0xFE

#org $walktome
#raw 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1E
0x1E 0x1E 0xFE

#org $finishwalk
#raw 0x20 0x1E 0x13 0x13 0xFE

#org $computerroom
#raw 0x12 0x12 0x12 0x12 0x10 0x10 0x10
#raw 0x10 0x10 0x10 0x13 0x13 0x13 0xFE

#org $yourawake
$yourawake 1 =Oh! Hey, \v\h01! I see you finnally\ndecided to wake up your DAD\lbrought you something but you wouldnt\lwake up.

#org $pokemon
$pokemon 1 =Here \v\h01! this is your 1st POKEMON\nYour DAD wanted you to have it\lYou can start your journey now.

#org $goodluck
$goodluck 1 =Good Luck!!\nTo lilfabbro! Okay This should be working\lHowever I may have forgot to\lset some variables.\lI can fix those after a next patch\lOr you can tell me what\lyou think.

You can't use that many setflags in one script
so I got it to run off the opkemon script and pokedex script
 
You can use a lot of flags. I used 20 flags in a script once.

>Lilfabro: I really can't think of anything wrong now, but check for any grammatical mistakes in the commands. Also, the applymovement 0x04, are you sure the person's event number is 4?
 
You can use a lot of flags. I used 20 flags in a script once.

>Lilfabro: I really can't think of anything wrong now, but check for any grammatical mistakes in the commands. Also, the applymovement 0x04, are you sure the person's event number is 4?

The script wouldn't freeze if the people number was different anyway
 
I didn't say that. I told him before to put it 0x01, and the person moved. I don't know why it's 0x04 now.

Lilfabro: Try recompiling the script, if not, then simple use XSE.
 
thank you

Mac- i know weve had our ups and downs but i appreciate the help, i am going to try doing changing the 0x04 to 0x01 tho or what ever the persons event no is thoe, because hiche is the one who made half of that script for me lol, so ill try it, and ill let you know if it worked so you dont have to do all that work if its not required

i dont know were i copied that script from above i think its one i was messing with but this is the script that doesnt work:
#org $start
lock
checkflag 0x217
if b_true goto $released
applymovement 0x01 $moveexclam
pause 0x7
applymovement 0xFF $moveexclam
pause 0x7
applymovement 0x01 $walktome
pausemove 0
applymovement 0x01 $finishwalk
pausemove 0
message $yourawake
boxset 6
applymovement 0x01 $computerroom
pausemove 0
applymovement 0xFF $computerroom
pausemove 0
message $pokemon
boxset 6
givepokemon 151 5 0
fanfare 0x13E
waitfanfare
message $11
boxset 2
fanfare 0x13E
message $22
boxset 6
setflag 0x829
special 0x16F
waitfanfare
setflag 0x209
setflag 0x828
setflag 0x217
message $goodluck
boxset 6
release
end

#org $released
release
end

#org $11
$11 1 = Oh, and he also left this for you.

#org $22
$22 1 = You received a PokeDex!
.
#org $moveexclam
#raw 0x63 0x62 0xFE

#org $walktome
#raw 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1E
0x1E 0x1E 0xFE

#org $finishwalk
#raw 0x20 0x1E 0x13 0x13 0xFE

#org $computerroom
#raw 0x12 0x12 0x12 0x12 0x10 0x10 0x10
#raw 0x10 0x10 0x10 0x13 0x13 0x13 0xFE

#org $yourawake
$yourawake 1 =Oh! Hey, \v\h01! I see you finnally\ndecided to wake up your DAD\lbrought you something but you wouldnt\lwake up.

#org $pokemon
$pokemon 1 =Here \v\h01! this is your 1st POKEMON\nYour DAD wanted you to have it\lYou can start your journey now.

#org $goodluck
$goodluck 1 =Good Luck!!\nTo lilfabbro! Okay This should be working\lHowever I may have forgot to\lset some variables.\lI can fix those after a next patch\lOr you can tell me what\lyou think.
 
Last edited:
Could inform which optimum interpreter to me assembly for format GBA?

It depends on you, I may suggest you the GoldRoad assembler.


How would I go about making clock-based events and scripts in Ruby?
Is there a special or a command?

What about decompiling some in-game script? There are a lot of working examples :)


Mac- i know weve had our ups and downs but i appreciate the help, i am going to try doing changing the 0x04 to 0x01 tho or what ever the persons event no is thoe, because hiche is the one who made half of that script for me lol, so ill try it, and ill let you know if it worked so you dont have to do all that work if its not required

i dont know were i copied that script from above i think its one i was messing with but this is the script that doesnt work:
Spoiler:

Well, you may want to try this script with XSE. Don't forget to set 1001 as People ID.

Spoiler:


Edit: just to let you know, the guy got his script working fine thanks to my help, no further help needed so far :)
 
Last edited:
How would I go about making clock-based events and scripts in Ruby?
Is there a special or a command?
Also is there a command or way to make a script where the main player's OW changes? (Just like in CBM's Prism)

Try using XSE To open up the script for the Berry Master's Wife in Ruby Version.
Follow the script through and read it, to find out the 24 hour based Flag.
(I would just tell you it, but I lost my list of clock based flags... I had an entire list made up...)
The Berry Master's Wife is just 1 of the flags that run on the 24hour clock, There are a bunch more, (Like the lottery one, and the Berry Master himself) Look around for them. (I know this is the same thin HackMew said,, but I wanted to give the person somewhere to start looking you know?)
 
Status
Not open for further replies.
Back
Top