Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] Scripting Guide for Beginner Hackers

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Closed Thread
 
Thread Tools
  #1    
Old December 20th, 2007 (12:21 PM). Edited December 25th, 2007 by Νιτραμ.
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
Scripting Guide for Beginner Hackers
Yep, that's what beginners were waiting for.


Introduction
Some welcome stuff...


Welcome to this guide!

What will we do here? We will learn basic scripting and maybe, only maybe, advanced bits. This is a document to help you create more complex hacks, not only plain map or graphics changing ones. You know, we all have seen them and they aren't good. It's now your turn to change it.
Every part of this guide will be in spoiler. If you need to e.g. go to bed cause it's too late, it's easier to just open a spoiler containing the desired section than scrolling whole page ;)

Contents
What will you learn here?
  • We will start with basic message displaying commands and later on we will progress to displaying player's and rival's name. We will learn to compare results in a YES/NO script. And we shall do a checkgender thingy, just for fun ;) This will be divided into two parts.
  • After that, we will start messing a bit with movement commands, meaning by explaining each and we will make a movement script.
  • As we want to make complex scripts we will start combinig our knowledge.
  • We will continue with flags. We will explain all three commands around flags. You will find out which ones they are down in the tutorial. We will also explain some pre-defined flags we will use in later scripts, as they will be unnecessary till you have Pokémon - we will use those flags when messing with giving a Pokémon.
  • We are almost in the giving item/Pokémon part, but we are still not there yet. Now we will play with special commands (and we will explain the national Pokédex trick) and then continue at the most anticipated part.
  • No, I won't let you go to giving Pokémon/item yet. We will have one feature not related to scripting before. Y ou will have the ability to test yourself after each section. You will get a task to make a script combining your current knowledge. You can complete each task and divide scripts into spoilers. I will check them later and tell you if you have the script correct. You may choose any of tthese tasks and let only one be reviewed. This is recommended.
  • Now you will learn about the part you've been waiting for: Giving a Pokémon. This is self explanatory, so I will give you further information in prper section.
  • We have the giving item part in fromt of us, we will mess with them a bit just for fun.
  • Now we will play with playing sounds. It will be fun and useful for a radio concept.
  • Now we will learn about changing weather. It will look dramatic ;) At least we should hope so :laugh:
  • Now you know everything you need for start, here is the final scripting task. It will be pretty hard, so you should be well-prepared and you will pass. I ask each of you who read this to make the script as a test after learning. If you complete the task well, you might earn a certificate of a well-trained beginner scripter. I will decide if I issue these as it may take more time than I planned, so I might only write it.
NOTE: For quick release of this guide, I did only a few things and released them immediately. I will add chapters and to easily recognize, finished parts will be in bold.

Introduction to scripting, basic message commands etc.
Our "Hello World!" tutorial ;)

Spoiler:
Let's start!

We all know that each and every tutorial needs to start with completely primitive things. And this tutorial ...will have a little exception. We will leasrn some advance bits in the very start of the tutorial. But first, we will say something about the first and most important line in the script. The offset.

Offsets and pointers


When making a script, the data needs to be stored in a free space of a ROM. The location of each and every byte is marked by an offset. It's a hex value representing the byte itself. It marks its position in the "row" For example a byte number 255 will have an offset 0x0000FF in common Pokémon Advance ROM.

That 0x tells the script parser that the offset isn't just random combination of letters and numbers, it's a specific number, unique in whole ROM. You cannot find two same offsets in a ROM, just many offests pointing to other one multiple times. These are called pointers. They are usually used when you need a separate offset for a part of script.

To let you understand better, I will show you in-game example. No video, though. It's recommended to look at it, but it's not needed, really.

Example

You suddenly become a very advanced scripter
- use your imagination.

Now, you need to make a movement script
- we will talk about these more deeply in the next section. You need to make a person move 3 steps left and one down. You need every single byte and so you search for the specific movement data... BINGO!

