Remove Ad, Sign Up
Register to Remove Ad
Register to Remove Ad
Remove Ad, Sign Up
Register to Remove Ad
Register to Remove Ad
Signup for Free!
-More Features-
-Far Less Ads-
About   Users   Help
Users & Guests Online
On Page: 1
Directory: 1 & 107
Entire Site: 8 & 1704
Page Staff: pokemon x, pennylessz, Barathemos, tgags123, alexanyways, supercool22, RavusRat,
05-15-24 08:41 PM

Forum Links

Thread Information

Views
11,684
Replies
13
Rating
0
Status
CLOSED
Thread
Creator
BNuge
01-20-12 08:12 PM
Last
Post
Austin96
02-10-12 03:27 PM
Additional Thread Details
Views: 1,003
Today: 0
Users: 0 unique

Thread Actions

Thread Closed
New Thread
New Poll
Order
 

Hacking FireRed

 

01-20-12 08:12 PM
BNuge is Offline
| ID: 533720 | 178 Words

BNuge
Level: 138


POSTS: 4604/5714
POST EXP: 365399
LVL EXP: 30933446
CP: 14432.8
VIZ: 1505987

Likes: 0  Dislikes: 0
When I became a Game Programming major, I decided to go back to working on hacking FireRed. I originally gave up because I kept running into MissingNo. The Magikarps in the grass might be related. I took those out and the MissingNo's went away.

Besides that, I ran into a few glitches (like when the old man catches a Weedle you can't move anymore). I solved that issue by deleting his event. You can still talk to him and trigger the glitch, but he won't stop you automatically.

So now we come to my current issue. How do I set a character to give an item or Pokémon to someone. I want to have a guy give the player an Abra since Teleport can override most glitches that prevent movement but allow use of the Start Menu. I use Advance Map and Advance Text the most. I also have EliteMap, but that program makes no sense to me at all.

As long as it's virus-free, I might be willing to download another program. Sooo, who wants to help?
When I became a Game Programming major, I decided to go back to working on hacking FireRed. I originally gave up because I kept running into MissingNo. The Magikarps in the grass might be related. I took those out and the MissingNo's went away.

Besides that, I ran into a few glitches (like when the old man catches a Weedle you can't move anymore). I solved that issue by deleting his event. You can still talk to him and trigger the glitch, but he won't stop you automatically.

So now we come to my current issue. How do I set a character to give an item or Pokémon to someone. I want to have a guy give the player an Abra since Teleport can override most glitches that prevent movement but allow use of the Start Menu. I use Advance Map and Advance Text the most. I also have EliteMap, but that program makes no sense to me at all.

As long as it's virus-free, I might be willing to download another program. Sooo, who wants to help?
Vizzed Elite
Third Place in Feb 2011 VCS Achieved Ravering Syndrome + on Jan 6, 2012


Affected by 'Laziness Syndrome'

Registered: 04-30-10
Location: Northeast US
Last Post: 1239 days
Last Active: 465 days

01-21-12 08:40 PM
tj4bigred is Offline
| ID: 534077 | 36 Words

tj4bigred
Level: 131


POSTS: 3685/5152
POST EXP: 187571
LVL EXP: 26191584
CP: 4610.1
VIZ: 124091

Likes: 0  Dislikes: 0
Nothing better than a well made Pokemon hack. I'm not one for designing maps are scripting, (which I'm assuming you are doing ) but I've got plenty of good ideas and I'd love to help test.
Nothing better than a well made Pokemon hack. I'm not one for designing maps are scripting, (which I'm assuming you are doing ) but I've got plenty of good ideas and I'd love to help test.
Vizzed Elite
Cancerous


Affected by 'Laziness Syndrome'

Registered: 08-21-10
Last Post: 4050 days
Last Active: 3379 days

01-21-12 09:15 PM
BNuge is Offline
| ID: 534096 | 89 Words

BNuge
Level: 138


POSTS: 4607/5714
POST EXP: 365399
LVL EXP: 30933446
CP: 14432.8
VIZ: 1505987

Likes: 0  Dislikes: 0
tj4bigred :

I'm not messing with the code directly. Advance Map and Advance Text let me change the map, movement positions, wild Pokémon, dialogue, etc. I need a program that lets me have a character give a Pokémon or Item to the player.

Given what I've read in other threads (that weren't helpful), I think I'll summon...


legacyme3 :
the_casualty :

I need a specific program for getting NPCs to be able to give a Pokémon/Item to the player. Just a URL to the main page of a site is not helpful.
tj4bigred :

I'm not messing with the code directly. Advance Map and Advance Text let me change the map, movement positions, wild Pokémon, dialogue, etc. I need a program that lets me have a character give a Pokémon or Item to the player.

Given what I've read in other threads (that weren't helpful), I think I'll summon...


legacyme3 :
the_casualty :

I need a specific program for getting NPCs to be able to give a Pokémon/Item to the player. Just a URL to the main page of a site is not helpful.
Vizzed Elite
Third Place in Feb 2011 VCS Achieved Ravering Syndrome + on Jan 6, 2012


Affected by 'Laziness Syndrome'

Registered: 04-30-10
Location: Northeast US
Last Post: 1239 days
Last Active: 465 days

