• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

XSE Scripting Tutorial

Status
Not open for further replies.

.Seth

.explorer.
1,644
Posts
15
Years
I'm currently working on a hack
called pokemon ruby diamond and
i'm trying to compile this script:


#Dynamic 0x6B09F8

#ORG @Main
Lock
FacePlayer
checkflag 0x200
GivePokemon 151 30 0
if b_false goto @recieved
message @recieved
setflag 0x200
Release
End

#ORG @gotit
message @howis
boxset 0x2
End

#ORG @recieved
= Here is a rare Pokemon!

#ORG @howis
= How is MEW?


but every time i try to compile the script
a pop up says:

Error 13 'type mismatch' in file ..... on line 7
Missing #define or parameter

Line: GivePokemon 151 30 0

someone tell me whats wrong plzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzz
Begging won't get you anywhere. And this is a tutorial, not a Script Help Thread, like the one in the main ROM hacking forum you should go to for this.
Also, read your error code. You forgot "0 0 0" after the digits in the givepokemon command.
 

Lukeyjohnno

Hacker-In-Training ;)
76
Posts
16
Years
  • Age 31
  • Seen Jun 1, 2013
I wasn't sure if you could ask for help here?
If I am wrong pleae tell me and I will delete the post.
Spoiler:


After hours of trying to figure it out, I couldn't.
The code flows well, until it finishes, and I can't move, I can bring up the L or R menu but thats it. I also can't use "waitmovement 0x0" as it also freezes the character, so I'm using pause.

Can anyone tell me if there is anything wrong with the code?
 

Pikachu fan

SUSANOOMON IS NOT AMUSED
54
Posts
14
Years
  • Age 27
  • Seen Jul 12, 2011
Oops

oh sory its just someone else posted a help question and i needed help.
i didn't know about a help thread sory for wasting your time folks.
 

G Deoxys

Beginner Rom Hacker
21
Posts
14
Years
i done exactly what u said and it says error:

Too less parameters on line 6. the correct number is 2


????
please help...
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Too less parameters on line 6. the correct number is 2
It means exactly that. XSE error codes are designed to let you know precisely what when wrong and where.

Open up your script in XSE and use the number on the left side of the window to navigate yourself to line 6. The error is on that line. I haven't seen your script so I can't tell you what's wrong but if you follow this tutorial, you should be able to figure it out for yourself ;)
 

wolfbane15

Dizzy
7
Posts
14
Years
  • Seen Sep 12, 2009
I'm having the same problem as g deoxys, and this is my script:
Spoiler:
 

Matt140

Hi Peoplez!
19
Posts
14
Years
I'm having the same problem as g deoxys, and this is my script:
Spoiler:

I've not been into the hacking scene for a while, but, the below script will work:

Spoiler:


Boxset has been replaced with the second parameter of message/msgbox, one odd thing though, is that XSE still recognizes boxset (it still displays it's parameters).. I'll contact HackMew about the problem (unless someone knows of a reason why this is happening??)
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I've not been into the hacking scene for a while, but, the below script will work:

Spoiler:


Boxset has been replaced with the second parameter of message/msgbox, one odd thing though, is that XSE still recognizes boxset (it still displays it's parameters).. I'll contact HackMew about the problem (unless someone knows of a reason why this is happening??)

WOAH, okay, first of all, don't EVER compile a script to an offset like that.
Compile it to 0x800000, changes in the quote.
 

wolfbane15

Dizzy
7
Posts
14
Years
  • Seen Sep 12, 2009
oh, okay then thanks :)
but at 0m3GA, i just used free space finder but i'll go from that from now on
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
oh, okay then thanks :)
but at 0m3GA, i just used free space finder but i'll go from that from now on

Yeah, the reason you don't ever want to put scripts there is because that is where vital information on the game is kept.
The safest location to start from is 0x800000, because that is ROM space.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Yeah, the reason you don't ever want to put scripts there is because that is where vital information on the game is kept.
The safest location to start from is 0x800000, because that is ROM space.
Say wha???
Although I agree that's it's probably safest to choose an offset deeper into the ROM, it's not necessary. There's nothing wrong with his offset, so long as he used Free Space Finder to find it. FSF (as the name implies) finds free space. If it wasn't free space and it was being used by the unmodified game, it probably wouldn't be filled with a sea of 'FF'. Also, 0x800000 is only free space for Fire Red. I believe it's used in Emerald and it's possible that it's used in Ruby/Sapphire as well.

Though I'd really appreciate it if you could clarify what you mean by "ROM space". I'm at a loss as to what exactly you were trying to say there :\
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Say wha???
Although I agree that's it's probably safest to choose an offset deeper into the ROM, it's not necessary. There's nothing wrong with his offset, so long as he used Free Space Finder to find it. FSF (as the name implies) finds free space. If it wasn't free space and it was being used by the unmodified game, it probably wouldn't be filled with a sea of 'FF'. Also, 0x800000 is only free space for Fire Red. I believe it's used in Emerald and it's possible that it's used in Ruby/Sapphire as well.

Though I'd really appreciate it if you could clarify what you mean by "ROM space". I'm at a loss as to what exactly you were trying to say there :\

