• 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.
For pokemart, use the command pokemart (offset or dynamic label) where you want the shop to open, and after the rest of the script add a string with the offset or label you used above. Under that, use #raw word 0x(hex of item index number) to have the item in the shop. Number of items is just based on how many you put in, and price is stored in the item itself, so to edit that you need to change the item around. At the end of the items, add #raw word 0x0 to end the mart. This is a sample script of a pokemart, it has 2 mart strings though because one of them doesn't sell pokeballs for an early part of the game. It should still show you how it works, though.

Spoiler:


hi again, is there a way to turn off auto-decompilation or something? because everytime i open a script, it is already de-compiled (even if i didn't click the button)

No there isn't, and I don't see why you'd want it to remain compiled. The compilation puts the script into hex form, so leaving it compiled would give you a hex string. If you mean it removes the dynamic labels, either save your scripts in dynamic form for easy editing later, or manually delete the offsets and type in dynamic labels.
 
Last edited:
Thanks PeregrineFig, that was exactly what I need.
I didnt use your script though but i made my own, just a little simpler for me. It also works.
I dunno how to make the "Spoiler" box so ill just keep it like this.

#org $script
lock
faceplayer
message $access
$access 1 = Would you like to buy/sell something?
boxset 5
compare 0x800D 0x0001
if 0x01 goto $gomart
if 0x00 goto $cyal8r
release
end

#org $gomart
lock
faceplayer
pokemart $martitems
release
end

#org $martitems
#raw word 0x4
#raw word 0xD
#raw word 0x22
#raw word 0x1
#raw word 0x44
#raw word 0x43
#raw word 0x41
#raw word 0x54
#raw word 0x00

#org $cyal8r
message $bye
$bye 1 = Have a nice day!
boxset 6
release
end
 
Last edited:
#Dynamic 0x34EBFF
#org @start
lock
faceplayer
Message @start 0x6
= Hello!, I'm here to help\nSo take this!
givepokemon 0x6 0x100
setflag 0x828
release
end


Everytime I try to compile it. it says
"Too less parameters on line 7. The correct number is 6"
 
#Dynamic 0x34EBFF
#org @start
lock
faceplayer
Message @start 0x6
= Hello!, I'm here to help\nSo take this!
givepokemon 0x6 0x100
setflag 0x828
release
end


Everytime I try to compile it. it says
"Too less parameters on line 7. The correct number is 6"
Spoiler:


Always put 3 random 0x0's after the givepokemon stuff.
 
#Dynamic 0x34EBFF
#org @start
lock
faceplayer
msgbox @start (cannot be used since you already used @start. Change it to something else) 0x6
givepokemon 0x6 0x64 (if you want level 100 pokemon) and those 3 0x0 Buizark mentioned.
setflag 0x828
release
end

#org @(the same something you're gonna put into msgbox's @)
= Hello!, I'm here to help\nSo take this!


Everytime I try to compile it. it says
"Too less parameters on line 7. The correct number is 6"
Aside from the fact that givepokemon is wrong you have wrong text string.
Fixed in bold.
 
#Dynamic 0x34EBFF
#org @start
lock
faceplayer
msgbox @Hello 0x6
givepokemon 0x6 0x64 0x0 0x0 0x0
setflag 0x828
release
end

#org @Hello
=Hello!, I'm here to help\nSo take this!



Thats what I'm using, and it still says "Too less parameters on line 6. The correct number is 6
 
#Dynamic 0x34EBFF
#org @start
lock
faceplayer
msgbox @Hello 0x6
givepokemon 0x6 0x64 0x0 0x0 0x0
setflag 0x828
release
end

#org @Hello
=Hello!, I'm here to help\nSo take this!

Thats what I'm using, and it still says "Too less parameters on line 6. The correct number is 6

You need another parameter on the fifth line. IIRC, you need what Pokemon it is, the level, and what item, and then the 0x0 0x0 0x0. Also, I want to know why you have a flag being set but no checkflag in the beginning. If you leave it that way, the player can just talk to this guy repeatedly and get a free Pokemon every time.
 
Edit2: NVM I DID IT!!!! YAAAAAAAAY THANK YOU, I LOVE YOU
Edit: Could you fix the flag thing please xD
 
I am using PokeScript, not XSE btw.

I want to make a script like the one where Oak takes you into his lab.
There is warp involved in this script, but a script ends when you warp.
I have tried making a new script box next to the door in my hack, but it will not work until I have stepped off it and back onto it again.
Does anyone know what you have to do to make this work?
 
I am using PokeScript, not XSE btw.

I want to make a script like the one where Oak takes you into his lab.
There is warp involved in this script, but a script ends when you warp.
I have tried making a new script box next to the door in my hack, but it will not work until I have stepped off it and back onto it again.
Does anyone know what you have to do to make this work?

You need to do levelscript for it which is more advanced part of scripting and without xse it can be really pain to do it
 
You should really use XSE, it's so much better than PokeScript.
Level scripts are actually fairly easy, here's a quick rundown of how to do it:

1) Add a level script in the map header tab with type 02 (the validates values thing) to your map, now pick an unused variable, any var should work. Set this var to the level script's "flag", and leave the value 0000.
2) Create and compile the script you want to use just like a normal script. Make sure somewhere in it you use a setvar with the var you're using on the level script, and set it to 0x1 (though any value other than 0000 would work). Put the offset in the level script's script 2 box, and hit save map scripts.
3) In the header section of AdvanceMap, hold ctrl and press H, and copy the offset in the map script offset box. Paste it into XSE's decompile box, but before clicking the decompile button, hit the little button next to it, marking it as a level script. Find where it says #raw word 0xFFFF after decompiling. Now change the 0xFFFF to 0x0 and hit compile.

That's it, now go test your level script.
 
I know how to do level scripts perfectly fine, I just want to know how to make the script continue after you have warped.

Here's a rundown of what I want to do:

#Step on a level script and make the player walk through the door.
#Activate the warp.
#Continue walking after I have entered the next room.
 
I know how to do level scripts perfectly fine, I just want to know how to make the script continue after you have warped.

Here's a rundown of what I want to do:

#Step on a level script and make the player walk through the door.
#Activate the warp.
#Continue walking after I have entered the next room.

You can't continue a script after a warp. Instead, you put a level script in the map you're warped to.

EDIT: You might want to check Oak/Birch's scripts for examples.
 
Last edited:
I have tried warping onto a square with a level script on it, but it will not activate until I have stepped off it and on to it again.
 
I'm trying to use a warp/level script, but everytime I warp there I'm frozen and the level script dosen't happen. I'm using XSE and the scripts are:

Warp Script:
Spoiler:


Level Script
Spoiler:
 
Make sure your level script is type 02. Then, hold ctrl and press H while in the map header tab, and copy the offset where it says map script offset. Paste it into XSE's decompile box, then hit the little button next to the decompile button, then hit decompile. There's probably a line saying #raw word 0xFFFF (or possibly some other value). Change it to #raw word 0x0, then hit compile and try testing again.
 
Thank you so much, it is much appreciated!

If you copy the script offset into the decompile box for XSE, how do you do it for Pokescript?
 
Last edited:
Status
Not open for further replies.
Back
Top