• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Advanced Scripting Tutorial

Status
Not open for further replies.

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Not meaning to spam you guys but I've posted an alternative scripting program of my own design in the toolbox. Because it's a complete rewrite it shouldn't have the same bugs that scripted used to have and should be much easier to use.

Please, give it a shot using the script you're having difficulty with and give me feedback!

And you shouldn't need to put that raw statement before the trainerbattle command either.

Not to go off-topic or anything, but I can't figure out how to use PokeScript. What am I supposed to type in on the line after this: http://members.westnet.com.au/comhloiche (I don't know why that became a link.)
I tried typing in the name of my ROM, but it just said: Invalid Command : PKMNRuby.gba
EDIT: I got everything to work doing what you suggested Irish Witch, and everything worked except when I talk to the person again no text comes up. It still makes the noise when I press A but no text comes up.

For the offset that has the message, "So, you caught anything yet?", you should put 802100 but I just saw 02100.
 
Last edited:

Irish Witch

Office Jenny
147
Posts
17
Years
Not to go off-topic or anything, but I can't figure out how to use PokeScript. What am I supposed to type in on the line after this: <url> (I don't know why that became a link.)
I tried typing in the name of my ROM, but it just said: Invalid Command : PKMNRuby.gba

?? huh ??

Once you've downloaded both the main program and the pkmadv database from my site and installed them the program everything should run from file associations.. Did you read the about section?
In explorer you make youre script using notepad, then in explorer you right mouse click and click compile. A .buf file will be created. It will open in a program that behaves similar to diamond cutter but this is designed to actually insert you're script. if you want to change the offsetts used then use 'destination' from the file menu then click on the offsetts and assign them using the button that has a book on it. You can select multiple offsetts. When done select 'burn' from the file menu.

If you're offsetts from you're script are already the ones you want to use then just select 'burn' from the file menu and tell it the name of the rom.


It's all explained on the web site! And in much better detail then I intend to do here!

- EDIT -
oh, I just checked the post. I wasn't able to put the links on my post in the toolbox so I didn't know he hadn't posted a direct link to the pkmadv database in there. You must get that from the download section to work with rubikon. My program is designed to be usable with multiple scripting engines. It's just that I only have one right now!

There is a way to burn your script directly to rom without using Bufrite but I won't go into that here!
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Not to go off-topic or anything, but I can't figure out how to use PokeScript. What am I supposed to type in on the line after this: <url> (I don't know why that became a link.)
I tried typing in the name of my ROM, but it just said: Invalid Command : PKMNRuby.gba

?? huh ??

Once you've downloaded both the main program and the pkmadv database from my site and installed them the program everything should run from file associations.. Did you read the about section?
In explorer you make youre script using notepad, then right mouse click and click compile. A .buf file will be created. It will open in a program that behaves similar to diamond cutter but this is designed to actually insert you're script. if you want to change the offsetts used then use 'destination' from the file menu then click on the offsetts and assign them using the button that has a book on it. You can select multiple offsetts. When done select 'burn' from the file menu.

If you're offsetts from you're script are already the ones you want to use then just select 'burn' from the file menu and tell it the name of the rom.


It's all explained on the web site! And in much better detail then I intend to do here!

- EDIT -
oh, I just checked the post. I wasn't able to put the links on my post in the toolbox so I didn't know he hadn't posted a direct link to the pkmadv database in there. You must get that from the download section to work with rubikon. My program is designed to be usable with multiple scripting engines. It's just that I only have one right now!

There is a way to burn your script directly to rom without using Bufrite but I won't go into that here!

The only part I didn't understand from that was the when you said to click Compile. There is no Compile command in NotePad or PokeScript.
 

Irish Witch

Office Jenny
147
Posts
17
Years
let me rephrase that paragraph.

Once you've downloaded both the main program and the pkmadv database from my site and installed them the program everything should run from file associations.. Did you read the about section?
In explorer you make youre script using notepad, then in explorer you right mouse click and click compile. A .buf file will be created. It will open in a program that behaves similar to diamond cutter but this is designed to actually insert you're script. if you want to change the offsetts used then use 'destination' from the file menu then click on the offsetts and assign them using the button that has a book on it. You can select multiple offsetts. When done select 'burn' from the file menu.

The window that loads up when you run pokescript is the 'Instant Window'.
You can put commands in there but I added the file associations to make it easier...

*sigh*

If you wanted to compile a script from inside script ed you would type:
#encode "drive: \path that can use long file names\script file.rbc" ' or whatever