You found the data at offset 0x425FAC
- this, in reality, contains completely different data and is used here only for demonstrational purposes.

So you point the command saying "Move a sprite XY using data at offset..." to the
specified offset.

Defining an offset

We went too far when speaking about the first line. But it's good for something, anyway...

The very first command standing before the script offset is #org. How the whole line 1 looks like??


#org 0x******

Asterisks are representing the hex values. If you need some free offsets, I would recommend to move around the 800000 and higher. For your first script, we will use the offset 0x800000.

Sometimes, you need to lock moving person and make it face the player. You will do this with these two commands:


lock

faceplayer


That was easy, wasn't it? Well... you should only use these commands when interacting with moving people. You define the movement (like walking etc.) in your desired mapping program - AdvanceMap for example. I won't explain an furter cause it will be in my tutorial for absolute beginners, this one expects you to know the basic operations with AdvanceMap.


Message command

I won't explain that much as before. Just to warn you, we will start using the "pointer" term regularly, along with "offset". The command makes the game display text. The text will be stored at separate offset. The command uses a pointer to display the text stored in the other place. Basically, the script can start at offset 0x800000 and the message command points to the offset e.g. 0x100000 - again, it doesn't contain text data in real ROM. Back to the topic.

msgbox 0x******

Asterisks represent the offset. We will use 800100, as 800000 is the script start. It's space-wasting, but still, better than overwriting the data. Now, every message needs a boxset. We will use two or three types of boxset.

0x2 is normal boxset that closes after the text ends and you press a key. I think the boxset 0x6 does the pretty same thing. And 0x5 is the YES/NO boxset, we will talk about it in the last parts of this section.

We can use the
boxset 0x* variant for the command, but I want you to know the older command name (I think). So the one mentioned above, or

callstd 0x*

Asterisk represents the boxset type. We will use 2 or 5 now, cause I have them tested and we will need no more. You will need to put only one thing if you want a simple script with oxset 0x2 or 0x6:

Now, when we know the basic things, we shall advance to 0x5 boxset and
comparing the answer. But, if you want this simple script, you should put in only one more command.

release

end

Now that it's nice! We have a script! But if you want the person speaking to be locked - not moving - and facing player, you should put in lock and faceplayer commands right after the #org command and release command right before end, as mentioned before. This is optional, so don't need to worry.

Now, when you define the offset of the message, you need to put one there. You do it this way:

#org 0x******
= Text goes here.


Don't forget to put a space between "=" and the text itself, or the message won't display. Change asterisks into the desired offset.

Scripting task 1
Create a simple message script. Use the lock, faceplayer and release commands.

21.12. 2007 - A little update!

Hey kids, we didn't finish yet ;) I am here to explain the 0x5 boxset a bit. It's the typical Yes/No boxset. To let the game recognize what did the player choose, you need to compare results.
We start with the boxset:

callstd 0x5


Now we add the comparing command:

compare LASTRESULT 0x*

LASTRESULT is a pre-defined command stating the last result to be compared to the value written in the script. Yes is 0x1, No is 0x0. You can replace the asterisk with 0 or 1 respectively then.
We have it compared, but now, what to do? We will put in a if and goto command. There is another command that you can use to return into the script, but we will learn about it later. So, now you need to put in:

if 0x* goto 0x******

The first hex value should state if yes or no. It means that if you compare the script to the Yes choice and want the script to go to another location if Yes wasn't chosen, you need to put 0 here. If you want to redirect the script after the player chose Yes, put in 0x1. And the 6 asterisks after the second hex value mean offset, as always.

Now, you know everything you need to successfully make a nice script with speaking and player interaction.

Almost everything. You need to know how to display player's name and rival's name with a variable. Scizz's Advance Text uses [PLAYER] and [RIVAL] command. As none of the compilers work with these (maybe PokéScript does, but I recommend not to use it although it might seem user-friendly) currently - HackMew's XSE should work with these, if my information is correct - we will need to use standard variables for now.
\v\h01 for player and \v\h06 for rival.

