![]() |
thethethethe's Pokescript Tutorial
thethethethe's Pokescript Scripting Tutorial Do Not Take Without Permission Before I begin, I'd like to give thanks, to Dabomstew, Irish Witch, Foullump, Earthsvisitor, Mastermind X, loading_NOW, score_under and The Rom Raiders team (namely Hackmew, D-Trough and Wuggles); for commands, that I've found out about through tutorials and programs, and even just asking things, thanks. Now a little background into why I'm writing this. I wrote a scripting tutorial to post at Phcompany, and I was looking at it and I thought, WOW, this is really outdated. Some of the stuff, was even wrong. Then I looked over at PC, and I saw the stacks and stacks of scripting tutorials, all covering the same basic commands over and over and over again. So I decided I'll make ammends for my poor tutorial and fix it up with this new one, and also end the trend of scripting tutorials posting the same things over and over. Also please note. I won't be including all commands, because first of all, not all are known, and second of all, I consider some of them useless. Ones I consider useless will NOT be included with an explanation. I think since, it's a Pokescript tutorial, I should give a little info on Pokescript. Pokescript is a program created by Irish Witch. This program is, in my opinion, easier to use than other scripting programs like scriptED and Diamond Cutter. Some important features of Pokescript are: Dynamic offsets You don't need to assign the hex pointer. It will do that for you. Option of Using Decimal and Hex Values. To make it easier. Instead of having to use 0x64, you can just use 100. But remember, if "0x" is infront of the number, it's a hex number. This tutorial is going to cover a lot in detail. The way I'll explain everything is, to show a script at the beginning and then explain everything "new" after it. Please note, because I prefer to hack Fire Red over Ruby, some scripts are written to suit Fire Red/Leaf Green, and NOT Ruby/Sappire/Emerald. I think I'll start with pointers. Pointers Pokescript automatically assigns the script to the rom, therefore, unlike it's opposition; ScriptED and Diamond Cutter, you can just use a random name for each pointer. So we can use any random name for the pointer. It could be, for example... $aaaaaaa ; $hellomynameisthethethethe ; $1234567890 As long as there are no spaces in it, and pointers aren't "doubled up" the pointer will work. So as an example these won't work $a a a a a a ; $hello my name is thethethethe. Message Script Now I can move onto a normal message script. Code:
#org $start marks the beginning of the script. It shows that it's the beginning. lock will lock your player so that while this script is "in motion" the player won't be able to move. faceplayer is used to make the sprite you are interacting with, face you. message is used when you want a message to display on the screen. It is followed by a pointer that will be placed at the bottom as shown. The actual message will appear like this. Quote:
Now the boxset. Boxset MUST follow a message. Without this the message box, wont appear. In this case I've used boxset 6. I'll cover more later. boxset may also appear as callstd. Now we use release. This will release the locked player. And end will do what it's name says, and end the script. Extra Message Info There are lots of other little add ons that can be used with the message. Here's a short list, before I explain them. Quote:
\c usually refers to a colour. So in this type of message Quote:
Here's a short list. Fire Red/Leaf Green Spoiler:
Ruby/Sapphire I'd assume that they work for Emerald too, but I haven't actually tested it yet. Spoiler:
\h is used with hex values. Here's an example. Quote:
So in this example, I'm goint to use "$", here's an example. Quote:
Spoiler:
\n is used in text when we want to go to a new line. So in this message line. Quote:
Quote:
So in this message line. Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Flags Before I continue. I'm going to just add something on flags. Flags are very useful when you need an event to only occur once or if you want a person to disappear. We can set a flag, and if we want an overworld, to dissappear we have to assign the set flag to the OW's, people ID in advancemap. But I'll go into more detail on that later. Many flags are used within the game already. So if you plan on leaving scripts that are already in the rom, you'll need to be more careful on what flags you use, because flags can only really be used once. If you want some flags that are not used in the rom as a start, here's a few. 0x200 - 0x29F, 500-79F, 1000-109F. But you'll find more if you experiment with them. I'll have to do a bit of explaining here, so I'll start with preventing events to happen. Code:
checkflag checks if a flag has been set. Checkflag is usually followed by an if line. When using the if line after checkflag it contains either a b_true or b_false. b_true, meaning, that if the flag is set goto ${pointer}, and if not it will continue with the script. Similiarly, b_false checks if the flag is NOT set, and if it isn't it will goto ${pointer}, and if the flag is set, the script will continue without going to the pointer. This pointer used in if b_true goto $done it points to another part of the script as you can see in the script. As you can see the if b_true goto $done points to a different part of a script as shown with the #org $done Here we have a message and a new command, clearflag. Once flags are set they can be "unset" with the command clearflag. Clearflag has to be followed by the flag number. And here we are at the end of the script. But there is more than one way to use a flag. Some flags have some sort of game function. I'll explain that in the next part. Givepokemon Givepokemon does exactly what it says. It gives the player a Pokemon. Here's my example script. There will be quite a few new commands here. Code:
I guess I'll start from the top. checkflag and the if line, we have already covered. Message has also been covered, but boxset 5hasn't. boxset 5 does a similar job to boxset 6, but this box also gives us the option of a Yes/No box on the screen aswell. Obviously this would be used if you want to ask someone a question. boxset 5 is usually followed by a compare line. compare needs the variable, which in this case is LASTRESULT and also a value, which in this case is 1. LASTRESULT is a useful variable that most commands store values in. When using compare after a boxset 5, you only have two options for the value, 0, which is NO and 1, which is YES. This compare LASTRESULT 0x1, will check if you pressed YES and of course, compare LASTRESULT 0x0 will check if you pressed NO. This if line that follows the compare line does the same thing as what it does for checkflag. if b_true will check if the button pressed matches the compared value and if it is, it will goto ${pointer} and if not, it will continue the script. Then we have a Normal Message and the end of the script. So I'll now move onto the next part. The first new command here is givepokemon. givepokemon uses three values. The first is the Pokemon, the second being the level and the third being the Item Held. So in the script above, mine shows.... [code]givepokemon (Charmander) (Level 4) (No Item)[/i] Just in case, you don't already have one, here's a list of Pokemon and Items. Pokemon Spoiler:
Items Spoiler:
Now we have fanfare 0x13E. This is a jingle. It's a short bit of music that is played when you recieve something like a Pokemon or an item. Then we have a message. The only difference here is that we have used boxset 4. Boxset 4 is different to boxset 6, because it will not close. But if it doesn't close, why would I use it? You'll just have to keep reading to find out. waitfanfare will do what it's name displays. It will wait for the fanfare to finish, before it allows the script to continue. This boxset 4 has left the box open while we wait for the fanfare to end. #raw 0x68, a very useful command in my script. This is a very useful command with boxset 4. It will basically, make the boxset 4 act as a boxset 6, so that it can now close when you press a button. setflag 0x828... I wonder what this is for. In Fire Red and Leaf Green, this is very useful, as it activates the Pokemon option on Start Button Menu. Here's a Short list of some of them. That's pretty much all thats needed, don't you think? Flags Spoiler:
Now we have the Code:
If you use ScriptED this, is would just be if2 to you. Gosub, is somthing used in other programming languages, and is just used to say, "go there but you have to come back." So let's look at what we have there, gosub $name, I guess that means that we are going to go look at $name Here we have call 0x1A74EB. Call is used to call some other script within a rom. It can also call a part of your script, in that case it would appear, Code:
Now we have return, but what's that do, it just returns to wherevere it was called from or gosubed from. I didn't mention it earlier, but call should have a return wherever it is called from. That return has brought us back to message $5. The rest is already explained, so now we can move onto the next part. I think we'll move onto something similiar and go to... Wildbattle Code:
Sorry but I have to get a little "advanced" here, but hopefully, I'll explain it well enough so that it sounds simple. When we script cry in hex it takes 6 bytes, [cry] [bank] [pkmn] [pkmn] [buffer] [buffer] In pokescript unfortunately it's only coded 4 of those six bytes, so now we need to add two bytes, which will act as those buffers. So I chose to just use two nops. To cover those buffers. Oh wait, I forgot to explain Cry. First we have the command, and then it's followed by the bank. 0xA1, is the Pokemon cry bank. Then that is followed by the Pokemon, which in this case, is a Charizard. Now Wildbattle. So in my script, we have. Code:
fadescreen is a command that is used to make the screen fade to black, and sometimes back. fadescreen 0x0 will create a blinking effect which will make it seem as if the Pokemon is there one second, and gone the next. There are more different fadescreen's but I'll cover some of those later in the tutorial. Now we can move onto #raw 0x53 0x0F 0x80. This is very useful, as it makes the Overworld your interacting with dissappear. I'll go into a little more detail on #raw 0x53 0x0F 0x80 below in the spoiler, because it will be a little more complex than where we are at, at the moment. Spoiler:
#raw 0x53 can also be used a little differently and I'll explain that also a little later in the tutorial. Remeber how I mentioned in Flags, how I mentioned something about the people id, in advancemap. This is where I'll be explaining that. Here, we've used the flag 0x200, so we are going to change the Overworld that this script is assigned to's people id to 0200. The people id, is used to make sure that the Overworld, doesn't continue to re-appear, but that is easier to learn via experience. and that's it, I guess we can now move onto something else. Checkgender Code:
So we have the command Checkgender. Like most commands, it assigns a value to LASTRESULT. We check what this value is with compare LASTRESULT 0x*. The asterix just stands for what we are checking for. With checkgender, it assigns 0x0 to LASTRESULT for a male, and it assigns 0x1 to LASTRESULT for a female. I've used two compare's but it can be alternitavely my script could also have been written like this. Code:
Code:
It think that's all that I need to explain for this. Giveitem Code:
Now onto the new things in this script. We have the giveitem command. Giveitem will take two values, the item no. and the amount. In my script I have used these. giveitem {Potion} {One of them} That's actually all you need to do for this command. It will automatically play a jingle, and it will automatically display a message saying "You recieved ............" That's actually all I need to explain. WARNING: The most common mistake when people use this, is that they leave off the second number and forget about it. This will make the game go to a Red Screen, which you will not be able to come back from. Make sure you have both numbers used with this command. How about we move onto some simple specials now. Special Code:
Looks like I've used boxset 4 and #raw 0x68 again. I've also used fadescreen 0x1 aswell as fadescreen 0x0, another fanfare and special 0x0. I'm going to do something different here. I'm going to start with the fadescreens? Do you still remember what fadescreen 0x0 does? Spoiler:
Fadescreen 0x1 is of course not the same as fadescreen 0x0, it actually fades the screen out to completely black. But I can guess what you're asking, how do we turn it back? We of course use fadescreen 0x0 to reverse the process, and return the screen to it's normal state. Now that you should have an understnding of fadescreen 0x1, we can move backwards, and look at "Why I used boxset 4 instead of boxset 6. I will be fully truthful with you on this. For some reason, that I can't explain, if we use boxset 6 before we use fadescreen 0x1 the box will remain open until we return to our normal screen with fadescreen 0x0, and once we are there we will see it close but I don't want that. It doesn't look very good. We want it to close before we come back from our black screen. I can't explain this, but for some reason, when we use boxset 4 and #raw 0x68, it does just that. So whenever you have a script like this, use boxset 4 before, we go to a fadescreen. The fanfare is very useful in this script. In theory I could have used pause[size="1"](which is a command I have not covered yet), but I wanted to use the combination of fanfare 0x100 and waitfanfare. For those who don't know, fanfare 0x100 is the healing jingle that is played when your mother heals your Pokemon. So now, with the help of waitfanfare, the screen will not return to normal until that jingle is completed. Now all that's left is of course, special 0x0. This is a special command that will fully heal the Pokemon within your party. Useful isn't it? I'm also going to include a short list of specials in spoiler right here, for whoever may want it. Specials Spoiler:
Applymovement Code:
Applymovement is a very useful command that allows to show an overworld walking or running depending on what we want. When we use applymovement, it has to be followed by a People Number, which is found here... http://pixloads.com/public/49845/tutorial.PNG?no_history and a pointer to where our movements are. An overworld with a people number of "4", seems normal doesn't it? But what about one with 0xFF(256). There's never 256 Overworlds on the one map. 0xFF is the "Hero's" people number. Now let's look at this movements in a simpler view.But First I'll have to give you a movements list won't I? Ruby/Sapphire Spoiler:
Fire Red/Leaf Green Spoiler:
Before we look at the movements in a different view, I should explain the layout of the movements at the pointer. It is set out in a similiar way to a message. We have #org $pointer first and then what's being written to the rom below that. So we add #raw and then the movements that we want. But remember, that if you forget to add 0xFE to the end of the movements, your script will not work. Actually, you know what? I changed my mind, before we look at the movements we're going to look at pausemove and pause. pausemove is one of the best commands that you will ever find. This isn't a command in scriptED, so I've heard it refered to as the "perfect pause" and that is exactly what it is. When used as pausemove 0x0, it will wait for the exact amount of time that it takes for the movements to end. Really helpful isn't it? Now we have pause. pause will wait for a set amount of time. You have to actually add the amount that it will wait for. The way we work out how long we should pause for is, {Let "a" be the amount of movements} Pause time = 0x10 + 0x10a Personally, I don't use this very often, I prefer to use pausemove almost all of the time. But later on I might show where using pause instead of pausemove can be better. Okay now, no more sidetracking, let's look at the movements.Lets look at the script withouta anything but the applymovements, pause and pausemoves. This leaves us with this. Code:
ie. applymovement 0xXX $YYYYYY pausemove/pause But let's look at the next set of movements. It's set up differently. We have two applymovements before we have some sort of pause. What would happen if I did that? They would both move at the same time. This is sometimes referred to as "follow-me." With a "follow-me" we can use as many applymovements before the pause as we want. This can be useful if we wanted a "group" to walk together. We can have three, four, five, six, however many you want.I think that's all there is to the applymovement command. Now we can move onto that playsound. Doesn't something look a little familiar about this? It is followed by a nop. Similiar to cry, isn't it? So I guess I'll explain in a similiar way, why the nop is there. When we script playsound in hex we need 4 bytes to get it to work. Here's a short summary of what we need: [playsound] [song] [song] [buffer] Pokescript is missing that buffer. So we add nop for that buffer. So now as you can see from the playsound in the script, we only to add one value after it, the Song number. If you're hacking Fire Red, you're in luck... I have a short list of song numbers in Fire Red. So sorry to R/S/E hackers but you can find the song numbers in A-Map. Fire Red Songs Spoiler:
Now we have fadesound. What's that do? It's set up similiar to playsound and it will fade into the sound displayed. Since it is set up in a similiar way to playsound, it has a nop at the end of it so that it works. If you want more detail on how it works, just refer back to playsound. Hmmmm... Is that it? No. I thought I might point out something about the checkflag in this script. We actually have no setflag in this script. So why do I have a checkflag? We can actually check in one script if a flag was set in a different script. So in this script shown in this section, we check if the Pokemon menu has been activated before the script will go to it's end ($done). Okay, I'm also going to ask you to compile the script, assign it to an event and not a person, and test it in the rom. Then look at this spoiler. Spoiler:
So what's next. Countpokemon I'm going to do something different here. I'm not going to show a script. There's too much to explain to show in just one script. Here's the most basic example. Code:
Before I explain this fragment of a script, I should go into a little more detail, on the command countpokemon itself. countpokemon checks how many pokemon are in your party and writes the value to LASTRESULT. So if we have six Pokemon in our party, it would assign 0x06 to LASTRESULT, and if we had 3 pokemon in our party it would assign 0x03 to LASTRESULT. Now back to that cut out part of a script. With compare LASTRESULT 0x6 we are checking if they're are six Pokemon in our party. And then with if b_true goto $continue, it displays "if there is six pokemon in your party go to $continue." That is the simplest form of countpokemon. Let's get a little more complicated. Let's try this. Code:
Here's a short table of some different possibities for the b_??. Spoiler:
So I'll add one more example, just to help the information sink in. Code:
|
Trainerbattle 0 Just a simple trainerbattle script... Code:
Now to explaining these values after the trainerbattle. These are: [trainerbattle] [Type of battle] [Trainer ID] [Message Before Battle] [Message if you Win] So I'll guess I'll explain the type of battle. The type of battle, just displays whether it is a double battle, Gym Leader Battle, and some more. When you just use "0", it is just a normal trainerbattle. One that you would just see in a route, or even a gym trainer. It will, "Spot you," beginning message, battle, Message when win. Now we'll move onto the Trainer ID. I don't have a list of these sorry. But what I can do, is tell you that these are the ID's of trainers that are found in PET. For Example, Brock can be found with with a Trainer ID of 0x19E, and Blaine can be found at 0x1A3. Now we see two pointers. $before & $after. I've labeled these to help display what they are for. The first pointer, $before displays is the pointer to the message displayed before the battle. $after, can you guess what this does? That's right it's the pointer to the message after the battle. This message appears while we are still in the batte event. Remember the colours that were mentioned towards the beginning of this tutorial. Well, we can use colours with this too, but they are different. Here's a list. Fire Red Spoiler:
Sorry Ruby hackers, I don't have a list for those values. Now if I were to test it in a rom, guess what happens after the trainerbattle? Nothing... The script ends. So, why do I have a message after it? Remember how I talked about trainerbattle keeping track of whether you have beaten them or not. Once you beat the trainer, the trainer battle will be skipped. So when you speak to them after beating them in a battle, it will be treated like a normal message script. So wait! Why don't I have a lock and faceplayer there after the trainerbattle? The reason is that once you have beaten that trainer, it will act as the lock/faceplayer combo, and you don't have to worry about them in this script. That's the scripting side of this command done. Now the A-Map side. Now compile this script, and test it in a rom. Did it work like a normal trainerbattle? I bet your answer is No. You'll need to fill in these boxes. http://pixloads.com/public/49844/tutorial4.PNG?no_history Trainerbattle 1 Code:
This script is a little longer than the previous trainerbattle script. You'll see that the "0" in the previous script, has become a "1." There is also a third pointer. If it shows a "1," it means that it needs three pointers after the trainerbattle command. The first two are the same as in the previous script, one for before the battle, and one for after the battle. But you'll see the third pointer doesn't point to a message. It points to $later. It's a seperate part of the script, where it allows the script to continue after you have won the trainerbattle. If you refer to the flag section, you'll be able to see what the setflag 0x820 is. It's to activate the first badge on the trainercard. I think that's about all I need to add on trainerbattle's. Warp I think I'm st the stage in this tutorial, where I don't need to show an example script of every command. This is one of those cases. So now, we have warp. Warp is there to allow the player to warp to a different map. Warp is used like this. [warp] [map bank] [map number] [warp number] Let's say we wanted to warp to the front of Oak's Lab in Pallet Town. So open a Fire Red/Leaf Green Rom in Advance Map, and open the Pallet town map.To the far left of the program's window, you'll see an orange box next to the current open map. If you've clicked Pallet Town, it should say Pallet Town (3.0). The "3" is the map bank, and the "0" is the map number. Now we need to click on the warp on the door of Oak's Lab. It should have "Event Number: 2". Now we have our three values. So we write our warp command. Code:
Warp to Position Code:
Well, I want this to warp straight to your bed in your room. This is in map PALLET TOWN (4.1). So what is the 0xFF for? The 0xFF is what tells the command that it is going to warp to a certain postion. But wait, didn't I just say that after the warp command, the script ends? That is true. So why do I have the #raw's there? If we were to script that warp to position in hex it would appear. 39 04 01 FF 02 00 06 00 So even though the #raw's on a different line, the #raw's still part of the warp command. But wait, I haven't explained what the #raw's are for yet... Let's look at the locations of the bed in your room. (X=2)(Y=6). So they are 0002 & 0006. Now we have to reverse these values. I'll explain how to do this. If we have 0002, we'll seperate that into 2 bytes, 00 02, and then we reverse it.... 02 00 IF we do the same thing for Y=6, we get 06 00. We have our #raw's. So it's that simple. We can now warp to a certain postion. Weather Commands When we want to change the weather in a script there are two commands that we need to know about, Setweather and doweather. Setweather will set a certain type of weather to be activated by doweather. So this is how we set up our setweather command. [setweather] [weather type 2 bytes] Here's a list of the different weather types. This applys to all third Generation games. Spoiler:
So if we wanted to have rainy weather, we would have. Code:
Code:
As you can see, doweather doesn't need any values after it. It's simply just doweather on it's own. There is one more somewhat useful #raw 0xA3. This command will prepare the game to return back to it's default map weather. Since this only prepares the rom for it, it still needs to be followed by doweather. Pokemart Here's just a basic script. By now, you should be able to add to it, pretty easily. Code:
#binary int 0x(value) In this case, we have the these items respectively:
Code:
Code:
#raw's I know we've covered a few of these, but I think I should go into a little more detail on these. When we script in #raw, we're just scripting in hex. As an example script. Code:
Code:
Hidesprite and Showsprite These two commands are #raw's. Showsprite is the #raw 0x53 command that we covered in a little detail earlier. We used it as this, #raw 0x53 0x0F 0x80, which will make the last person we talked to disappear. But, what if we wanted a certain person to dissappear? Remember the reversing of values that we covered in the warp to position section. Quote:
#raw 0x53 0x(people no. reverersed) 0x(people no. reverersed) So lets use an example. People No. = 4. Here's how it will appear. #raw 0x53 0x04 0x00 And maybe one more if it's needed. People No = 12. #raw 0x53 0x0C 0x00 Now you should have a pretty full understanding of the #raw 0x53 command, so let's move onto showsprite. Showsprite, can make an OW re-appear. Showsprite is set out in the exact same way as #raw 0x53. And if you haven't guessed already, Showsprite isn't a command coded in pokescript it is #raw 0x55. So here's some complimentary examples from when I explained #raw 0x53 Example 1. People No. = 4. #raw 0x55 0x04 0x00 Example 2. People No = 12. #raw 0x55 0x0C 0x00 If you wanted to keep the person viewable: If you remember back to wildbattle, you'll see that you need to use a setflag to keep the person hidden. So if we were to keep them viewable after using #raw 0x55, we would need to use clearflag. Giveegg Yet another #raw command. #raw 0x7A. A relatively simple command to use. All we need is to add the pokemon number reveresed after it. So as an example, let's give a Pikachu Egg. Pikachu's Pokemon number is 25. So let's convert that to hex; 0x0019. Now just like with people numbers, we reverse it. and it gives us 19 00. So our giveegg, command would appear like this. Code:
Code:
Change Message Colour YAY! Another #raw. #raw 0xC7. We had an older way of changing the text colour with the message. Let's do it in the script. We have three usefule colours here.
Black Text Code:
Code:
Code:
Setmaptile I'll show a script and explain it for this one. You'll also be glad, it's not a #raw. Code:
[setmatile] [X-Co-ordinate] [Y-Co-ordinate] [Tile Number] [Movement allowed?] So in my short script, we have: X Co-ordinate = 10 or 0xA Y-Co-ordinate = 13 or 0xD Tile = Noramal Grass(in tileset 0 [Fire Red]) or 0x1 Movement Allowed = Yes or 0x0 WE can find our X and Y Co-ordinates in Advance map, which has been shown earlier. We can also find our tile number in Advancemap. the number depends on what tileset we are using aswell. So Hold your mouse over a tile in the right pane. In the little status bar at the bottom on the far left, you should have Block: XX Offset: XXXXXX Movement allowed has two possible options.
This special will reset the map so that it allows the tile to set. Without this, you'll have to leave the screen and come back before it will actually work. Special Trainer Commands We've got three commands here, all #raw's. First is Checktrainer - #raw 0x60 Second is disable trainer - #raw 0x61 Last is is Enable Trainer - #raw 0x62 All these three commands are set out in the same way. [command] [pet id reversed] [pet id reversed] Some more reversing. Maybe you've figured this out by now, but whenever we have 2 or more bytes, the bytes are reversed. This is also the case for pointers, and money values, but I'll be covering them in more detail a little later. For all three examples I'm going to use, the trainer "Gym Leader Brock." Which in Fire Red, the Pet ID, is 0x19E. So let's reverse it now, so that I don't have to do it later. 0x019E, is 9E 01. Now let's work with checktrainer. So since we're checking for something, the answer or result is going to have to be stored somewhere. Like most commands, the result is stored into LASTRESULT. So here's the example. Code:
Here's Disabletrainer. Again, we'll be using Brock for the example. Code:
But now we want to re-enable the trainerbattle. We're still using Brock. Code:
Checkitem/removeitem This time only part #raw. It's like Cry and Playsound, its not coded correctly into the pokescript database. These are probably easier to view through an example. Code:
compare LASTRESULT 0x1 compare 0x800D 0x1 Guess, why they look similiar, they're the same thing. 0x800D = LASTRESULT I'm going to be using this type of thing from now on. I'm not going to be "babying" anyone with LASTRESULT anymore.Vrey soon, we're going to start moving into variables. So I'll start introdusing you into them now, so I'm not just introducing you into a new wway of thinking straight away. if 0x1 goto $pointer, I'll include if 0x4 goto $pointer in this explanation aswell. Up to date, Up to date, we've only used these. B_<< Lower Than (b_false) B_== Equals (b_true) B_>> Greater Than B_<= Lower than or Equal to B_>= Greater than or Equal to B_!= Not exactly equal to But now I'm going to add to that. Other than what we have here, we can also use values, like 0x1, 0x2, 0x3 etc. I'll propoose a new "table" B_<< Lower Than (0) (b_false) B_== Equals (1) (b_true) B_>> Greater Than (2) B_<= Lower than or Equal to (3) B_>= Greater than or Equal to (4) B_!= Not exactly equal to (5) Now we can see what each value represents. This is also another way to save time. So instead of writing; if b_!= goto $notequal we can just write; if 0x5 goto $notequal Saving some time. Pretty useful, huh? From this point on, I'll only be using 0xX, with the if line. I thought I'd warn you, just so it doesn't look like I've totally changed the way I script without notice. Now checkitem. Another command, not correctly coded. In pokescript its coded like this. [checkitem] [item number] But it should be like this; [checkitem] [item] [amount] So can you guess what the #raw's are for? The amount! As always, it's reversed. As an example, let's say we wan't to check for 10 Masterballs. It would appear like this. Code:
And by now you should be able to tell what the if should do by now. Now, removeitem. It obviously removes an item from your bag. Like giveitem and checkitem, it is set out in the same way. [removeitem] [item no.] [amount to remove] Do I need to give any more explanation? This should be enough info on it. Copyvar A little command that's pretty easy to explain. It just copies what's stored in one variable to another variable. Which we will use more and more often, as we progress through the tutorial. Here's the explanation. Let's let 0x8008, be "A" ; and let 0x800D, be "B" [code]copyvar 0x8008 0x800D[/v] Variable "B" copies onto variable "A" I know, it's reversed, and the second variable copies to the first variable, but as long as you can remember it. You'll be fine. Copyvarifnotzero Here is what some might say, a little "add-on" to the copyvar command. The name says it all doesn't it. Copy Variables, if not equal to zero. But we can also use this like setvar. Example 1(Variable Copy) Code:
This example I use is actually, what's behind the give item command. Code:
Setvar Since this is a pretty complicated command, and has a lot of uses. I'm just going to give an explanation of the command, but not give examples of the different ways to use it. In the following few sections you'll see some way's of using it. Setvar is pretty simple naming, set to variable. It sets a certain value, ranging from 0x0 to 0xFFFF, to a certain valuable. It's just set out simply like this. [setvar] [variable] [value] Here's just a sample view of how the command appears. Code:
You'll see more of this from this point on. Randomisation Another #raw. #raw 0x8F. With this command, the rom will choose a random number depending within the range of 0x0 to the value you set with the arguement, and then assign it to 0x800D (LASTRESULT). So here's a little example. Code:
By now, I shouldn't need to explain this anymore. That should be about it. I'll show an extra example if you need, but I shouldn't need to explain anymore. Code:
Special2 I'll show an example script fragment. This is a "checkpokemon" only usable for Fire Red. Code:
First we assign the value to the variable 0x8004. Using this command, this value is the Pokemon we want to check for. In this case it's Pikachu. Now we have special2. special2 is set out like this. [special2] [Variable to store value] [event to call] The event we use is 0x17C; this checks if the Pokemon that we have set to 0x8004, is in our party. If it is in our party, a 0x1 is assigned to the variable, which in this case is 0x800D(LASTRESULT) ; if it's not in our party 0x0 is assigned to the variable, thich in this case is 0x800D(LASTRESULT). Now the following compare and if act in the same way as the compare and if used with the checkitem. If you've forgotten, here's a quote of myself. Quote:
Special PART 2 That's right, we're adding to the [i]special[i/] command. Well, actually, not really, I'm just going to tell you about waitspecial command, which is of course, a #raw. #raw 0x27. Wooohoooo! Another #raw. Let's just use special 0x9D, which in Fire Red, shows the "Old Man Cathes Weedle" scene. But look at how we are going to use it. Code:
Movesprite This will obviously move a sprite from one place to another instantaneously. It's set out like this. [movesprite] [People Number] [X Co-ordinate] [Y co-ordinate] So the people number is the same as it ahs been since the beginning of this tutorial. The X co-ordinate is the X co-ordinate of the tile that we want to move the Overworld to. Now obviously, The Y co-ordinate is the Y co-ordinate of the tile that we want to move the Overworld to. Here's just a simple example of the command. We'll use, people number = 4; X co-ordinate = 12; Y co-ordinate = 5 Code:
Code:
Setvar Lesson 2 I'll show an example of this command, that I have used in my hack Legend of Dragons. It's three scripts. Script 1 (Right) tile Code:
Code:
Code:
Code:
I'll explain the goto a little later. But for now, let's look at what's in Script 1 under $script. We've got the usual, checkflag 0x[flag] to prevent the event from repeating itself. Now we've got some compare lines. Code:
I haven't actually explained goto yet, have I? We've only seen it with if. Well at this point, if you've followed the rest of this tutorial, it should be obvious what the command does. It will goto a specified point, whether is be a $pointer or a 0x[hex address]. The command is set out like this. [goto] [pointer] Now we've covered that, let's get back to what we were looking at. The beginning of scripts 1, 2 and 3. Look at the similiarities between each one. Code:
Code:
Code:
Let's compile script 1 into the rom. After it's been burnt to the rom, in bufrite, we should see a list of the different names between the pointers. We should have something like this. Quote:
So if I were to use these pointers as an example, my Script 2 would be this. Code:
Resetvars Another #raw. This command doesn't reset every variable, just 0x8000, 0x8001 and 0x8002. It's just a little command #raw 0x2E. It doesn't need any extra arguments. All it needs it this: Code:
Money Commands This is a pretty big section, so I'll split it up into 6 sections for each of the money related commands, all #raw's.
Givemoney The "name" gives it away. This command, #raw 0x90, will give the player a designated amount of money. The command is set out like this. Let XX, be the money value reversed [#raw 0x90] [XX] [XX] [XX] [XX] [#raw 0x00] The final [#raw 0x00] actually determines whether it updates your money account. The reason I've left it at [#raw 0x00], and not a simple explanation of what it is, is because if it were changed to #raw 0x01, the money balance does not change and therefore defeats the purpose of the giving the player money. I'll move onto explaining the money now. I'll give you an example to show what's happening. We'll use the amount 10,000. so let's convert 10000 to Hex, which gives us 0x2710. Since we need four bytes, let's write 2710 as 00 00 27 10, and now reverse it, to get 10 27 00 00. So here's our command. Code:
Money amount = 500 [hex = 0x1F4] Code:
Takemoney Like, the givemoney, the name gives the function away. This command takes money from the player. Takemoney, of course, is a #raw command. It's #raw 0x91. The command is set up in an almost identicle manner to the #raw 0x90. I'll show the setup again, just incase you forgot already. Let XX, be the money value reversed [#raw 0x91] [XX] [XX] [XX] [XX] [#raw 0x00] The final [#raw 0x00] has the same function as what it does with #raw 0x90. Just incase you wanted it, here's an example. Money amount = 600 [Hex = 258] Code:
Checkmoney This command of course checks if your account for a designated amount of money. Ofcourse Checkmoney isn't a coded command, and is #raw 0x92. It's set up in the same way as the previous two commands, but there is a defference. I'll show how it's set up. [#raw 0x92] [XX] [XX] [XX] [XX] [#raw 0x00] Looks the same, doesn't it? That's because it does look exactly the same. The difference is the reason for the [#raw 0x00] at the end is for something different than the other two. [#raw 0x00] would mean "Check Money account," [#raw 0x01] would mean "Don't check Money account". So if you were to use [#raw 0x01], it just defeats the purpose of the command, and there would be no point to it. Now, how do we call upon the amount. Remember the countpokemon command? We check in that same way. Using the compare and if lines. Here's also a little example, just in case that wasn't explained very well. Conditions: Money amount = 1000 [Hex = 3E8] ; Need at least 1000 to continue in script Code:
Conditions: Money amount = 20,000 [Hex = 4E20] ; Need at less than 20,000 to continue in script Code:
ShowMoneyBox This breaks away from the style that the other money commands are written in. This command is #raw 0x93. It' set out like this. [#raw 0x93] [X co ordinate] [Y-co-ordinate] [#raw 0x00] Okay, of course the first byte is always the command. Then it's followed by the X co-ordinate and the Y-co-ordinate on the screen. Personally, I just the co-ordinates, (0,0). I think by now, you can just trust me and just use [#raw 0x00] for that last byte. There is a reason. But if you remember the reasons for the previous commands, just believe me and use the [#raw 0x00]. Here's a little example of what how it is set out. X and Y co-ordinates - (0,0) Code:
HideMoneyBox This one is also different from the rest of them. This command is #raw 0x94, and it's set out like this. [#raw 0x94] [X co ordinate] [Y-co-ordinate] First byte, obviously the command. The second and third arguements, are just the co-ordinates of the shown money box. If I were to write this to counter-act the effect of my previously shown script, my hidemoneybox line would appear like this. Code:
UpdateMoneybox Last money command. #raw 0x95. It's simply set out like this. [#raw 0x95] [X-Co-ordinate] [Y-co-ordinate] [#raw 0x00] Like the #raw 0x94 command, the X & Y co-ordinates need to compliment the co-ordinates of the #raw 0x93. And since, I feel there is now no point in explaining this last command, let's just call it a buffer. Well, I guess, I'll just show an example. Code:
Addvar "Add to Variable" yet another #raw. Before I explain what it does, I'll show you how it's set out. [#raw 0x17] [Variable Reversed] [Variable Reversed] [Value Reversed] [Value Reversed] #raw 0x17 will add the designated value to the value that is already stored within the designated variable. What a mouthful. If that's a little complicated I'll simplify it. As an example, let's say the varaible 0x4036 already has the value 0x1 stored into it, and we want to add 0x3 to it, to make it 0x4. So I'll put it into a scripted example. Code:
That's pretty much all there is to it, it's up to you to find a use for it. Subvar Of course, since we can add to a variable, we must be able to subtract from the variable. It's set out in the exact same way as #raw 0x17. The only difference, subvar is #raw 0x18 [#raw 0x18] [Variable Reversed] [Variable Reversed] [Value Reversed] [Value Reversed] Since, it's just the opposing function to #raw 0x17, I think I can just go straight through to the example. Code:
DontFaceplayer A relatively useless command. But I thought, it migh be worth knowing. It's just #raw 0x69. There's no other arguments. As I said, it's an almost useless command. But just something to add to your memory banks. Pokepic #raw 0x75. The name may be a little misleading. This command, can bring up an image of a designated Pokemon. The command is set out like this. [#raw 0x75] [PokemonNo. reversed] [Pokemon No. reversed] [X-coordinate] [Y-co-ordinate] Okay. We obviously need to begin with the command. It's then followed by the Pokemon number, which needs to be in hex and then converted. This is then followed by the X and Y co-ordinates of where you want the image of the pokemon to appear. So here's a little example to help clarify things. Conditions: Pokemon = Dratini Co-ordinates = (10,3) Center of Screen. Code:
ClosePokepic Without using this, you're Pokepic Box, will remain open until you leave the map, and the map has time to reload. The command is just #raw 0x76. There's no need for any arguments. Well, here's an example of the two commands combined in a fragment of a script. Code:
Door Commands There are three door related commands.
I guess we'll start with #raw 0xAC. Open Door This obviously opens doors on a map. It's set out like this. [#raw 0xAC] [X co-ordinate reversed] [X co-ordinate reversed] [Y co-ordinate reversed] [Y co-ordinate reversed] Here's an example. Oak's Lab's Door, in Pallet towns co-ordinates are (16,13) [hex (10,0D] So here's the example. Code:
It didn't, did it? Here's the reason why. It need to be followed by this command. Doorwait This command needs to follow both #raw 0xAC and #raw 0xAD. Without this command following, they don't work. this command, #raw 0xAE doesn't need any arguments. Here's an example, with the "Door open" command. Code:
Door Close This is ofcourse, #raw 0xAD. It's set out in the same way as the #raw 0xAC command. I'll show you the set-up again, just in case you've already forgotten. [#raw 0xAD] [X co-ordinate reversed] [X co-ordinate reversed] [Y co-ordinate reversed] [Y co-ordinate reversed] I'm going to show an example of using all three commands. Code:
Coin Commands There are 6 coin commands, and they are very closely "related" to the money commands, as they have similiar arguments. Well, I'd better list the different commands.
Check Coins This is a pretty simple command, and isn't as difficult as long as the check money. It checks to see if you have a certain amount of coins. It's set out like this. [#raw 0xB3] [Amount reversed] [Amount reversed] Since we can only hold a maximum of 9999 [hex = 0x270F] coins we only need to use the double byte value (word). So here's a short little example. Check for 3000 coins ; If higher than, continue Code:
Give Coins/Take coins Since they have similiar aguments, I thought I'd just put these two together. The command for givecoins is #raw 0xB4 and the command for Take Coins is #raw 0xB5. This is how they are set out. [command] [Amount reversed] [Amount reversed] I guess, I'll give an example of both and we can move onto the other three commands. Give Coins Give 1000 coins Code:
Take Coins Take 1000 coins Code:
Show coin Counter This command, will display a little box with your coin count. The command for this is #raw 0xC0. It's set out in a similiar way, to the "show money box," except you can drop off the last argument. If you wanted to see it again, this is how the command is set out. [#raw 0xC0] [X-Co-ordinate] [Y-co-ordinate] As an example, the co-ordinates (0,0) will appear like this. Code:
Hide coin Counter This command obviously hides the coin counter that was brought up with the #raw 0xC0 command. This command is #raw 0xC1. It's set out in the same way as #raw 0xC0. But if you want to see it again, here it is. [#raw 0xC1] [X-Co-ordinate] [Y-co-ordinate] Just remember that without this command, the counter will remain, until the map is reset. I might save the example for the next section. Update coin Counter This will of course update the coin counter, and show any changes within your "coin balance." This is done with the #raw 0xC2 command. How's this set out? I bet you would be able to guess correctly. The same way as the #raw 0xC1 and #raw 0xC2, and just for the fun of it, I'll show the example again. [#raw 0xC2] [X-Co-ordinate] [Y-Co-ordinate] So here's that I promised. I'll make it a little bigger than what I normally do. I should n't have to explain out this script, you should be able to understand it. Code:
I'm going to need to wait for someone to post before I post the rest, to stop the merging of my posts. |
1 Attachment(s)
Displaying Names/Values Okay, the title may be a little hard to understand. This section is dedicated to assigning Names of Pokemon, Names of Items and Numbers to \v\h02 and others of the sort. Okay here's a list of the commands, that we will go over.
Display Pokemon Name With this, we will assign a certain Pokemon's name to a\v\hXX. To do this, we will need the command setvar. That's right, we are going over another use of the command. As you should ave read in the list this command is #raw 0x7D. It's set out like this. [#raw 0x7D] [\v\hXX] [Variable reversed] [Variable Reversed] So how's setvar involved? We need to assign the Pokemon's Number to the variable, that we plan on using with the command. I'm going to use 0x800D. Just to refresh your memories, what is 0x800D? Spoiler:
So here's the example. We are going to assign Charizard's name to \v\h02. Code:
Pokemon = Chikorita ; Storing to? = \v\h03 Code:
Display First Pokemon Name This command is set out a little differently, to the one above. Since we are just getting the name of you First Pokemon in your party, there is no need for the variable. We can just set it out like this. [#raw 0x7E] [\v\hXX] There's just two bytes needed for it to work. So since it's such a short command. I'll just show an example. In the example, we're going to show how to assign the First Pokemon in party's name to \v\h02. Code:
Display Item Name This command is #raw 0x80. It's set out in the exact same way that #raw 0x7D. But it's still worth showing. In case you've forgotten how #raw 0x7D is set out, here's how #raw 0x80 is set out. [#raw 0x80] [\v\hXX] [Variable reversed] [Variable Reversed] Since, there really sn't too much need for a second explanation, I'll move straight into the example. Code:
Quote:
Display Attack I bet you could probably guess how this command is set out. It's done the same way as #raw 0x80 and #raw 0x7D. It's set out like this. [#raw 0x82] [\v\hXX] [variable reversed] [Variable Reversed] I think the only things is, I haven't given you a list of the attacks yet, have I? Anyway, here's the list. This will come in more handy a little later. HEX Values Spoiler:
Now I guess I could jump into an example now, coudn't I? Code:
The message actually says: Quote:
Display Value in Variable This is just used to display a number. Its set out the same way as three, of the previous four commands. So it's set out like this. [#raw 0x83] [\v\hXX] [Variable reversed] [Variable Reversed] But the downside of this command is that it can only display a numbers from 0-65535 [Hex = 0x0 - 0xFFFF]. There is a limit. So let's show an example. We're going to show, the number 50000 in \v\h02. Code:
Signpost box This is a fun little command. #raw 0xCA. This will turn your normal boxset into a Signpost Box. Well, here's the example. Code:
The first message should appear as a normal boxset 6. But then we use #raw 0xCA. This makes our second boxset 6 become a signpost box. But what's this #raw 0xCB doing here? #raw 0xCB converts the box back into a normal boxset 6. This is just a little playful command, that gave us a break from the commands that are having four and five arguments. Callasm This command, is used to call an ASM function that you have added to the rom. I'm not going to write an example, I'm going to use the example of the command used with Mastermind X's "Shiny Hack".This is his hex script: Quote:
Quote:
Code:
He has called the ASM function twice. Once, to turn it on, and once to turn it off. To turn it on, it needs that buffer following the command, and to turn it off, it isn't needed. I think he's explained everything else. Okay, it's been a while, but here's some more that I've decided to add. Get Player Position #raw 0x42, can be used to get the player's X and Y poitions on the map stored into designated variables. The command is set out like this: Quote:
Code:
Repeat Trainer Battle This is a simple command that will begin the Last Trainer battle commenced. It's done simply with command #raw 0x5D. So we can easily use this in a script by simply doing: Code:
Lock All Okay, here's a little fix to an error I've made earlier in this tutorial. This command was described as 'Don't Face Player', which is incorrect. This command is similar to lock, only it locks down everyperson on the map. We use this command with: Code:
Release All This command is used as the opposite to 'Lock All'. It's simply used only with #raw 0x6B. This command will release all sprites on the current map. Here's how it can be used: Code:
Wait Until Key Pressed This command can be used as a pause. The command #raw 0x6D is used as a wait until a key is pressed before it continues. It's used like this: Code:
Display Yes/No Box This command, #raw 0x6E is somewhat pointless when there is boxset 0x5. It acts in the same way as boxset 0x5 where with a compare, yes = 1 and no = 0. It's only reason for use might be to have some flexibility as to where you want the box to be placed. The command is set out like this. Quote:
Code:
Multi, msgbox2, waitmsgbox2 Yes, it's something people want to use. So here's a brief guide on the multi, and two other commands that normally accompany it. I'll show an example first, which will make it easier for me to explain how it's used. Code:
#raw 0x66 is similiar to command #raw 0x68. This command is special and is used with #raw 0x67 to close it. Now onto the multi command. YAY! Well, it's set out like this: Quote:
The third parameter is the options that appear on the multi list. Sorry, it's for Fire Red... Spoiler:
Now from the example script, you should be able to tell that the selected result from the multi is stored into the variable 0x800D. Which you should be able to see I copied to variable 0x8000, to see if it would confuse anyone. I hope it didn't. Note that the copyvar was not needed and you can just compare with 0x800D. But you should already know that. The following compares should be fairly obvious as to what they do. They compare what option has been selected. 0x0 = is the highest option, 0x1 the second highest, and so on until the final option. How about a string now. Name Pokemon Okay, here's a working name Pokemon sequence. Although this one will only work if the Pokemon is given into the party. Okay so here's a script where it can be used. I'll explain it in the code. But before I do that, Pokemon's party position is [Position] - 1. Okay. So first in line is 0x0. And Sixth would be 0x5. Okay now the script... Code:
Store Pokemon to Pokedex Okay, so here's another string like the Name Pokemon above. It simply adds a Pokemon to the 'Seen' section of your Pokedex. This one is fairly easy to do. Here's the script, it'll make it easier for me to explain. Code:
Pretty basic too. We prepare the Pokemon we want to set to 'Seen' to 0x8004. So in this case, I'm preparing Charmeleon to appear as Seen. Special 0x163 only finishes the job and actually sets it as Seen in your Pokedex. Okay, only a little Command update, but the main reason for the update was to give some information on editing the Pokescript commands Database. Editing the Database Ever wondered whats included in the folder where Pokescript is installed, or more importantly, whats in the PkmAdv Folder. We should have 6 files... includes.psh; install.psc; items.psh; stdpoke.psh; texttable.psh and Commands.psh. Okay, of these files, I only wouldn't touch Install.psc. Don't touch it. See those .psh files, we can open those in Notepad. So let's open stdpoke.psh. We have a file 'defining' a lot of Pokemon. Well these actually mean that we can use some commands like this. Code:
Code:
Okay, well that's all a bit of fun, but let's now open up commands.psh in notepad. As soon as it's opened you'll have some information on how commands have been written by Pokescript. Well here's my basic rundown on the different possibilities. Quote:
you may even come across something like this. Code:
If not, here's mine, with lots of changes. You'll have to look at all the files to see exactly what I've done, as I've changed and added quite a bit. Download Mirror Instructions: Download File. Paste into folder where Pokescript is stored. Extract Zip File to that place. Replace existing files in PkmAdv. NOTE:There will be no more added after this. I won't be adding anymore to this tutorial after this point. |
a VERY useful tutorial.
A helpful thread for hackers, indeed. Great work, thethethethe! I'll be visiting this thread more often then! :D |
Awesome thex4, i havent read the las two you post, but i'm sure it will
be fantastic, it's just too long xD lol Good job bud ;) |
Wow! Really nice and detailed tut! Covers alot!
So it would useless to post new scripting tutorials, even for XSE, as this is the best tut Goodluck in covering all the commands!!! |
I see why this took you so long, it's a very handy tutorial, and explains alot of things.
I got a few pm's about adding this to the tutorials list, which i'm going to, plus add a bold and underline :P. It's very helpful. |
Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!This makes ALOT more sense now. Scripting is my one hacking nightmare, but I feel a lot more familiar with it now. I can actually get work done now... >_>
|
And you're the one saying they're was too much pokescript tutorials?
|
Quote:
Anyway Thex4 this guide is great, Im far from have been reading it all but it's relly good... It's nice whith a guide that eksplain more then just the flag, tekst couler and aplymovemnet... Great job! |
Thanks Christos for moving my posts together.
I'm glad people are finding this useful. Quote:
|
I'd like to see some more, unusaul commands explained.
Like, Multi-Choice, Set Healing Place, Pokemart, Create Sprite, End Trainer Battles, Obediences, etc :] Good work so far. |
Hi bud, hey, when i put setflag 0x829 for the PokeDex Menu, all the script works perfectly, but
when i put start, and try to enter the PokeDex it doens open :S |
Quote:
Pokemart's there. I think you showed me that, didn't you? I was going to include Multi with what I've posted, but then I thought I'd cover a few more things before I got to it. Actually, I might write that part up now. I've yet to play around with some of the commands, like all the warps which I'm testing out, get player position, the casino, create sprite,etc. I've still got to test a few of these out. But don't worry, I will get to them. Quote:
|
How come when ever I use the Shop or save in an area around Event placed people, My character turns into that person and I can only control it? My Regular character becomes immobile and I'm controlling the shop keeper o_o;
|
Hi, you where right bud xD lol, I have to have a pokemon for the Dex to open ^^
... hey, i insert this in PokeScript and put it in a minisprite, but when i talk him the game restarts :S I tried it in Ruby and FireRed Code:
What else i have to put for the ASM ? |
Quote:
Spoiler:
Which of these one are for the arrows [UP, LEFT, DOWN, RIGHT]? For example to put them on a signpost? Thanks ^^ |
Hi dude, i made this for the ASM Script:
First, script: Code:
http://img175.imageshack.us/img175/171/muestrahexworkshopasmmiwu1.png LINK: http://img228.imageshack.us/img228/9154/muestrahexworkshopasmbl4.png So...what's going on =S When i talk to the guy or the pokemon that has to battle, the game freezes... |
Wow thethethethe! I never knew you were such a talented scripter! Excellent!
|
Sorry, I kinda, forgot about this thread.
Quote:
It's these ones. 79=[u] 7A=[D] 7B=[L] 7C=[R] U for Up D for Down L for Left R for Right Quote:
|
Hey the4 , I was reading through this tut on the special2 section, but there was one question I had to post. Is there a way to remove a pokemon from your party? Not just relocating them to your PC , but basically removing them from the game. There was something going on in my hack where I wanted to imput the option to choose between keeping or releasing a pokemon that you've already purchased, but I now realize removing a pokemon isn't the same as releasing an item.
|
I don't actually think you can remove a Pokemon, I remember in shinygold you cant access your pokemon anymore, but that was just a simple command. If this was possible I would be interested in it aswell. But since there is nothing identical to that feature in an actual game, it would be extremely hard to decipher.
|
It would be a shame if that wasn't possible. If not, then is there a way to simulate trading with NPC's in the games? I'm not sure if it was in R/S, but I remember being able to do that in the Color/Metal Generations (I've never played FR or LG, so I dunno if it was there).
|
Hey thethethethe, Its been awhile.
I was doing some setvar scripts but they don't work. Everything is correct, its just that I think it has something to do with the advance map values, like var number, var value and unknowns. I'd upload the script but, I don't want to spoil anything for my hack, so PM me instead. Great Tutorial, Learned a lot by the way. -cooley |
Very nice, this covers the basics and the semi-advanced things in an easy to understand manner. 'Grats to you and keep it up.
EDIT: This is my script, It wont work. It is for a lady that keeps you from leaving without a pokemon. It freezes when you step on it. Code:
|
Quote:
|
thethethethe, for the MoveSprite, how can you get the Player to move?
|
how do I Set flags so An event can happen even after not having it in the same script. Like meeting your friend then being able to access a certain area
|
Quote:
I think it's 0xFF. Not too sure. |
you can be sure, it IS 0xFF. Like explained in the tut ;)
(btw don't forget the 0xFE after the movements, I did this xD) Quote:
Then you set a checkflag at the begin of the script of the area entrace (checkflag needs the same number as setflag in the other script). Hope I'm right, correct if I' wrong ^^ |
Wow this is the best tut i have been on just one question will this script work?
#org $begin lock faceplayer checkflag 0x200 if b_true goto $done applymovement 0x06 $move pausemove message $cele boxset 6 Wildbattle 251 5 0 fadescreen 0 #raw 0x53 0x0F 0x80 Setflag 0x200 release end #org $done release end #org $move #raw 0x10 0x10 0x10 0xFE #org $cele $cele 1 =Biiiii. |
Quote:
#org $move #raw 0x10 0x10 0x10 0xFE But always try it...XD |
ok
but this script has gone strange #org $start lock faceplayer checkflag 0x200 if b_true goto $done message $1 boxset 5 compare 0x800D 0x1 if 0x1 goto $check message $2 boxset 6 release end #org $check checkitem 0x4 #raw 0x05 0x00 compare 0x800D 0x1 if 0x4 goto $got message $2 boxset 6 release end #org $got message $3 boxset 6 warp 0x2 0x60 0x1 setflag 0x200 release end #org $done message $4 boxset 5 compare 0x800d 0x1 message $3 boxset 6 warp 0x2 0x60 0x1 release end #org $1 $1 1 =Would you like to goto\nCinnabar island? #org $2 $2 1 =Ohhh. Sorry you can't go yet. #org $3 $3 1 =ALL ABOARD!!! #org $4 $4 1 =Would you like to goto\nCinnabar island? on this script instead of warping to map 2.60 warp number 1 (i made a warp and map) but instead The screen just turns blank Why might this be? Also how do i make a script which gives yo a badge without having to battle so it will be you goup to a guy who says your a new trainer so you wont be strong enough for a battle so he just gives you the badge how can i do this?? |
Quote:
Quote:
But You have two options with that warp command. warp 2 60 1 or warp 0x2 0x3C 0x1 If there's a "0x" in front of it, then you have to make it a hexadecimal value, if it isn't in front of the number it's a decimal number or a 'normal' number. |
How do I have The script react to another I didn't get it in the flags part of you tutorial
|
OK, I feel really noobish for saying this...but HOW do you make scripts in the first place?
I looked all over the place to do it, and I couldn't find it out....so I just started typing in the window that pops up when I double click on Poket Script...and it starts giving me error messages! Could someone please help me? EDIT: Never mind, I figured out how to do it... |
use notepad
if you don't have notepad wellllllllll well your done for so its NOTEPAD! |
Yeah, I figured that out (thanks anyway).
I'm trying to implement this into a game, so I can test it out...but I'm not sure how. I looked at other tutorials, but no one was really clear about it. Could someone please explain it? |
http://www.pokecommunity.com/showthread.php?t=81691
Save you script as a .rbc file, then right click and "compile". Alternatively, you can open "BufRite.exe", file->import->find you script. Then you follow the instructions in the above thread (first tut) on how to Assign to the rom and then Burn (save) to the rom. It would be at this point that you open Advance Map and set the script offset on an event (character). |
Quote:
also how do you make someone give you a badge without battleing? |
Quote:
|
Quote:
Quote:
For example, in Fire Red/Leaf Green, if you wanted the player to recieve the first badge, all you need is this line. setflag 0x820 |
Quote:
#org $begin checkflag 0x201 if b_true goto $done applymovement 0x14 $move pausemove 0 message $hey boxset 6 applymovement 0x14 $move2 pausemove 0 setflag 0x201 release end #org $done release end #org $move #raw 0x20 0x20 0x20 0x20 0x20 0x62 0xFE #org $hey $hey 1 =Hey there, I am one of the\nthree dancers, come by our gym later. #org $move2 #raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1F 0x1F 0x60 0xFE |
erm, try this..?
Code:
|
not even that every time i walk ove it nothing happens
|
Quote:
Which Advance Map are you using? I am using 1.90, and there the fields "unknown" and "variable number" looks like this: Unknown: 0003 Var.Number:4051 And it works! Hope that's the problem. |
no that dosen't work.
would it be the check flag |
Quote:
release end Try using another set and checkflag you SURE didn't use before, than it should work. |
I tested the script myself and it worked fine.
I'll put up a video when YouTube finishes uplaoding it. ;) and yeah, I guess it's because of the setflag... |
no i haven't used 201 yet
|
Maybe it's used in an original script, so just try some other flag ;)
edit: Well, now I have a problem -.- I made two scripts: One should activate 'till the hero got the Pokedex fromr Oak. Then it should just release, It's this one: Code:
But now I have the second script, it should bar the hero from going into the arena 'till he received the 7th badge. There ist is: Code:
Pls help ^^ |
Quote:
|
what should change the flag to?
or is it the event number will i need to change it to D or something? |
Okay, this script works well up until when you get the DEX, and Pokemon. Then it skips right to $adventure when it should give message $mission
I also have a script on the first page that doesnt work. Code:
|
@pokepal2007: Just try another number, like checkflag 0x240 and later in the script setflag 0x240.
Quote:
Code:
But I hope at least this will work. If not, check if the unknown and the var.number in AM are REALLY right. It should work. |
ok i will try that then :) :)
|
Also the
#org $name call 0x1A74EB return just changed a couple of tiles... and namepokemon doesnt work |
Quote:
afaik you have to write gosub. |
im gunna start a game for script testing.
|
I did, this is the script I'm using it in:
Code:
|
I don't want to go over the whole script, because I myself might make some errors. (i've been using scriptEd)
But your main problem is your paragraphs. Messages always go after the main scripts, so you might want to re arrange everything. |
1 Attachment(s)
What a comprehensive thread on Pokescript!!
Well Done!! And I've a very basic problem....... I try to add a persion on PALLET TOWN and involves only simple dialogue, But the result shown is not my expectation.... My script is Code:
~~ HELP ME PLZ ~~ |
It's NOT a mistake in the script, I'm sure.
You made a mistake compiling it into the script. First, rightclick on the rubikon file. Click compile Klick destination and choose you Rom Then click the blue book or whatever Klick the searching symbol Then click the FIRST of the five numbers shown klick assign Then, there should be your $s, all marked blue. Klick file-burn Scroll up to the first number shown (should be"pushed $start to NUMBER) Copy the number and insert it in AM as offset If you did this correct it should work, there is no mistake in your script. e: did you use a japanese version? I'm not sure if it works with those. |
1 Attachment(s)
hm, i've got a very big problem, all scripts that i made turns always into a red screen, so i tested it by coping exectly the give pokemon script of thex4 in the first post. but when i click burn, there is a message (attachement) and i don't know what to do. this come for every script from $done to $5. i think maybe that's my problem, could someone help me please?
and sry for my bad english... |
well maybe just a grammatical mistake ;)
The problem is, no pointer leads to the $ in your image. If you post the whole script here I may be able to tell you whats wrong. But this IS a mistake inside the script. well maybe just a grammatical mistake ;) The problem is, no pointer leads to the $ in your image. If you post the whole script here I may be able to tell you whats wrong. But this IS a mistake inside the script. edit: i found a mistake inside the script : Code:
So add at the end just an #org $done message $gotit $gotit 1 = Is Charmander allright? boxset 6 release end |
ok my script looks now like this after i rename it to .rbc:
checkflag 0x828\par if b_true goto $done\par message $1\par boxset 5\par compare LASTRESULT 0x1\par if b_true goto $take\par message $2\par boxset 6\par release\par end\par \par #org $take\par givepokemon 4 5 0\par fanfare 0x13E\par message $3\par boxset 4\par waitfanfare\par #raw 0x68\par setflag 0x828\par message $4\par boxset 5\par compare LASTRESULT 0x1\par if b_true gosub $name\par message $5\par boxset 6\par release\par end\par \par #org $name\par call 0x1A74EB\par return\par \par #org $1\par $1 1 =I'm sorry, I can't take care\\nof my Charmander.\\pCan you take care of it for me?\par \par #org $2\par $2 1 =That's okay. I'm sure someone\\nelse will take it.\par \par #org $3\par $3 1 =\\c\\h01\\h02You received a Charmander!\par \par #org $4\par $4 1 =\\c\\h01\\h02Would you like to rename Charmander?\par \par #org $5\par $5 1 =Take Care of Charmander.\par } like i said before, it's exectly the script like in the first post, the givepokemon script. thank you for helping me! Edit: ok thank you very much, i'll try it out! |
write this:
Code:
Ich brauch aber noch einen beitrag um links schreiben zu dürfen... äh I mean, if you need it I translated it with permission of thethethethe into german on another board, but I'm not allowed to give links until I wrote 15 posts ^^ |
ok, thank you it works perfekt! maybe thethethethe should chance this script on the first post to the correct one! and no, thank you, but i don't need the scripts in german, but it's a good idea for german hackers like myself!^^
|
Quote:
Maybe my ROM has problem?? My ROM is Fire Red (U)....... Or my PkmAdv database has problem?? Many Thx for your help~ |
Quote:
@ dingo: I had the same problem, my person always said " ÁÈ Ì Make sure there aren't any spaces between the $ and the numbers (in Advance Map, the offset). And no Space before the $ too. My problem was solved when I really focused on the spaces and the steps when compiling the script. |
oh man, i've got the same problem over and over again.. now i've put a simple script:
#org $start lock faceplayer message $goodday boxset 6 release end #org $goodday $goodday 1 =Hi.\nit's a good day, isn't it? and now the same problem: floating pointer must be pushed, is there any mistake in this script? i can't found anyone. |
I've checked my script very carefully whether there are mistakes on spaces.
but my problem still exists....... Very desperate....... |
Quote:
If you followed the steps I wrote before (compiling) and didn't do any spaces when inserting the offset, it really should work. Maybe you should re-install Pokescript and the PkmnAdv? @dingo: oh man, don't have an idea of what could be wrong now -.- Sorry but it seems I can't help you with that. |
Sorry, my internet is playing up and I can't multiquote.
@Master_Track: Thanks for spotting the error, it's fixed now. In all that typing, I was bound to make at least one. Also, thanks for answering people's questions. @Dingo01930: I'd say re-install pokescript. I compiled and tried your script, without any troubles. @Shadow Arcanine Ummm... same as Dingo01930, I compiled your script, and it worked fine. All I can say is just try and re-install pokescript. |
ok thank you thex4, i reinstalled pokescript, now it works perfectly, thank you very much!
|
I reinstalled pkescript twice,
the same problem still exists....... Maybe my computer is not suitable for hacking pokemon..... Anyway , thx all of your reply~~~ |
um i made a script and it wont work
here it is #org $begin lock faceplayer message $w applymovement 0x04 $move pausemove 0x0 applymovement 0xFF $move2 pause 0x30 applymovement 0x04 $move3 applymovement 0xFF $move3 pausemove 0 release end #org $w $w 1 = Come with me\Jon:For what?\p???:no reason\nJon:k #org $move #raw 0x62 0x12 0x12 0x11 0x11 0xFE #org $move2 #raw 0x03 0xFE #org $move3 #raw 0x11 0x11 0x11 0x13 0xFE oh and by the way very nice Tutorial the best i have seen out of all i see |
I tried to compile my script but when I walked over It didn't work correctly It was suppose to swich to bit dark
here it is #org $start setweather 0x11 doweather release end what is wrong with it. |
I tried to compile my script but when I walked over It didn't work correctly It was suppose to swich to bit dark
|
I have but one question. If I wanted to change the color of some text, but just two words in a sentence, how could I use the color code to do this "This is the new Train Depot. It's still in construction so nobody's allowed past this point." I'm using fire red, although I'm not sure if you need to know that.
|
Quote:
And you should set a ceckflag and a setflag so the script can't activate again and again. Quote:
You know, variable number etc... it's written in the tutorial at APPLYMOVEMENT. If you don't change it it won't work. Quote:
This is the new \c\h01\h05Train Depot\c\h01\h02. It's still in construction so nobody's allowed past this point. (not sure if it's the right colour code, but you know the right...I hope^^) Explanation: First you write the normal black text, and if you write a colour code, ALL letters after the code will be in that colour. But if you choose another colour code, black, the rest will change to black again ^^ |
i'm really tired now, i tried a message script about 100 times, and all worked, i compiled the script, i burned it to the rom, i put the offset in advancemap, but every time i try to talk to that person, it turns to a red screen and the game froze, i re-installed pokescript twice, the givepokemonscript works, but not my messagescript, like i just said, it's the same like in the first post and i couldn't see any mistakes, what's wrong with my script? or why it turns to a red screen? please i need help
|
well I can only repeat this:
Look carefully at spaces. I can't say more to that, 'cause that was the reason why my screen turned read at my very first tries. When you copy the offset from bufrite, it happens that you copy a space. And when you insert it in Advance Map and the space is in the screen turns red or something else happens. If that's not the reason then I'm sry, I don't know. |
hm, thx, but this doesn't seem to be my problem, so i have to edit my text with a-text, i couldn't do anything else, if someone know something about my problem, please post, i'll try now if applymovements and trainerbattles work, if not, i'll post xD
|
Hi the
thethethethe! I saw your script school and made a wildbattle script. When i talk to "venusaur" everything just stopps and does not do anything. I write down the script #org $start lock faceplayer message $1 boxset 6 cry 0xA13 nop nop Wildbattle 3 36 0 fadescreen 0 #raw 0x53 0x0F 0x80 setflag 0x200 release end #org $1 $1 1 =VENUSAUR:Venu-Venu SAUR!! I also made a video. Search on youtube after sethHack and take by my things Pl0x help Anyone especialy thethethethe!! |
try this...
#org $start lock faceplayer message $1 boxset 6 cry 0xA1 0x03 pause 0x28 Wildbattle 3 36 0 fadescreen 0 #raw 0x53 0x0F 0x80 setflag 0x200 release end #org $1 $1 1 =VENUSAUR:Venu-Venu SAUR!! |
Quote:
|
Quote:
Quote:
Quote:
Quote:
Like this. Here's some example text. #org $1 $1 1 =Hello. Welcome to the \c\h01\h05Depot\c\h01\h02.\nSorry we aren't open yet. Quote:
Quote:
cry 0xA13 will stuff up the compiling process. It should have been cry 0xA1 0x3 |
Quote:
EDIT:I tried but it still doesnt work... It keeps sound like mew and glitch and freeze. |
Quote:
|
I've been trying to do an applymovement script, but it doesn't compile. It starts the log and then the log goes blank. Any ideas? Also I've noticed that other tutorials use #binary instead of #raw. Is there any difference? Which one works better?
|
I haven't tried binary yet, so I can't answer you question completly.
But one problem could be that the #raw is too long, for example: #raw 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0xFE this could cause problems when compiling, I got errors, so I split it up. |
Um... Well I got it... But how do I actually put it in the game??? I don't know HOW......
|
Quote:
|
One more THING, I tried your tutorial and wrote:
#org $start lock faceplayer message $1 boxset 6 cry 0xA1 151 nop nop wildbattle 151 30 0x8B fadescreen 0 #raw 0x53 0x0F 0x80 setflag 0x200 release end #org $1 $1 1 =MEW: Mew! Mew! But When I apply it on the game, It freezes or the mew go, YES, NO question.... Quote:
ANOTHER QUESTION, When you apply the script, What do you do about the PERSON ID in ADVANCE MAP??? |
Quote:
If you change the person ID to the number of the setflag of a script, the Overworld Sprite will dissappeare after the script was activated. |
I have made a rather large script and I got a few things which don't work.
Perhaps somebody could help. It's a fire red rom btw. Everything in red does not work. Code:
Thanks in advance, frank |
Ah...!Thanks god ,thank you, thethethethe, I find the commends about money and coins!!!!!!
You are so great~~ |
frank$sor, the script is fine, but the only thing that cause that one not to work is because of the trainerbattle command you gave.
It should not be trainerbattle 0, but it should be trainerbattle 1. ;) and put setflag 0x25E before warp. Warp ends the script, therefore, in your script, it no longer reads the setflag. so exchange their places. |
i've read through the whole thread, and no one seems to have this problem, so i'm a little embarassed by it, but i can get basic text, give item/pokemon, and movement scripts to work, but for some reason i cannot get the yes/no text script to work. the yes message works, but if i answer no, i still get the yes messge. does anyone have an idea of what i could possibly be doing because i've checked the script to where it is exactly the same as the example
|
| All times are GMT -8. The time now is 9:06 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.