then if you wanted to stay inside pokescript you could assign/reassign offsetts using the function
#kapush offsettname 0xlocation

and write it using
#kapop "path to rom\rom file.gba"


but it's easier using the file associations.

- Edit -
Various modifications..

*signs again*

Why can't men read the instructions!

AND MAKE SURE YOU DOWNLOAD THE DATABASE!

*signs*

- Edit Again -
And before anybody asks why the instant window is so complicated...
I use the words BETA TEST.
The instant window displays a log of the compilers activities and acts as a way to pass commands directly to the compiler. The compiler can handle decoding both code and text. I late intend to create a picture editor then I will pull all those components into the one program with a proper text editor but for now the instant window provides access to the program and the file associations makes it so easy to use that scripted pales in comparison.

.. or so I thought!
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Well so-o-orry for being a male!....I'm just kidding. Anyway, thanks. I figured it out. The only problem is I talk to the person who's supposed to battle me, and it just comes up with a bunch of weird symbols in the text box (hex symbols probably) that won't stop. Is is because I put the raw command in the trainerbattle? Because IrishWitch said that it doesn't need the raw command. I'll try getting rid of that and I'll see what I get.

And also, I have this script testing out flags:
Code:
#org 0xB00000
lock
faceplayer
checkflag 0x364
compare LASTRESULT 0x1
if 0x1 goto 0xB00200
message 0xB00100
boxset 0x6
release
end

#org 0xB00200
message 0xB00300
boxset 0x6
end

#org 0xB00100
= Hello.

#org 0xB00300
= Goodbye.

But he only says Hello each time. He never says Goodbye.

EDIT: I noticed that whenever I put setflag 0x364 in the script, he still doesn't say goodbye, but when I enter another map and come back to the map he was in, he isn't there anymore.
 
Last edited:

Irish Witch

Office Jenny
147
Posts
17
Years
And also, I have this script testing out flags:
Code:
#org 0xB00000
lock
faceplayer
checkflag 0x364
compare LASTRESULT 0x1
if 0x1 goto 0xB00200
message 0xB00100
boxset 0x6
[B]setflag 0x364[/B]
release
end

#org 0xB00200
message 0xB00300
boxset 0x6
end

#org 0xB00100
= Hello.

#org 0xB00300
= Goodbye.

But he only says Hello each time. He never says Goodbye.

EDIT: I noticed that whenever I put setflag 0x364 in the script, he still doesn't say goodbye, but when I enter another map and come back to the map he was in, he isn't there anymore.

Those question in reverse order:
Firstly in the above script I see you checking a flag but I don't see you setting a flag? Note the section I put in bold! You can't check it if you don't set it. Also, you may not want to use offsett 364.. I don't know all of them but a lot of the offsetts that high up are reserved for system events. I don't know if that one is so you can try it, i'm just making an observation.

I would also like to point out that if you give the person on the map a 'person no' or in other words a flag then when you set it in your script and perform a callstd 0x1 or whatever then the person will vanish from the map like you discribed!

Second, yes you don't need the #raw 5c when using my program....
... A little technobabble.
Trainerbattle is actually listed in scripted as a construct and the construct handlers were dogdy in scripted.
When scripted compiled the command trainerbattle it forgot to translate the word 'trainerbattle' into the byte 5C so a command that should have read in a hex editor as: (using your example)

5c 00 1A 00908208 00008308 00108308
read as
00 1A 00908208 00008308 00108308

thats why you needed to put #raw 5C at the beginning. You don't need that now though cause doing so in my program results in

5c 5c 00 1A009082 08000083 08001083 08

stopping those pointers going where they are meant to.
And causing the link to the trainer (byte two of the above string) to point to the wrong person!


- EDIT -

Everything I said above is true, but I actually just found a bug with that command in my program. Re download the command database in ten minutes or so. I'm uploading the fixed database now!
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
I used this script instead:

Code:
#org 0xB00000
lock
faceplayer
checkflag 0x10A
compare LASTRESULT 0x1
if 0x1 goto 0xB00200
message 0xB00100
boxset 0x6
setflag 0x10A
release
end

#org 0xB00200
message 0xB00300
boxset 0x6
end

#org 0xB00100
= Hello.

#org 0xB00300
= Goodbye.

And it still doesn't work! I absolutely HATE scripting!
 

Irish Witch

Office Jenny
147
Posts
17
Years
Alright. Now this is why I needed beta testers. Let me play with this for a bit!

AH HA!. There be a glitch in my program after all!