01-21-12 09:28 PM
legacyme3 is Offline
| ID: 534106 | 30 Words

legacyme3
Lord Leggy - King of IT
Level: 268


POSTS: 13228/27250
POST EXP: 2003421
LVL EXP: 317833482
CP: 42531.1
VIZ: 2982476

Likes: 0  Dislikes: 0
I may be wrong, but you should be able to do that with a script editor.

It goes in conjunction with Advance Text, and can be edited along side it.
I may be wrong, but you should be able to do that with a script editor.

It goes in conjunction with Advance Text, and can be edited along side it.
Vizzed Elite
6-Time VCS Winner

One Leggy.
One Love.
One Dream.


Affected by 'Laziness Syndrome'

Registered: 09-14-10
Location: https://discord.gg/YCuUJz9
Last Post: 1339 days
Last Active: 1339 days

01-21-12 09:29 PM
tj4bigred is Offline
| ID: 534107 | 16 Words

tj4bigred
Level: 131


POSTS: 3693/5152
POST EXP: 187571
LVL EXP: 26191584
CP: 4610.1
VIZ: 124091

Likes: 0  Dislikes: 0
Sounds good. I'd still love to help if you could find a role for me.
Sounds good. I'd still love to help if you could find a role for me.
Vizzed Elite
Cancerous


Affected by 'Laziness Syndrome'

Registered: 08-21-10
Last Post: 4050 days
Last Active: 3379 days

01-21-12 10:37 PM
BNuge is Offline
| ID: 534133 | 20 Words

BNuge
Level: 138


POSTS: 4609/5714
POST EXP: 365399
LVL EXP: 30933446
CP: 14432.8
VIZ: 1505987

Likes: 0  Dislikes: 0
legacyme3 :

Can you dumb it down a bit? Is a script editor some kind of coding term or a program?
legacyme3 :

Can you dumb it down a bit? Is a script editor some kind of coding term or a program?
Vizzed Elite
Third Place in Feb 2011 VCS Achieved Ravering Syndrome + on Jan 6, 2012


Affected by 'Laziness Syndrome'

Registered: 04-30-10
Location: Northeast US
Last Post: 1239 days
Last Active: 465 days

01-22-12 07:24 AM
legacyme3 is Offline
| ID: 534217 | 14 Words

legacyme3
Lord Leggy - King of IT
Level: 268


POSTS: 13230/27250
POST EXP: 2003421
LVL EXP: 317833482
CP: 42531.1
VIZ: 2982476

Likes: 0  Dislikes: 0
http://www.pokecommunity.com/showthread.php?t=116370

This might be the best way I can explain it.

Hope this helps.
http://www.pokecommunity.com/showthread.php?t=116370

This might be the best way I can explain it.

Hope this helps.
Vizzed Elite
6-Time VCS Winner

One Leggy.
One Love.
One Dream.


Affected by 'Laziness Syndrome'

Registered: 09-14-10
Location: https://discord.gg/YCuUJz9
Last Post: 1339 days
Last Active: 1339 days

01-22-12 12:05 PM
BNuge is Offline
| ID: 534304 | 26 Words

BNuge
Level: 138


POSTS: 4613/5714
POST EXP: 365399
LVL EXP: 30933446
CP: 14432.8
VIZ: 1505987

Likes: 0  Dislikes: 0
legacyme3 :

I don't know enough coding to really understand script. Advanced Map lets me change the map, wild Pokémon, movement positions, etc. without touching any script.
legacyme3 :

I don't know enough coding to really understand script. Advanced Map lets me change the map, wild Pokémon, movement positions, etc. without touching any script.
Vizzed Elite
Third Place in Feb 2011 VCS Achieved Ravering Syndrome + on Jan 6, 2012


Affected by 'Laziness Syndrome'

Registered: 04-30-10
Location: Northeast US
Last Post: 1239 days
Last Active: 465 days

01-29-12 07:21 PM
Nksor is Offline
| ID: 537148 | 2601 Words

Nksor
the_casualty
Level: 138


POSTS: 5682/5856
POST EXP: 228223
LVL EXP: 31613983
CP: 1171.6
VIZ: 131963

Likes: 0  Dislikes: 0
legacyme3 : That was a link to Pokescript, which is outdated and in general shouldn't be used. So, uh, don't use it.

---

I apologize for the delay. I just wanted to make sure that everything made sense, and I made sure that all of my data was 100% correct. I know that you may be uncomfortable with scripting, but I have it to the point where you can basically just copy-paste what I have down.


the_casualty's impromptu Give Pokemon in XSE tutorial