If you don't know how to put in the "\" sign, go to the character map or just copy it from here. Not confirmed on all keyboard sets, but Ctrl+Alt+Q might work. It does on Slovak keyboard I am using. I am from there and so I don't use naturally all English glyphs and signs such as apostrophes, so these shortcuts can be handy. Not working on English keyboard settings, tho. Maybe a useful thingy for non-English dudes and gals here at PC.

Okay, now we are really done with this tut, please wait till the holiday time ends (around 8th of January) and then, some more content might appear. Check this thread regularly for updates in the holiday time ;) The checkgender part will be here soon, maybe today evening ;) For now, a little scripting should be done from your side:

Scripting task 2

Create a Yes/No script. Use the lock, faceplayer and release commands.
__________________
If you remeber me, feel free to send me a PM ;-)
  #2    
Old December 21st, 2007 (01:32 PM).
derv1205's Avatar
derv1205 derv1205 is offline
Trade/Battle/Breed/Clone (X,B2,D)
 
Join Date: Dec 2007
Location: Florida, USA
Gender: Male
Nature: Adamant
Posts: 273
Nice introduction, this tutorials would be in ScriptEd? , or in PoketScript?
__________________
FC 3DS: 1821 - 8876 - 6418 , Playing Pokemon X & Omega Ruby - Add me and let me know please!
FS: Flying type - Swanna, Doduo, Hawlucha
TSV: 2631 - if needed contact me.

Derv1205's Shop! <- Several IV, Shiny, Legendary, Event Pokemon! Come in take a look

Trader Review thread <- If we've traded a review is much appreciated. Thank you!

"Trade. Breed. Train. Battle."
  #3    
Old December 22nd, 2007 (12:18 AM).
/Circa's Avatar
/Circa /Circa is offline
a face in the clouds.
 
Join Date: Nov 2007
Location: Melbourne, Victoria
Gender: Male
Nature: Quiet
Posts: 881
These scripts work in both programs, though I think there a some different commands and styles.

This is very detailed for just the basic commands Martin, well done.
__________________
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.
  #4    
Old December 22nd, 2007 (04:42 PM).
cooley's Avatar
cooley cooley is offline
///Keepin' it simple
Silver Tier
 
Join Date: Feb 2007
Location: United States
Age: 20
Gender: Male
Nature: Impish
Posts: 1,150
Send a message via Windows Live Messenger to cooley Send a message via Skype™ to cooley
Another scripting tutorial...If I was a Beginner I would Learn scripting that quick!
Good Job martin.
__________________

  #5    
Old December 23rd, 2007 (12:04 AM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Hey martin well I gave the offset for my first script as 0x800000 and then for my second script I gave the offset 0x800101 but then when I play the game both the scripts get mixed. Well take a look at it-

Well this is my first script for a boy:-
#org 0x800000
lock
faceplayer
message 0x800100
boxset 0x02
end
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.
release
end

And here is my second script for a signpost:-
#org 0x8000101
message 0x800200
boxset 0x02
#org 0x800200
= Beware of pokemon.

Well the thing is when I talk to the boy he says everything correctly but in the end instead of saying 'Could I get your autograph' he says 'Could I get your beware of pokemon'. And when I try to go near the signpost the game hangs. So whats the problem with it. Thanks in advance.
  #6    
Old December 23rd, 2007 (02:18 AM). Edited December 23rd, 2007 by Νιτραμ.
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
Quote originally posted by derv1205:
Nice introduction, this tutorials would be in ScriptEd? , or in PoketScript?
I have nothing against Irish Witch and her programming efforts, but the scripting language is too far from the common ScriptED one. This guide will be for ScriptED and for HackMew's upcoming script compiler, XSE. Because both will work with same scripting language, but XSE will have enhanced command database. I will transition to XSE when it comes to the store xD

Quote originally posted by Crashink:
These scripts work in both programs, though I think there a some different commands and styles.

This is very detailed for just the basic commands Martin, well done.
Thank you. This guide was meant to be really detailed, beginners would never know what are they doing if they didn't know deeper meaning of the command itself.

Quote originally posted by cooley:
Another scripting tutorial...If I was a Beginner I would Learn scripting that quick!
Good Job martin.
Thank you for your support. I will make a little banner to promote this guide, if you want, you can put it into your signature then.

Quote originally posted by akash:
Hey martin well I gave the offset for my first script as 0x800000 and then for my second script I gave the offset 0x800101 but then when I play the game both the scripts get mixed. Well take a look at it-

Well this is my first script for a boy:-
#org 0x800000
lock
faceplayer
message 0x800100
boxset 0x02
end
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.
release
end

And here is my second script for a signpost:-
#org 0x8000101
message 0x800200
boxset 0x02
#org 0x800200
= Beware of pokemon.

Well the thing is when I talk to the boy he says everything correctly but in the end instead of saying 'Could I get your autograph' he says 'Could I get your beware of pokemon'. And when I try to go near the signpost the game hangs. So whats the problem with it. Thanks in advance.
You don't pay attentťion to script formatting. It doesn't matter, cause I will explain now ;)