(and here I thought I got things right.)
Check back here in 24 hrs and I'll have the glitch sorted. It's to do with the horrid LASTRESULT being defined as meaning 0x800D
... It's throwing out the script because that value turns into a negative number and my prrogram doesn't know how to read it!
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
In applymovement scripts, how do I make the player move along with another person? (Like when the PokeMart person takes you to the PokeMart.)
 

D-Trogh

Dead
439
Posts
18
Years
In applymovement scripts, how do I make the player move along with another person? (Like when the PokeMart person takes you to the PokeMart.)
Well.. This is what I do when I want to see how certain scripts/functions(/things..) work: I CHECK them through ScriptEd..
In the spoiler you have a script, look through it. It's from Oldale Town, with the movements..
When you want to see other thing, go to those offsets and CHECK them ;)
Spoiler:

! In the original content of ScriptEd there were more spaces.. !

Edit:
Well..Some base-scripts from the game are so, so,.. well.. 'call this', 'call that'.. -BLAH-
But you can see you need to use an 'applymovement' both on the person and on the player.. ;)
 
Last edited:

Irish Witch

Office Jenny
147
Posts
17
Years
UPDATE

MAJOR update to main program!
Glitch in #alias command that meant all constructs were not being performed correctly.
(also minor bug involving large values not reading correctly!)
FIXED!


0400hrs... I'm going to bed now!
Play with program.. Report back in toolbox thread!
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Well.. This is what I do when I want to see how certain scripts/functions(/things..) work: I CHECK them through ScriptEd..
In the spoiler you have a script, look through it. It's from Oldale Town, with the movements..
When you want to see other thing, go to those offsets and CHECK them ;)
Spoiler:

! In the original content of ScriptEd there were more spaces.. !

Edit:
Well..Some base-scripts from the game are so, so,.. well.. 'call this', 'call that'.. -BLAH-
But you can see you need to use an 'applymovement' both on the person and on the player.. ;)

I would've checked if I knew how to. I don't know how to find scripts by using their offsets. And I did use applymovement on both the player and person, but the person moved first, and then the player moved after the person was done moving. Here's the script:

Code:
#org 0xC00000
applymovement 0x1 0xC00100
pause 0x50
applymovement 0xFF 0xC00200
pause 0x10
message 0xC00300
boxset 0x6
release
applymovement 0x1 0xC00400
pause 0x160
applymovement 0xFF 0xC00500
pause 0x160
applymovement 0x1 0xC00600
pause 0x10
end

#org 0xC00100
#raw 0x9
#raw 0x9
#raw 0x9
#raw 0x9
#raw 0xFE

#org 0xC00200
#raw 0x1D
#raw 0xFE

#org 0xC00300
= Don't go out there! It's dangerous\nif you don't have any Pokemon.\pCome with me.

#org 0xC00400
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0xFE

#org 0xC00500
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0xFE

#org 0xC00600
#raw 0x1E
#raw 0xFE
 
6,355
Posts
18
Years
  • Seen Apr 16, 2020
If you don't put a pause after the first "applymovement" command, both player and the other sprite will move together. The "pause" will be for both movements.
 

D-Trogh

Dead
439
Posts
18
Years
I would've checked if I knew how to. I don't know how to find scripts by using their offsets. And I did use applymovement on both the player and person, but the person moved first, and then the player moved after the person was done moving. Here's the script:

Code:
#org 0xC00000
applymovement 0x1 0xC00100
pause 0x50
applymovement 0xFF 0xC00200
pause 0x10
message 0xC00300
boxset 0x6
release
applymovement 0x1 0xC00400
pause 0x160
applymovement 0xFF 0xC00500
pause 0x160
applymovement 0x1 0xC00600
pause 0x10
end

#org 0xC00100
#raw 0x9
#raw 0x9
#raw 0x9
#raw 0x9
#raw 0xFE

#org 0xC00200
#raw 0x1D
#raw 0xFE

#org 0xC00300
= Don't go out there! It's dangerous\nif you don't have any Pokemon.\pCome with me.

#org 0xC00400
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0xFE

#org 0xC00500
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0x8
#raw 0xFE

#org 0xC00600
#raw 0x1E
#raw 0xFE
Looking for scripts is simple.. You know in ScriptEd the path above..
It's like: YourRom.gba:800000
Just change the '800000' to another offset and voilá.. You have it.