(Please note that all of the documents and tools that I link to on this tutorial are not by myself but instead by other members of the Pokemon Hacking Community. Please also note that a lot of the values here are strictly FireRed/LeafGreen related; some of the values here aren't guaranteed to work with Ruby/Sapphire/Emerald.)

Before we get started... what version of Advance Map are you using? 1.95 edits wild Pokemon, events, and some other things kind of odd (and sometimes leads to errors), which might be the root of your problems.

In fact, you really shouldn't even use that version.

Pick up Advance Map 1.92 and use it instead.

What you're trying to accomplish requires script editing. I very highly recommend that you pick up XSE to get the job done, and this tutorial covers XSE scripting.

I'll be discussing the hexadecimal system a bit in this tutorial; if you're unfamiliar with it, I'd suggest reading this introduction to hex before we jump in.

---

After you get XSE downloaded, unzip it, and then open up Advance Map, Settings -> Choose script editor. Navigate to XSE, viola.

Advance Map makes you implement events in a roundabout way. You need to find an event that’s already on the map, then go down to "Amount of Events" and add the number of events that you need. In this case, we want to add an extra "person" event, so increment it up by one. The event you want will appear in the top left corner of the map. Drag it down to where it's accessible for your player to interact with. Now we can begin!

Your new guy will need a script offset, as to differentiate from the rest of the events. It can just be random letters and numbers. You'll also probably want to edit his walking pattern, talking level (the usual choice is [03]) and picture.

Now we can really get started. Click "Open script" and we'll begin. It'll prompt you with a question; just click "Yes".

XSE may look overwhelming at first, but really all it consists of is a text editor with a built in hex calculator and sticky-note style notepad.

A common "give Pokemon" code is as follows. I'll explain each part of it.

#dynamic 0x9A76B1

#org @start
checkflag 0x8C3
if 0x1 goto @done
msgbox @1 0x5
compare LASTRESULT 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @take
givepokemon 0x3F 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x8C3
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @1
= It's dangerous to go alone!nTake this!

#org @2
= I can't begin to stress how much you need this Pokemon.

#org @3
= [black_fr]You received an Abra!

#org @4
= [black_fr]Would you like to give annickname to your new Abra?

#org @5
= This will help you very much innyour journey.

#org @6
= How is my gift faring for you?


I can imagine the eyes popping out of your skull right now. I'll break it all down; let's start from the top.

#dynamic is one of the most important parts of the script. It defines it from the rest of the scripts, and it's what the game uses to index it. It must be a 6-digit hexadecimal number; since most of the hexadecimal events in Pokemon are NOT taken (there aren't that many events, obviously), you can just choose a random number and go from there. If everything glitches up, then all you have to do is change the number. The chance of the number matching up is extremely low (you'd probably have a better chance of winning the lottery), although if you're really worried XSE has a built-in "free space finder" under the Tools menu, which searches the ROM for empty identifiers.

@start, and its counterparts @take, @name, @done, and @1-6, are the "names" (also called pointers by some people of the Pokemon hacking community) of the actions within the script. The script refers to its several different inner actions a lot (and in fact, that's what allows the script to work), and the easiest way to do so is to use the "names". For example, it's much easier to refer to a friend as "Josh" rather than "92B29A92", right?

checkflag checks to see if a certain flag is defined. Flags are what lets the game know if a certain event has happened yet. They start with 0x and then are followed by a 3-digit hexadecimal number. If you set your attention down to @take in the script, it shows that it says setflag. setflag is what turns the flag on. Adversely, clearflag removes the flag marker. The most important thing to remember about flags is that certain flags have already been used in the game. Since you're hacking FireRed, here's a link to the flags already used in FR/LG. DON’T USE THEM. You can use any other hexadecimal number, as long as you avoid any number on that list. In addition, you should keep a list of numbers you use for events, so that you don't reuse flags that you've already set.

0x1 checks to see if the event is set, and 0x0 checks to see if the event isn't set. In this case, we're checking if the Pokemon has already been given to you, so we're checking if the event is on. For that, we need to use 0x1. If 0x1 finds that flag 0x8C3 is on, it'll skip to @done, which is the part of the script that closes the dialogue box. If it finds that the flag is off, then the script will continue regularly.

The next line, msgbox, does what you'd think it would – open up a message box. When you want to open up a message box, you need to declare what text you want to display – by declaring that it wants to show the text under a name. In this case, the text is under @1. It also declares 0x5, which is a pointer for a message box script. 0x5 is the message box script that opens up the option menu above the actual message box (in the form of "Yes" and "No"), which is the variables 0x1 and 0x0, respectfully. Now you should see things starting to fall together, eh?


Message Box Types



0x2 - Regular message box when talking to the average Joe.
0x3 - Used for signs. Has a special box border and font color to enhance the "sign" effect.
0x4 - Your average message box, but slightly different. It doesn't autoclose, meaning you'll need to command the message box to closeonkeypress after the display. Great for important parts in the story that you don't want the player to accidentally miss.
0x5 - The "Yes" and "No" prompt, for when you want to give the player a choice in things. Doesn't automatically close nor lock the player on, but neither need to be used because it forces you into a choice menu.
0x6 - Barebones text box. Lacks the commands faceplayer and lock.


compare is the command that checks what you chose in the message box. Every msgbox that declares itself as a 0x5 type has the compare line directly after it. compare 0x1 would check if you chose yes, and, you guessed it, compare 0x0 would check if you chose no. The next line checks if compare 0x1 was successful, and if it was it goes to @take. If compare 0x1 was unsuccessful (in other words, you chose "no"), the script continues to the next line. It directs to @2, and then declares release and end which effectively ends the script.

With the first part of the script defined, we can now move on to the meat of the script: the script that actually gives you the Pokemon.

givepokemon. Can it get much simpler than that? The numbers that follow it need explaining, though, so let's go into that!

givepokemon uses six different values. The first defines what Pokemon is being given, the second defines what level the Pokemon is, and the third defines what item the Pokemon would be holding. The fourth, fifth, and sixth are all just buffers, so they can be set at null (0x0).

givepokemon 0x3F (The Pokemon - Abra) 0x5 (Level 5) 0x0 (Item held – none) 0x0 (null) 0x0 (null) 0x0 (null)


In order to change the Pokemon/Item, you must find the ID of the object in question, and then convert it to a hexadecimal value. The same goes with levels, except with levels you just have to convert the level itself into hex.

XSE has a built in hex converter/calculator, so it should be fairly simple to do. Now, before you ask,

IDs for Pokemon
IDs for Items

Abra’s NationalDex ID is 63, and 63 converted into hex is 3F.

fanfare simply plays a little bloop, letting the player know that they've received something. The fanfare in question is located at 0x13E.

The next line commands the game to open up a message box containing the text located at @3 in the 0x4 message box format.

waitfanfare tells the game to stall until the fanfare completes. The fanfare is only a couple of seconds long, so it shouldn't be that much of an annoyance. Then it's told to close upon a button is pressed, ala closeonkeypress, as the 0x4 message box format doesn't auto-close.

After that is accomplished, it sets the flag. Refer back up to see what it does – tl;dr it's what lets the game know that this event has already been finished, so that the guy doesn't give you infinite Pokemon.

The script tells the game to open up yet another message box, this time with the text located at @4, which queries the player whether or not they'd like to rename their new Pokemon. Since this is a Yes/No question, 0x5 message box format is necessary.

We meet our friends compare and if again. compare checks if the player chose 0x1 ("Yes") and then if jumps in and does what it normally does, which is – wait a minute…

gosub makes an appearance in here. gosub, in simplest terms, tells the script to jump to something else, but come back after it's executed. This is very much different from its cousin goto; imagine goto as a dart and gosub as a boomerang. goto will go to a script, and stay on it, but gosub will return to the action at hand after it's done with what it's told to do.
To break it down, if the player chose "Yes", the naming dialogue will pop up, as we told the game to gosub to @name, which happens to be the action that the naming dialogue resides. After you finish naming the Pokemon, you jump back to where you were at @take.

In the case that the player chose "No", the game completely skips over the gosub and goes to the next line down.

Following the gosub, the game is told to open a message box displaying the text listed at @5 in message box format 0x6. The game then declares release and end, effectively ending the event.

@name, rather than including the massive script for the naming dialogue, simply uses call to embed the script in question into the current script. This is very useful for when you want to reduce clutter in your scripts. It also saves a lot of time, since you won't have to open the script up and copy-paste it into your current script. The naming dialogue script is located at 0x1A74EB. return lets the script know that it's OK to return back to where it was gosub'd from.

@done was described early in the tutorial. It's used (or, goto’d) for when you talk to the person a second time after you're already received the Pokemon. It opens up a message box displaying the text listed at @6 in the 0x6 format. Then it release ends you.

What follows is @1-6. All of them are mostly just plaintext. I'll define a majority of the codes used for text inside the message boxes.


Text Codes



= is perhaps the most obvious of all of text codes. Make a new line after the #org @pointerhere, and then put this in the front, followed by a space. Put your text after it. It's what lets the script know that the pointer equals the text put after it.

n is your best friend. It declares a new line within the text. It's what keeps the text from "overflowing" in the box. Correctly placing ns takes practice; once you get the hang of it should be a piece of cake.

l is n’s funky cousin. l can only be used after n is used, but it does the same thing as n. So, for example,

As I was sayingnthe_casualty is the greatestnguy ever!


would be the same as

As I was sayingnthe_casualty is the greatestlguy ever!


There's no real point in l, but if you want to use it, go right ahead.

p is a pretty cool guy. You use him to move text to a new box.

h's purpose is to display symbols. You'd use the syntax h##, replacing the ## with a 2-digit hexadecimal number. A list of the hex for symbols is available here. For example,

Encycloph25dia Dramatica


would show up as

Encyclopædia Dramatica


Then there comes the bracket text codes.

[rival] and [player] replaces itself with the name of the player and rival that the person that’s playing the game chose.

The color text codes are simple too.

[white_fr]
[black_fr]
[grey_fr]
[red_fr]
[orange_fr]
[green_fr]
[lightgreen_fr]
[blue_fr]
[lightblue_fr]
[lightblue2_fr]
[cyan_fr]
[lightblue3_fr]
[navyblue_fr]
[darknavyblue_fr]

What each of the codes represent is self-explanatory.


Now that you understand the script and you know what to do, you need to compile it into the ROM. I could go on forever explaining how to do that, but I think that this YouTube video explains it best.

Congratulations! You've created and understood the script. Try it out and let me know if you have any problems.

…

Whew, that was a lot to type.


Link Glossary



Advance Map 1.92
XSE
Introduction to Hexadecimal System
Flags Already Used in FireRed/LeafGreen
List of Pokemon IDs
List of Item IDs
Symbols for use with h
YouTube Tutorial for Compiling

PS – It's really encouraging to see another Pokemon hacker around here. It's been pretty sparse around these parts.

This may be digressing off the topic a bit, but I'm intrigued by your mention of EliteMap.

EliteMap, albeit outdated, has real sentimental value. Vizzed has roots in the Acmlm community, and EliteMap was originally developed by a couple of Acmlm Board oldbies, DJBouche and then later Kyoufu Kawa (perhaps better known as simply "Kawa"). To put it in perspective, Davideo7 had an account on the same Acmlm Board archive, which went defunct in 2003-ish. Basically Vizzed's ancestors had dreams of hacking Pokemon, and in fact pioneered the first tools for it.

</history>
legacyme3 : That was a link to Pokescript, which is outdated and in general shouldn't be used. So, uh, don't use it.

---

I apologize for the delay. I just wanted to make sure that everything made sense, and I made sure that all of my data was 100% correct. I know that you may be uncomfortable with scripting, but I have it to the point where you can basically just copy-paste what I have down.


the_casualty's impromptu Give Pokemon in XSE tutorial



(Please note that all of the documents and tools that I link to on this tutorial are not by myself but instead by other members of the Pokemon Hacking Community. Please also note that a lot of the values here are strictly FireRed/LeafGreen related; some of the values here aren't guaranteed to work with Ruby/Sapphire/Emerald.)

Before we get started... what version of Advance Map are you using? 1.95 edits wild Pokemon, events, and some other things kind of odd (and sometimes leads to errors), which might be the root of your problems.

In fact, you really shouldn't even use that version.

Pick up Advance Map 1.92 and use it instead.

What you're trying to accomplish requires script editing. I very highly recommend that you pick up XSE to get the job done, and this tutorial covers XSE scripting.

I'll be discussing the hexadecimal system a bit in this tutorial; if you're unfamiliar with it, I'd suggest reading this introduction to hex before we jump in.

---

After you get XSE downloaded, unzip it, and then open up Advance Map, Settings -> Choose script editor. Navigate to XSE, viola.

Advance Map makes you implement events in a roundabout way. You need to find an event that’s already on the map, then go down to "Amount of Events" and add the number of events that you need. In this case, we want to add an extra "person" event, so increment it up by one. The event you want will appear in the top left corner of the map. Drag it down to where it's accessible for your player to interact with. Now we can begin!

Your new guy will need a script offset, as to differentiate from the rest of the events. It can just be random letters and numbers. You'll also probably want to edit his walking pattern, talking level (the usual choice is [03]) and picture.

Now we can really get started. Click "Open script" and we'll begin. It'll prompt you with a question; just click "Yes".

XSE may look overwhelming at first, but really all it consists of is a text editor with a built in hex calculator and sticky-note style notepad.

A common "give Pokemon" code is as follows. I'll explain each part of it.

#dynamic 0x9A76B1

#org @start
checkflag 0x8C3
if 0x1 goto @done
msgbox @1 0x5
compare LASTRESULT 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @take
givepokemon 0x3F 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x8C3
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @1
= It's dangerous to go alone!nTake this!

#org @2
= I can't begin to stress how much you need this Pokemon.

#org @3
= [black_fr]You received an Abra!

#org @4
= [black_fr]Would you like to give annickname to your new Abra?

#org @5
= This will help you very much innyour journey.

#org @6
= How is my gift faring for you?


I can imagine the eyes popping out of your skull right now. I'll break it all down; let's start from the top.

#dynamic is one of the most important parts of the script. It defines it from the rest of the scripts, and it's what the game uses to index it. It must be a 6-digit hexadecimal number; since most of the hexadecimal events in Pokemon are NOT taken (there aren't that many events, obviously), you can just choose a random number and go from there. If everything glitches up, then all you have to do is change the number. The chance of the number matching up is extremely low (you'd probably have a better chance of winning the lottery), although if you're really worried XSE has a built-in "free space finder" under the Tools menu, which searches the ROM for empty identifiers.

@start, and its counterparts @take, @name, @done, and @1-6, are the "names" (also called pointers by some people of the Pokemon hacking community) of the actions within the script. The script refers to its several different inner actions a lot (and in fact, that's what allows the script to work), and the easiest way to do so is to use the "names". For example, it's much easier to refer to a friend as "Josh" rather than "92B29A92", right?

checkflag checks to see if a certain flag is defined. Flags are what lets the game know if a certain event has happened yet. They start with 0x and then are followed by a 3-digit hexadecimal number. If you set your attention down to @take in the script, it shows that it says setflag. setflag is what turns the flag on. Adversely, clearflag removes the flag marker. The most important thing to remember about flags is that certain flags have already been used in the game. Since you're hacking FireRed, here's a link to the flags already used in FR/LG. DON’T USE THEM. You can use any other hexadecimal number, as long as you avoid any number on that list. In addition, you should keep a list of numbers you use for events, so that you don't reuse flags that you've already set.

0x1 checks to see if the event is set, and 0x0 checks to see if the event isn't set. In this case, we're checking if the Pokemon has already been given to you, so we're checking if the event is on. For that, we need to use 0x1. If 0x1 finds that flag 0x8C3 is on, it'll skip to @done, which is the part of the script that closes the dialogue box. If it finds that the flag is off, then the script will continue regularly.

The next line, msgbox, does what you'd think it would – open up a message box. When you want to open up a message box, you need to declare what text you want to display – by declaring that it wants to show the text under a name. In this case, the text is under @1. It also declares 0x5, which is a pointer for a message box script. 0x5 is the message box script that opens up the option menu above the actual message box (in the form of "Yes" and "No"), which is the variables 0x1 and 0x0, respectfully. Now you should see things starting to fall together, eh?


Message Box Types



0x2 - Regular message box when talking to the average Joe.
0x3 - Used for signs. Has a special box border and font color to enhance the "sign" effect.
0x4 - Your average message box, but slightly different. It doesn't autoclose, meaning you'll need to command the message box to closeonkeypress after the display. Great for important parts in the story that you don't want the player to accidentally miss.
0x5 - The "Yes" and "No" prompt, for when you want to give the player a choice in things. Doesn't automatically close nor lock the player on, but neither need to be used because it forces you into a choice menu.
0x6 - Barebones text box. Lacks the commands faceplayer and lock.


compare is the command that checks what you chose in the message box. Every msgbox that declares itself as a 0x5 type has the compare line directly after it. compare 0x1 would check if you chose yes, and, you guessed it, compare 0x0 would check if you chose no. The next line checks if compare 0x1 was successful, and if it was it goes to @take. If compare 0x1 was unsuccessful (in other words, you chose "no"), the script continues to the next line. It directs to @2, and then declares release and end which effectively ends the script.

With the first part of the script defined, we can now move on to the meat of the script: the script that actually gives you the Pokemon.

givepokemon. Can it get much simpler than that? The numbers that follow it need explaining, though, so let's go into that!

givepokemon uses six different values. The first defines what Pokemon is being given, the second defines what level the Pokemon is, and the third defines what item the Pokemon would be holding. The fourth, fifth, and sixth are all just buffers, so they can be set at null (0x0).

givepokemon 0x3F (The Pokemon - Abra) 0x5 (Level 5) 0x0 (Item held – none) 0x0 (null) 0x0 (null) 0x0 (null)


In order to change the Pokemon/Item, you must find the ID of the object in question, and then convert it to a hexadecimal value. The same goes with levels, except with levels you just have to convert the level itself into hex.

XSE has a built in hex converter/calculator, so it should be fairly simple to do. Now, before you ask,

IDs for Pokemon
IDs for Items

Abra’s NationalDex ID is 63, and 63 converted into hex is 3F.

fanfare simply plays a little bloop, letting the player know that they've received something. The fanfare in question is located at 0x13E.

The next line commands the game to open up a message box containing the text located at @3 in the 0x4 message box format.

waitfanfare tells the game to stall until the fanfare completes. The fanfare is only a couple of seconds long, so it shouldn't be that much of an annoyance. Then it's told to close upon a button is pressed, ala closeonkeypress, as the 0x4 message box format doesn't auto-close.

After that is accomplished, it sets the flag. Refer back up to see what it does – tl;dr it's what lets the game know that this event has already been finished, so that the guy doesn't give you infinite Pokemon.

The script tells the game to open up yet another message box, this time with the text located at @4, which queries the player whether or not they'd like to rename their new Pokemon. Since this is a Yes/No question, 0x5 message box format is necessary.

We meet our friends compare and if again. compare checks if the player chose 0x1 ("Yes") and then if jumps in and does what it normally does, which is – wait a minute…

gosub makes an appearance in here. gosub, in simplest terms, tells the script to jump to something else, but come back after it's executed. This is very much different from its cousin goto; imagine goto as a dart and gosub as a boomerang. goto will go to a script, and stay on it, but gosub will return to the action at hand after it's done with what it's told to do.
To break it down, if the player chose "Yes", the naming dialogue will pop up, as we told the game to gosub to @name, which happens to be the action that the naming dialogue resides. After you finish naming the Pokemon, you jump back to where you were at @take.

In the case that the player chose "No", the game completely skips over the gosub and goes to the next line down.

Following the gosub, the game is told to open a message box displaying the text listed at @5 in message box format 0x6. The game then declares release and end, effectively ending the event.

@name, rather than including the massive script for the naming dialogue, simply uses call to embed the script in question into the current script. This is very useful for when you want to reduce clutter in your scripts. It also saves a lot of time, since you won't have to open the script up and copy-paste it into your current script. The naming dialogue script is located at 0x1A74EB. return lets the script know that it's OK to return back to where it was gosub'd from.

@done was described early in the tutorial. It's used (or, goto’d) for when you talk to the person a second time after you're already received the Pokemon. It opens up a message box displaying the text listed at @6 in the 0x6 format. Then it release ends you.

What follows is @1-6. All of them are mostly just plaintext. I'll define a majority of the codes used for text inside the message boxes.


Text Codes



= is perhaps the most obvious of all of text codes. Make a new line after the #org @pointerhere, and then put this in the front, followed by a space. Put your text after it. It's what lets the script know that the pointer equals the text put after it.

n is your best friend. It declares a new line within the text. It's what keeps the text from "overflowing" in the box. Correctly placing ns takes practice; once you get the hang of it should be a piece of cake.

l is n’s funky cousin. l can only be used after n is used, but it does the same thing as n. So, for example,

As I was sayingnthe_casualty is the greatestnguy ever!


would be the same as

As I was sayingnthe_casualty is the greatestlguy ever!


There's no real point in l, but if you want to use it, go right ahead.

p is a pretty cool guy. You use him to move text to a new box.

h's purpose is to display symbols. You'd use the syntax h##, replacing the ## with a 2-digit hexadecimal number. A list of the hex for symbols is available here. For example,

Encycloph25dia Dramatica


would show up as

Encyclopædia Dramatica


Then there comes the bracket text codes.

[rival] and [player] replaces itself with the name of the player and rival that the person that’s playing the game chose.

The color text codes are simple too.

[white_fr]
[black_fr]
[grey_fr]
[red_fr]
[orange_fr]
[green_fr]
[lightgreen_fr]
[blue_fr]
[lightblue_fr]
[lightblue2_fr]
[cyan_fr]
[lightblue3_fr]
[navyblue_fr]
[darknavyblue_fr]

What each of the codes represent is self-explanatory.


Now that you understand the script and you know what to do, you need to compile it into the ROM. I could go on forever explaining how to do that, but I think that this YouTube video explains it best.

Congratulations! You've created and understood the script. Try it out and let me know if you have any problems.

…

Whew, that was a lot to type.


Link Glossary



Advance Map 1.92
XSE
Introduction to Hexadecimal System
Flags Already Used in FireRed/LeafGreen
List of Pokemon IDs
List of Item IDs
Symbols for use with h
YouTube Tutorial for Compiling

PS – It's really encouraging to see another Pokemon hacker around here. It's been pretty sparse around these parts.

This may be digressing off the topic a bit, but I'm intrigued by your mention of EliteMap.

EliteMap, albeit outdated, has real sentimental value. Vizzed has roots in the Acmlm community, and EliteMap was originally developed by a couple of Acmlm Board oldbies, DJBouche and then later Kyoufu Kawa (perhaps better known as simply "Kawa"). To put it in perspective, Davideo7 had an account on the same Acmlm Board archive, which went defunct in 2003-ish. Basically Vizzed's ancestors had dreams of hacking Pokemon, and in fact pioneered the first tools for it.

</history>
Vizzed Elite
Timecube


Affected by 'Laziness Syndrome'

Registered: 09-30-10
Location: From:
Last Post: 2474 days
Last Active: 1065 days

02-05-12 08:30 PM
BNuge is Offline
| ID: 540281 | 142 Words

BNuge
Level: 138


POSTS: 4668/5714
POST EXP: 365399
LVL EXP: 30933446
CP: 14432.8
VIZ: 1505987

Likes: 0  Dislikes: 0
the_casualty :

I just read through ALL of this. I had glanced over it before, but I read through all of it this time. I do have Advance Map 1.92. Given how valuable this info is, I feel like it should be stickied. It would probably be best if you edit it into this thread-

https://www.vizzed.com/boards/thread.php?id=32014

You still have mod powers over this forum, so you can click to Edit your post in this thread, open that thread open, go to New Reply, and copy/paste the entire post. When you're all set, just close it up again. I'd do it myself, but it's your info so your name should be on the post.

Edit- How do I save it? It's asking me to save as either a rbc, rbh, or bic file. Which one means it gets applied directly to the ROM?
the_casualty :

I just read through ALL of this. I had glanced over it before, but I read through all of it this time. I do have Advance Map 1.92. Given how valuable this info is, I feel like it should be stickied. It would probably be best if you edit it into this thread-

https://www.vizzed.com/boards/thread.php?id=32014

You still have mod powers over this forum, so you can click to Edit your post in this thread, open that thread open, go to New Reply, and copy/paste the entire post. When you're all set, just close it up again. I'd do it myself, but it's your info so your name should be on the post.

Edit- How do I save it? It's asking me to save as either a rbc, rbh, or bic file. Which one means it gets applied directly to the ROM?
Vizzed Elite
Third Place in Feb 2011 VCS Achieved Ravering Syndrome + on Jan 6, 2012


Affected by 'Laziness Syndrome'

Registered: 04-30-10
Location: Northeast US
Last Post: 1239 days
Last Active: 465 days

(edited by BNuge on 02-05-12 08:43 PM)    

02-09-12 12:01 AM
Nksor is Offline
| ID: 541186 | 66 Words

Nksor
the_casualty
Level: 138


POSTS: 5683/5856
POST EXP: 228223
LVL EXP: 31613983
CP: 1171.6
VIZ: 131963

Likes: 0  Dislikes: 0
On the tutorial - I have plans to eventually rewrite that into an all-encompassing XSE tutorial. Right now it focuses mostly on the "Give Pokemon" script, if what I have planned gets done it'll be a tutorial about most if not all of the language and quirks of XSE. Time really is a constraint, though, sooo *shrug*

On the file - Save it as an rbc.
On the tutorial - I have plans to eventually rewrite that into an all-encompassing XSE tutorial. Right now it focuses mostly on the "Give Pokemon" script, if what I have planned gets done it'll be a tutorial about most if not all of the language and quirks of XSE. Time really is a constraint, though, sooo *shrug*

On the file - Save it as an rbc.
Vizzed Elite
Timecube


Affected by 'Laziness Syndrome'

Registered: 09-30-10
Location: From:
Last Post: 2474 days
Last Active: 1065 days

02-09-12 12:09 PM
BNuge is Offline
| ID: 541277 | 139 Words

BNuge
Level: 138


POSTS: 4691/5714
POST EXP: 365399
LVL EXP: 30933446
CP: 14432.8
VIZ: 1505987

Likes: 0  Dislikes: 0
the_casualty :

Will saving it as an RBC put it directly in the ROM or will I have to send the modified ROM and the RBC file to let someone play it? I was hoping to keep it all in one file.

Edit-

I ran into another snag. I used a program called "Advance Starter" to adjust the starter Pokémon. Problem is, the rival battles later on revert to the original Pokémon.
Ex.

The starters are Treecko, Squirtle, and Cyndaquil. I pick Treecko, so he picks Cyndaquil. During the first battle, he fights me with a Cyndaquil. Later on at the route near Indigo Plateau, he challenges me to a battle. But he somehow uses a Charmander instead of his Cyndaquil. More script editing I presume? I like the graphical stuff better, but I know it can't do everything.
the_casualty :

Will saving it as an RBC put it directly in the ROM or will I have to send the modified ROM and the RBC file to let someone play it? I was hoping to keep it all in one file.

Edit-

I ran into another snag. I used a program called "Advance Starter" to adjust the starter Pokémon. Problem is, the rival battles later on revert to the original Pokémon.
Ex.

The starters are Treecko, Squirtle, and Cyndaquil. I pick Treecko, so he picks Cyndaquil. During the first battle, he fights me with a Cyndaquil. Later on at the route near Indigo Plateau, he challenges me to a battle. But he somehow uses a Charmander instead of his Cyndaquil. More script editing I presume? I like the graphical stuff better, but I know it can't do everything.
Vizzed Elite
Third Place in Feb 2011 VCS Achieved Ravering Syndrome + on Jan 6, 2012


Affected by 'Laziness Syndrome'

Registered: 04-30-10
Location: Northeast US
Last Post: 1239 days
Last Active: 465 days

(edited by BNuge on 02-09-12 11:19 PM)    

02-09-12 11:23 PM
pokemon x is Offline
| ID: 541452 | 78 Words

pokemon x
Level: 83


POSTS: 186/1798
POST EXP: 89596
LVL EXP: 5228539
CP: 19354.4
VIZ: 1614184

Likes: 0  Dislikes: 0
Try this and it should work
#org $begin
lock
faceplayer
checkflag 0x232
if B_true goto $gotit
message $q
boxset 6
givepokemon 63 1 0
setflag 0x232
release
end

#org $gotit
message $hi
boxset 6
release
end

#org $hi
$hi 1 = Hello, how's my old ABRA?

#org $q
$q 1 = I have this ABRA, but I feelnlike a lousy TRAINER.pYou can have it.

This should work if it doesnt sorry but you will need xtreme script editor though
Try this and it should work
#org $begin
lock
faceplayer
checkflag 0x232
if B_true goto $gotit
message $q
boxset 6
givepokemon 63 1 0
setflag 0x232
release
end

#org $gotit
message $hi
boxset 6
release
end

#org $hi
$hi 1 = Hello, how's my old ABRA?

#org $q
$q 1 = I have this ABRA, but I feelnlike a lousy TRAINER.pYou can have it.

This should work if it doesnt sorry but you will need xtreme script editor though
Administrator
User Manager, Content Adder
Breaker of things


Affected by 'Laziness Syndrome'

Registered: 06-30-11
Location: ...
Last Post: 26 days
Last Active: 2 hours

02-10-12 03:27 PM
Austin96 is Offline
| ID: 541590 | 23 Words

Austin96
Level: 44


POSTS: 403/421
POST EXP: 24775
LVL EXP: 606046
CP: 24.1
VIZ: 1220

Likes: 0  Dislikes: 0
BNuge : You need a program called Advanced Battle Editor.You just go to gary and change his pokemon to match the starters you have made.
BNuge : You need a program called Advanced Battle Editor.You just go to gary and change his pokemon to match the starters you have made.
Perma Banned
Davideo7


Affected by 'Laziness Syndrome'

Registered: 11-23-10
Location: From:Valley View Hotel
Last Post: 4470 days
Last Active: 4469 days

Links

Page Comments


This page has no comments

Adblocker detected!

Vizzed.com is very expensive to keep alive! The Ads pay for the servers.

Vizzed has 3 TB worth of games and 1 TB worth of music.  This site is free to use but the ads barely pay for the monthly server fees.  If too many more people use ad block, the site cannot survive.

We prioritize the community over the site profits.  This is why we avoid using annoying (but high paying) ads like most other sites which include popups, obnoxious sounds and animations, malware, and other forms of intrusiveness.  We'll do our part to never resort to these types of ads, please do your part by helping support this site by adding Vizzed.com to your ad blocking whitelist.

×