Your first script is formatted in a different way than it should be. Fixed scripts with comments are here:

#org 0x800000
lock
faceplayer
message 0x800100 *Doesn't make any difference, but I would recommend using commands stated in the tutorial. But it's a matter of what are you used to.
boxset 0x02 *Would recommend simple 0x2
end *It shouldn't be there.
release
end

*The message should be here. Don't put it into the center of script, but 1 line after the script.
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.


#org 0x8000101 800200 - Always leave at least 100 between two scripts.
message 0x800200 800300 Just fixing the offsets.
boxset 0x02
#org 0x800200 800300
= Beware of pokemon.
__________________
If you remeber me, feel free to send me a PM ;-)
  #7    
Old December 23rd, 2007 (04:34 AM).
thethethethe thethethethe is offline
 
Join Date: Jun 2007
Location: Melbourne, Australia
Gender: Male
Posts: 1,104
Quote originally posted by Martin²:
You don't pay attentťion to script formatting. It doesn't matter, cause I will explain now ;)

Your first script is formatted in a different way than it should be. Fixed scripts with comments are here:

#org 0x800000
lock
faceplayer
message 0x800100 *Doesn't make any difference, but I would recommend using commands stated in the tutorial. But it's a matter of what are you used to.
boxset 0x02 *Would recommend simple 0x2
end *It shouldn't be there.
release
end

*The message should be here. Don't put it into the center of script, but 1 line after the script.
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.


#org 0x8000101 800200 - Always leave at least 100 between two scripts.
message 0x800200 800300 Just fixing the offsets.
boxset 0x02
#org 0x800200 800300
= Beware of pokemon.
I'll start with great tutorial Martin. It's really in depth and explains every clearly so that someone completely new to the concept of Hacking can understand.

Now onto akash's script, because of the bytes needed for the text, shouldn't the offsets you gave, be further apart?
The text of the first script would exceed that 100 gap that you made.
Sorry, about pointing this out, but I think it's better if you've actually given a working script, instead of a script with the same problem he had before.
I moved the message pointers to save a little more space.
Code:
#org 0x800000
lock
faceplayer
message 0x800010
boxset 0x02
release
end
#org 0x800010
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.
Code:
#org 0x800150
message 0x800160
boxset 0x02
release
end
#org 0x800160
= Beware of pokemon.
__________________
Gone.
  #8    
Old December 23rd, 2007 (11:14 AM).
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
Oh, sorry then, I just got used to putting 100 between each command... I usually don't pay closer attention to this... my fault. And thank you for support and fixing it :)


~Martin
__________________
If you remeber me, feel free to send me a PM ;-)
  #9    
Old December 24th, 2007 (08:41 AM).
изм изм is offline
 