0x00000000 - 0x01FFFFFF is BIOS data within the Image of a GBA Game, the data that starts teh game and all that. (GBA games usually have the extention .gba, but sometimes .bin)
0x02000000 - 0x02FFFFFF is WRAM (This changes as you play the game, so space that might look free, will often NOT be free as you play the game.)
0x03000000 - 0x03FFFFFF is IRAM (Same as WRAM, what looks like Free Space, Wont be free when you play the game.)
0x04000000 - 0x04FFFFFF is I/O data (As before, it is NOT free space when you play the game.)
0x05000000 - 0x05FFFFFF is Pallet data (Which DOES change as you play teh game, loading different pallets and such.)
0x60000000 - 0x06FFFFFF is VRAM (Once again, NOT free, FF's and 00's WILL change when you play the game.)
And finally.
0x70000000 - 0x07FFFFFF is OAM (This data holds sprites, so if a map has TONS of different sprites, grass, and other animated objects, it will often be loaded into here, so it too is not free space.)
0x08000000 - 0x0FFFFFFF is ROM space, data that can not be edited with commands such as writebytetooffset, it holds data such as compressed images, music, and, scripts, amongst other things that the different RAM's read and load.

It is safest to start inserting data at 0x800000 (Except in Emeralds case, where a location further into the ROM is preffered.) because it wont have any possibility of randomly changing during gameplay.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
*slaps forehead*
Okay, I might not be very knowledgeable on the subject of GBA hardware and all that jazz but the offset he specified with the #dynamic preprocessing directive was 0x2DD100. That's 0x82DD100. Which is in the ROM. You can't compile a script to the WRAM. That's ludicrous!
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
*slaps forehead*
Okay, I might not be very knowledgeable on the subject of GBA hardware and all that jazz but the offset he specified with the #dynamic preprocessing directive was 0x2DD100. That's 0x82DD100. Which is in the ROM. You can't compile a script to the WRAM. That's ludicrous!

Actually;
0x2DD100 would not be 082DD100, it would be 002DD100, which is indeed located in WRAM.

(Since offsets are D-Words, 0x2DD100 is really 002DD100, much like how 0x800000 is 00800000.

The frontal 08 that you mentioned, is only used in pointers, which even then would be pointing to WRAM, 082DD100.)

So Yeah, so long as your Dynamic Offset is 0x800000 or later, you will not compile into the GBA's RAM locations...
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Actually;
0x2DD100 would not be 082DD100, it would be 002DD100, which is indeed located in WRAM.

(Since offsets are D-Words, 0x2DD100 is really 002DD100, much like how 0x800000 is 00800000.

The frontal 08 that you mentioned, is only used in pointers, which even then would be pointing to WRAM, 082DD100.)

So Yeah, so long as your Dynamic Offset is 0x800000 or later, you will not compile into the GBA's RAM locations...
...
But...but this is madness! You can't compile scripts to RAM. It's just impossible. You compile them to the ROM, the Read-Only Memory. XSE can only compile scripts to the ROM. You can't access the RAM using a hex editor. So how in God's name are you supposed to compile a script to the RAM?

Here, explain this:
The girl in Pallet Town in FR (person event #1) has a script assigned to her, the offset of which is '$16575C'. According to you, that script is located in the BIOS data. See how that makes no sense whatsoever? It's located in the ROM.

But I want you to prove me wrong. Please. Go out there, compile a script to the WRAM or wherever you feel like it, and then come back to me with your results.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
...
But...but this is madness! You can't compile scripts to RAM. It's just impossible. You compile them to the ROM, the Read-Only Memory. XSE can only compile scripts to the ROM. You can't access the RAM using a hex editor. So how in God's name are you supposed to compile a script to the RAM?

Here, explain this:
The girl in Pallet Town in FR (person event #1) has a script assigned to her, the offset of which is '$16575C'. According to you, that script is located in the BIOS data. See how that makes no sense whatsoever? It's located in the ROM.

But I want you to prove me wrong. Please. Go out there, compile a script to the WRAM or wherever you feel like it, and then come back to me with your results.

I've done it before, stuffed up my game.
And BIOS data is only in use when the game starts. All rom data is moved down... (Except foreign data... which is left in place, such as scripts we insert.)

If you insert a script into free space around there, (ESPECIALLY small scripts that take up little space) You could easily fill in some 00's or FF's that are actually part of code used my the game...
That is what I have been trying to say, a lot of those FF's and 00's are actually part of ASM codes made to run the game.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
I've done it before, stuffed up my game.
And BIOS data is only in use when the game starts. All rom data is moved down... (Except foreign data... which is left in place, such as scripts we insert.)

If you insert a script into free space around there, (ESPECIALLY small scripts that take up little space) You could easily fill in some 00's or FF's that are actually part of code used my the game...
That is what I have been trying to say, a lot of those FF's and 00's are actually part of ASM codes made to run the game.
Fair enough. I agree with you on that last bit (I already said that I do) but you still haven't explained how you can compile a script to the WRAM (or anything other than the ROM, for that matter). Please, enlighten me.
 
Status
Not open for further replies.
Back
Top