Again, I'll try to help you with my basic scripting skills:
Why don't you delete the 'pause' between the 'applymovement' of the player and person ? Just try it..
What with the other 'pause' you'll ask.
Well, it would be logical if you put a 'pause' after the 2 'applymovement's wich:
1. Is the sum of all the movements
2. Is only the number in function of the person who moves the most.
[When the player had only 1 movement, but the person has 3, use 'pause for3movement' (I don't know how to count the movements)]

Edit:
Christos was first..
Btw, could you try the 2 possibilities ? Than I know what to use too ^^
 

zak

xpert trainer
244
Posts
19
Years
,,,,,,,,

Looking for scripts is simple.. You know in ScriptEd the path above..
It's like: YourRom.gba:800000
Just change the '800000' to another offset and voilá.. You have it.



Again, I'll try to help you with my basic scripting skills:
Why don't you delete the 'pause' between the 'applymovement' of the player and person ? Just try it..
What with the other 'pause' you'll ask.
Well, it would be logical if you put a 'pause' after the 2 'applymovement's wich:
1. Is the sum of all the movements
2. Is only the number in function of the person who moves the most.
[When the player had only 1 movement, but the person has 3, use 'pause for3movement' (I don't know how to count the movements)]

Edit:
Christos was first..
Btw, could you try the 2 possibilities ? Than I know what to use too ^^


i didnt know you could open up scripts already in the game, thanks alot im gonna learn every script i can ! thanks so much!


Edit: hmmm when i open the rom it doesent say YourRom.gba:800000 in the path above.... infact it says nothing..........am i doing something rong?
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Next to where it says File, you type (Your ROM).gba: (the offset you want to search for) and it should come up. And also....

FINALLY! The setflag works! I looked at another script that had a setflag and that guided me. Just in case anyone needs help with setflags, I'll post the script so you get a good idea of what to do.

Code:
#org 0xB00000
lock
faceplayer
checkflag 0x10A
if 0x1 jump 0xB00200
message 0xB00100
boxset 0x4
setflag 0x10A
release
end

#org 0xB00200
lock
faceplayer
message 0xB00300
boxset 0x6
release
end

#org 0xB00100
= Hello.

#org 0xB00300
= Goodbye.
 

D-Trogh

Dead
439
Posts
18
Years
Good to hear it works, but I think you can delete the 'lock' & 'faceplayer' at your #org 0xB00200
 

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
I guess it doesn't really matter if I do since it works anyway. Oh, and I have another question. When you use a givepokemon script, how can you make the "receive Pokemon" music play when you do that?

EDIT: Oh, great. Another problem with flags. There's probably a problem because I haven't done flags with giving Pokemon before. This is the script:

Code:
#org 0xD00000
lock
faceplayer
message 0xD00100
boxset 0x5
compare LASTRESULT 0x1
if 0x1 goto 0xD00200
message 0xD00300
boxset 0x6
release
end

#org 0xD00200
lock
faceplayer
checkflag 0x10A
if 0x1 jump 0xD00500
message 0xD00400
boxset 0x6
setflag 0x10A
givepokemon 0x1 0x5 0x0
release
end

#org 0xD00500
lock
faceplayer
message 0xD00600
boxset 0x6
release
end


#org 0xD00100
= I really like Bulbasaur. Do you?

#org 0xD00400
= You do? Great! Then you deserve to get\none!\p\v\h01 received the BULBASAUR!

#org 0xD00300
= You don't? Too bad.


#org 0xD00600
= How's that BULBASAUR coming along?

He does say "How's that Bulbasaur coming along?" after I receive it, but he also does after I answer No. How do I get it to happen only if he says Yes?
 
Last edited:

D-Trogh

Dead
439
Posts
18
Years
You should put the checkflag in the first part too..
When you got the Bulba, you won't say 'No, I don't like him..'
Ow.. but that's not the problem right ?
Do you mean the flag is set after you say 'No' too ? Hmm..
I don't really get your question.. And I don't see any errors..
-Meh-
Can you upload a video on YouTube or something ?
Or just tell me what happens when you:
- First talk to him.
- Chose 'No'
- Talk to him again
- Chose 'Yes'
- Talk to him again (You should make a new flag, when yes is checked, you don't get the question anymore..)
 

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Okay, here's what happens.

1. I say Yes to him and get Bulbasaur.
2. I talk to him and he asks how it's doing.
3. I reset the ROM.
4. I say No to him.
5. I talk to him and he asks how it's doing even thought I don't even have it yet. So that would mean that I'd never get the chance to get it if I say No.

Do you understand now?
 
Status
Not open for further replies.
Back
Top