Join Date: Dec 2007
Location: 18.96N,72.82E
Gender: Male
Nature: Calm
Posts: 951
Send a message via Windows Live Messenger to изм Send a message via Yahoo to изм Send a message via Skype™ to изм
Voila~~ Nice Tutorial i needed this will learn this soon~~ > lol :D
__________________




  #10    
Old December 24th, 2007 (09:09 AM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Thanks for the help. Well does anyone know how to make a give pokemon script and a trainer battle script in Script Ed using this tutorials commands.
  #11    
Old December 24th, 2007 (09:58 AM).
TB Pro's Avatar
TB Pro TB Pro is offline
Old-timer
 
Join Date: Nov 2004
Location: Midwestern USA
Age: 20
Gender: Male
Posts: 2,739
Ok here goes.
I am sooo a super n00b to scripting ^_^!
I tried out your tests and here they are
Spoiler:
#ORG $800000
lock
faceplayer
boxset 0x05
compare LASTRESULT 0x00
If 0x01 goto 0x800001
release
end

#org 0x00
= Oh, Okay then.
release
end

#ORG 0x01
= Thank you so much!
release
end

Yes,
I know there is something wrong about it but....
I dont know what <_>!
So plz Help!
And my other one
Spoiler:
#ORG 0x800100
lock
faceplayer
msgbox 0x800200
boxset 0x06
release
end

#ORG 0x800200
= Hi,/nare you new to this town?
release
end

So if anything is wrong with this plz point it out!
__________________
--I'm a creepin'..
  #12    
Old December 24th, 2007 (12:51 PM).
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
@Blazikendude

Switch the $ sign with 0x and write in lowercase - commands.
And when writing out whole message offset, 0x01 isn't enough. You need to fill all out.

I will fix this for you, but last time. No one will get errors fixed before. You need to learn from other scripts too.

First, you need to put more space into your script. I think that for your script, 100 between offsets should do. Meaning that as a starting offset you would use 0x800000 and as a message offset you use 0x800100. And when you write the message, you must write out WHOLE offset: 0x800100, not 0x100 or 0x01 - the wrong one.

@akash

This will be explained in this guide, too, don't worry. But I have holidays and cannot stay on the computer for long - look, it's Christmas Eve and I am sitting in front of computer and answering questions.

The giving scripts and battling ones will be explained here, too, but those aren't a thing for beginner. Please don't try to ask in Script request forum, you will learn this with a bit of help in this guide, but I am planning to finish this guide in a month or more, but maybe sooner. And as those things you ask for belong to hardest scripting parts - mainly hardest to explain, you will have to wait a bit. Sorry.

@TotoMud

Thanks for support :)
__________________
If you remeber me, feel free to send me a PM ;-)
  #13    
Old December 24th, 2007 (11:56 PM). Edited December 25th, 2007 by akash.
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Well thats ok Martin thanks and by the way MERY CHRISTMAS. And could you explain the yes/no script. I really didnt understand that. Well I saw the commands that came with elite map pack. In that I saw the give pokemon command. It was givepokemon iSpecies bLevel iItem. So should I just type that command in the script or should I give it some offset.
  #14    
Old December 25th, 2007 (02:30 AM).
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
Dear akash,

as I said, I will make guide for the givepokemon command. I am pretty sure you don't know what to replace those variables with correct numbers. Anyway, you would have to add some blank binary data but I am not sure how many, so I will need to check when writing the specific part of guide.

The Yes/No script is pretty well explained in the first part of the guide, but I will make up one here for you. I will comment the Yes/No part, so you might understand better.

#org 0x800000
msgbox 0x800100
callstd 0x5

compare LASTRESULT 0x1 - if player chose yes.
if 0x1 goto 0x800200 - if he did so, he will be redirected to 0x800200
msgbox 0x800400
callstd 0x2
end

#org 0x800200
msgbox 0x800300
callstd 0x2
end

'-----------------------------------------------------------

#org 0x800100
= Pick of the two options.

#org 0x800300
= You chose YES.

#org 0x800400
= You chose NO.


Hope this will do. The script is pretty easy to make, but you shouldn't get confused with the compare command. Try to compile this script in ScriptED and see how it works, and if it works. Merry Christmas!

EDIT: Don't forget to delete comments and the divider to make script work properly.

EDIT2: Ah, I made a mistake and the person doesn't behave correctly. Who will fix this for me? ;) I will certify the first 5 people as an official guide users and I will provide more information about my progress to him/her ;)
__________________
If you remeber me, feel free to send me a PM ;-)
  #15    
Old December 25th, 2007 (05:17 AM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Well thanks Martin. Well I have another question. In elite map it says Ctrl+click to view the script. Then when I ctrl+click the script ed opens but it will be totally blank. So can you help me with this.
  #16    
Old December 25th, 2007 (11:44 AM).
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
ScriptED Troubleshooting

1. Help! My script doesn't compile/ When trying to load the script from game, it stays blank!

Simple solution. I guess you're using Windows (not Wine on Linux, I don't know a solution for that OS, although I know it a bit, used before). You need to open a folder. Any. Open Settings/Preferences - I don't know which one is correct translation - and choose Folder Options. There, click on the second tab. Find a checkbox "Hide extensions of registered file types" or something like that. Uncheck. Done. It should be okay now, worked for me since Win 2000.
__________________
If you remeber me, feel free to send me a PM ;-)
  #17    
Old December 25th, 2007 (02:46 PM).
TB Pro's Avatar
TB Pro TB Pro is offline
Old-timer
 
Join Date: Nov 2004
Location: Midwestern USA
Age: 20
Gender: Male
Posts: 2,739
Hey Martin you forgot to put
Lock and
Faceplayer in your script....
__________________
--I'm a creepin'..
  #18    
Old December 26th, 2007 (08:36 AM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Hey Martin its still not working. Well do you have any other ideas. I am using script ed. I have got windows XP.
  #19    
Old December 27th, 2007 (08:48 AM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Hey well I found a script in my folder and then I just changed the offsets and tried to compile it. But it said "Type missmatch." So could anyone help me. Well here is the script.
Spoiler:
#org 0x8004EC
lock
faceplayer
checkflag 0x101
if 0x1 jump 0x800550
msgbox 0x8005B4 ' This is a renowned fishing spot.\nAre you getting the itch to
fish?
callstd MSG_YESNO ' Yes/No msg
compare LASTRESULT 0x1
if 0x1 jump 0x800618
compare LASTRESULT 0x0
if 0x1 jump 0x80067C
end
#org 0x800550
message 0x810000 ' Yo!\nHow's your fishing?
showmsg
multichoice 0x14 0x8 0x32 0x1
compare LASTRESULT 0x0
if 0x1 jump 0x810064
compare LASTRESULT 0x1
if 0x1 jump 0x820000
end
#org 0x810064
msgbox 0x820064 ' Is that right! That's great!\nHaul in some big ones!
callstd MSG_NOCLOSE ' Non-closing msg
release
end
#org 0x800618
msgbox 0x8100C8 ' I hear you, and I like what\nyou're saying!\pI'll give you on
e of my fishing RODS.
callstd MSG_NOCLOSE ' Non-closing msg
copyvarifnotzero 0x8000 0x106
copyvarifnotzero 0x8001 0x1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x101
msgbox 0x81012C ' And, as an added bonus, I'll even throw\nin a little fishing
advice!\pFirst, you want to face the water,\nthen use the ROD.\pFocus your mind.
..\nIf you get a bite, pull on the ROD.\pSometimes you can snag something\nimmed
iately, but with bigger catches,\lyou need to time the pulls on your ROD\lto hau
l them in.
callstd MSG_NOCLOSE ' Non-closing msg
release
end
#org 0x80067C
msgbox 0x810190 ' Oh, is that so?\nThat's too bad, then.
callstd MSG_NOCLOSE ' Non-closing msg
release
end
#org 0x820000
msgbox 0x8200C8 ' Oh, hey, don't get down on yourself!\nI'll give you a little
fishing advice.\pFirst, you want to face the water,\nthen use the ROD.\pFocus yo
ur mind...\nIf you get a bite, pull the ROD.\pSometimes you can snag something\n
immediately, but with bigger catches,\lyou need to time the pulls on your ROD\lt
o haul them in.
callstd MSG_NOCLOSE ' Non-closing msg
release
end
#org 0x8005B4
= This is a renowned fishing spot.\nAre you getting the itch to fish?
#org 0x810000
= Yo!\nHow's your fishing?
#org 0x820064
= Is that right! That's great!\nHaul in some big ones!
#org 0x8100C8
= I hear you, and I like what\nyou're saying!\pI'll give you one of my fishing R
ODS.
#org 0x81012C
= And, as an added bonus, I'll even throw\nin a little fishing advice!\pFirst, y
ou want to face the water,\nthen use the ROD.\pFocus your mind...\nIf you get a
bite, pull on the ROD.\pSometimes you can snag something\nimmediately, but with
bigger catches,\lyou need to time the pulls on your ROD\lto haul them in.
#org 0x810190
= Oh, is that so?\nThat's too bad, then.
#org 0x8200C8
= Oh, hey, don't get down on yourself!\nI'll give you a little fishing advice.\p
First, you want to face the water,\nthen use the ROD.\pFocus your mind...\nIf yo
u get a bite, pull the ROD.\pSometimes you can snag something\nimmediately, but
with bigger catches,\lyou need to time the pulls on your ROD\lto haul them in.


Thanks in advance.
__________________




Need help in pokemon ruby hack for:
Title screen editing.
Scripting.
How to add warps.
editing maps.

  #20    
Old December 27th, 2007 (11:36 PM). Edited December 28th, 2007 by thethethethe.
thethethethe thethethethe is offline
 
Join Date: Jun 2007
Location: Melbourne, Australia
Gender: Male
Posts: 1,104
Quote originally posted by akash:
Hey well I found a script in my folder and then I just changed the offsets and tried to compile it. But it said "Type missmatch." So could anyone help me. Well here is the script.
Spoiler:
#org 0x8004EC
lock
faceplayer
checkflag 0x101
if 0x1 jump 0x800550
msgbox 0x8005B4
callstd 0x5
compare LASTRESULT 0x1
if 0x1 jump 0x800618
compare LASTRESULT 0x0
if 0x1 jump 0x80067C
end

#org 0x800550
message 0x810000
callstd 0x4
multi 0x14 0x8 0x32 0x1
compare LASTRESULT 0x0
if 0x1 jump 0x810064
compare LASTRESULT 0x1
if 0x1 jump 0x820000
end

#org 0x810064
#raw 0x68
msgbox 0x820064
callstd 0x6
release
end
#org 0x800618
msgbox 0x8100C8
callstd 0x4
copyvarifnotzero 0x8000 0x106
copyvarifnotzero 0x8001 0x1
callstd 0x0
setflag 0x101
msgbox 0x81012C
callstd 0x4
#raw 0x68
release
end
#org 0x80067C
msgbox 0x810190
callstd 0x4
#raw 0x68
release
end

#org 0x820000
msgbox 0x8200C8
callstd 0x4
#raw 0x68
release
end

#org 0x8005B4
= This is a renowned fishing spot.\nAre you getting the itch to fish?

#org 0x810000
= Yo!\nHow's your fishing?

#org 0x820064
= Is that right! That's great!\nHaul in some big ones!

#org 0x8100C8
= I hear you, and I like what\nyou're saying!\pI'll give you one of my fishing RODS.

#org 0x81012C
= And, as an added bonus, I'll even throw\nin a little fishing advice!\pFirst, y
ou want to face the water,\nthen use the ROD.\pFocus your mind...\nIf you get a bite, pull on the ROD.\pSometimes you can snag something\nimmediately, but with bigger catches,\lyou need to time the pulls on your ROD\lto haul them in.

#org 0x810190
= Oh, is that so?\nThat's too bad, then.

#org 0x8200C8
= Oh, hey, don't get down on yourself!\nI'll give you a little fishing advice.\p
First, you want to face the water,\nthen use the ROD.\pFocus your mind...\nIf you get a bite, pull the ROD.\pSometimes you can snag something\nimmediately, butwith bigger catches,\lyou need to time the pulls on your ROD\lto haul them in.


Thanks in advance.
You're better off learning to write your own scripts than just taking them from other places. I haven't checked all the offsets, but if they're all ok(since, they're all so far apart), the script should work now.
__________________
Gone.
  #21    
Old December 28th, 2007 (02:53 AM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Well ok thanks thethethethe. Man scripting is becoming a bit easy but still can't understand big scripts.
__________________




Need help in pokemon ruby hack for:
Title screen editing.
Scripting.
How to add warps.
editing maps.

  #22    
Old December 29th, 2007 (10:59 PM).
akash's Avatar
akash akash is offline
Pikachu is the best.
 
Join Date: Dec 2007
Location: India
Age: 21
Gender:
Nature: Calm
Posts: 21
Hey can anyone tell me whats wrong with this script. It is an item script. Well here it is, the script-

#org 0x850000
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
callstd 0x6 ' PLAYER found one XXXXXX!
end

Thanks in advance.
__________________




Need help in pokemon ruby hack for:
Title screen editing.
Scripting.
How to add warps.
editing maps.

  #23    
Old December 29th, 2007 (11:02 PM).
/Circa's Avatar
/Circa /Circa is offline
a face in the clouds.
 
Join Date: Nov 2007
Location: Melbourne, Victoria
Gender: Male
Nature: Quiet
Posts: 881
You should stick too asking these in the scrapbox, but i'll do it anyway...

Code:
#org $begin
lock
faceplayer
giveitem 0xD 0x1
message $getitem
boxset 0x6
#raw 0x53
release
end

#org $getitem
= You found a XXXXXXX!
That is a basic item script..
__________________
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.
  #24    
Old December 29th, 2007 (11:53 PM).
thethethethe thethethethe is offline
 
Join Date: Jun 2007
Location: Melbourne, Australia
Gender: Male
Posts: 1,104
Quote originally posted by Crashink:
You should stick too asking these in the scrapbox, but i'll do it anyway...

Code:
#org $begin
lock
faceplayer
giveitem 0xD 0x1
message $getitem
boxset 0x6
#raw 0x53
release
end

#org $getitem
= You found a XXXXXXX!
That is a basic item script..
In Scripted there is no Give Item command. That's why akash's script is written like that. What's written in akash's script is what's done in by giveitem. This is a scriptED tutorial so a some things are going to be different to what you might know, pokescript-wise.

Quote originally posted by akash:
Hey can anyone tell me whats wrong with this script. It is an item script. Well here it is, the script-

#org 0x850000
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
callstd 0x6 ' PLAYER found one XXXXXX!
end

Thanks in advance.
Like Crashlink said, you should just have posted this in the script thread in the scrap box, especially since, this has been covered in the tutorial yet.

But It should be like this.....
Code:
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
callstd 0x0
__________________
Gone.
  #25    
Old December 30th, 2007 (07:30 AM).
Νιτραμ Νιτραμ is offline
 
Join Date: Nov 2007
Posts: 230
Oh, long time, no see, guys.

I would like to ask you to only post task-related scripts here, or I will ask a moderator to lock up this thread and there will be no guide. Blazikendude, you're right, I didn't put a lock and faceplayer, along with release command in the end, you will now recieve ocassional PMs with guide status. Akash, I have no clue what's wrong with ScriptED, why it isn't working. It happened to me till I didn't turn off the Windows feature mentioned in the troubleshooting. I cannot help you then.

Please, all of you, stay tuned on updates ;)
__________________
If you remeber me, feel free to send me a PM ;-)
Closed Thread
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 03:32 AM.