• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
Help me with this script please! I'm using XSE 1.1.1 and when I debug an error screen comes up saying this.

(Error 13 "Type mismatch" on line 9.
Missing #define.)

Here is the script.

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x1200
if 0x1 goto @done
msgbox @question 0x5
compare LASTRESULT 0x1
if 0x1 goto @givepokemon
msgbox @nothanks 0x6
release
end

#org @done
msgbox @checkup 0x6
release
end

#org @givepokemon
msgbox @thanks 0x6
givepokemon 0x5E 0x64 0x00 0x00 0x00 0x00
fanfare 0x13E
msgbox @recieved 0x6
waitfanfare
setflag 0x1200
msgbox @thanks2 0x6
release
end

#org @question
= Hey there!\pYou look like a nice person.\nWould you like this Gengar?

#org @nothanks
= Oh? That's too bad.\pCome back if you change your mind.

#org @thanks
= Oh! That's GREAT!\pHere you go!

#org @thanks2
= Thanks again. I think it will have\nmore fun with you than with me.

#org @recieved
= \v\h01 recieved a GENGAR!

#org @checkup
= How's that Gengar doing?\nHopfully good.
 
Help me with this script please! I'm using XSE 1.1.1 and when I debug an error screen comes up saying this.

(Error 13 "Type mismatch" on line 9.
Missing #define.)

Here is the script.

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x1200
if 0x1 goto @done
msgbox @question 0x5
compare LASTRESULT 0x1
if 0x1 goto @givepokemon
msgbox @nothanks 0x6
release
end

#org @done
msgbox @checkup 0x6
release
end

#org @givepokemon
msgbox @thanks 0x6
givepokemon 0x5E 0x64 0x00 0x00 0x00 0x00
fanfare 0x13E
msgbox @recieved 0x6
waitfanfare
setflag 0x1200
msgbox @thanks2 0x6
release
end

#org @question
= Hey there!\pYou look like a nice person.\nWould you like this Gengar?

#org @nothanks
= Oh? That's too bad.\pCome back if you change your mind.

#org @thanks
= Oh! That's GREAT!\pHere you go!

#org @thanks2
= Thanks again. I think it will have\nmore fun with you than with me.

#org @recieved
= \v\h01 recieved a GENGAR!

#org @checkup
= How's that Gengar doing?\nHopfully good.

Why would you debug it? Go compile it. There's nothing wrong with le script.
 
If you have played Pokemon Fire Red before than you would know that the legendary battles differ from normal encounters. Is there a script compatible with either PKSV or XSE to change a wildbattle to a legendary one? In my rom hack I am including lots of post-game legendaries! If someone answers than Thanks so much :)

- Derp

Can you be a bit more specific on what you want changed? If you're talking about having a different music track playing then this thread might be able to help you.

Help me with this script please! I'm using XSE 1.1.1 and when I debug an error screen comes up saying this.

(Error 13 "Type mismatch" on line 9.
Missing #define.)

Here is the script.

Spoiler:

Change the LASTRESULT in your script to '0x800D', they mean the same thing but it doesn't need to be defined.
 
Because it wont let me compile it. It gives me the same exact error message.

If you look on line 9, you should see that there is LASTRESULT. In std.rbc, which comes with XSE, this has a define statement which works like this:

#define 0x800D LASTRESULT

This file is most likely missing, so just replace LASTRESULT with 0x800D and you should be fine.
 
rom: FireRed
type: pokescript ; trainerbattle
problem: the battle works fine, but the trainer doesnt say what i want him to say. instead he says a bunch of wierd symbols and #'s. what am i doing wrong?

heres the script:

#org @start
trainerbattle 0x0 0x001 0x0 @before @after
message @beaten
boxset 0x6
release
end

#org @before
= We're Team Rocket!

#org @after
= NOOOOO!!!

#org @beaten
= WHY!!!





sorry I dont know how to do a spoiler.
 
rom: FireRed
type: pokescript ; trainerbattle
problem: the battle works fine, but the trainer doesnt say what i want him to say. instead he says a bunch of wierd symbols and #'s. what am i doing wrong?

heres the script:

#org @start
trainerbattle 0x0 0x001 0x0 @before @after
message @beaten
boxset 0x6
release
end

#org @before
= We're Team Rocket!

#org @after
= NOOOOO!!!

#org @beaten
= WHY!!!





sorry I dont know how to do a spoiler.

HTML:
[spoiler]This is a spoiler tag.[/spoiler]


Now, if this compiles, it means you have an old version of XSE. Get the newest from Gamer2020's thread. Then, try this script: (it has some changes for updated syntax.)

Code:
#Dynamic 0x800000

#org @start
trainerbattle 0x1 0x001 0x0 @before @after @later
end

#org @later
msgbox @beaten 0x6
release
end

#org @before
= We're Team Rocket!

#org @after
= NOOOOO!!!

#org @beaten
= WHY!!!

Also, you were using the wrong type of trainerbattle. So, look at the code and try and spot the difference.

trainerbattle type 0x0 will NOT continue after the battle.
 
Script Screwup

Game:FR for GBA

So I'm trying to make a new person-script (AdvancedMap) however, when I open the script (XSE) and try to enter the following code:
Spoiler:


It doesn't work! I search up the offset 0x800000 and this shows up!
Spoiler:


Can anyone help me understand?!?!?
 
Last edited:
The music is what I mean, I have tried using mid2gba to convert midi custom music to use with sappy but no matter how simple or complicated the music is it will not work. That is why i'm deciding to use the normal legendary music.
 
Game:FR for GBA

So I'm trying to make a new person-script (AdvancedMap) however, when I open the script (XSE) and try to enter the following code:
Spoiler:


It doesn't work! I search up the offset 0x800000 and this shows up!
Spoiler:


Can anyone help me understand?!?!?

You should be using dynamic pointers (@talk, @sign, @text etc) rather than static pointers (0x800001, 0x827819, 0x847510 etc). The way you have it set it up right now you're overwriting data as soon as it is being written to the ROM, as well as overwriting some pretty import offsets as far as I can see. If you include the command '#dynamic 0x800000' at the beginning of your script XSE will automatically find free space from that point onwards to insert your script into. Try inserting this:

Spoiler:


In addition, you seem to be using an older version of XSE. Are you using version 1.1.1? If you're not you can download it here.
 
Ok, here is a picture of my map.
Spoiler:


When the player steps on a script tile, (coming from below). (Also this particular script is for the middle script tile). The little boy and his pokemon will walk dow the bridge and talk to the player. Eventually the boy asks what type of pokemon his dad (The professor) researches. You get a yes/no choice for fire type. If you say yes, he studies fire, then the professor will study fire pokemon and you will get to choose one of the three fire starters later on in the game. If you say no, he then asks if he studies water type pokemon. ect ect. this goes in a big circle until you choose a type between fire water and grass. This is supposes to set flags later, so that you can only enter the corresponding lab. However, I am getting an error13 type mismatch missing dynamic lable on line 47.

Can someone please help me figure out what is wrong with the scrip? Or if it is even possible? This is the first script I have ever made by myself.

Script.
Spoiler:
 
Ok, here is a picture of my map.
Spoiler:


When the player steps on a script tile, (coming from below). (Also this particular script is for the middle script tile). The little boy and his pokemon will walk dow the bridge and talk to the player. Eventually the boy asks what type of pokemon his dad (The professor) researches. You get a yes/no choice for fire type. If you say yes, he studies fire, then the professor will study fire pokemon and you will get to choose one of the three fire starters later on in the game. If you say no, he then asks if he studies water type pokemon. ect ect. this goes in a big circle until you choose a type between fire water and grass. This is supposes to set flags later, so that you can only enter the corresponding lab. However, I am getting an error13 type mismatch missing dynamic lable on line 47.

Can someone please help me figure out what is wrong with the scrip? Or if it is even possible? This is the first script I have ever made by myself.

Script.
Spoiler:

Code:
#org walk4
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0xFE

You forgot the @ before walk4.
Also...


Code:
...
setflag 1200
setflag 1201
...

I think those flags need 0x on them.
 
Ok, here is a picture of my map.
Spoiler:


When the player steps on a script tile, (coming from below). (Also this particular script is for the middle script tile). The little boy and his pokemon will walk dow the bridge and talk to the player. Eventually the boy asks what type of pokemon his dad (The professor) researches. You get a yes/no choice for fire type. If you say yes, he studies fire, then the professor will study fire pokemon and you will get to choose one of the three fire starters later on in the game. If you say no, he then asks if he studies water type pokemon. ect ect. this goes in a big circle until you choose a type between fire water and grass. This is supposes to set flags later, so that you can only enter the corresponding lab. However, I am getting an error13 type mismatch missing dynamic lable on line 47.

Can someone please help me figure out what is wrong with the scrip? Or if it is even possible? This is the first script I have ever made by myself.

Script.
Spoiler:

You forgot the '@' symbol in front of your walk4 and walk5 pointers so XSE doesn't know where to go :P

Also, you're setting some pretty strange flags and variables which are in pretty dangerous positions. I suggest reading this thread to learn which flags and variables are safe to use in your hack.

EDIT: Wow, first time I've been ninja'd in a while ;;
 
Last edited:
I got it to compile now because of what you told me, but nothing happens when I step on the script tile.

EDIT: I got it working by taking out the movements for the pokemon following the little boy. Is there a way I could have them move at the same time?

Also, if I press no after he asks if the dad researches fire pokemon it glitches into random symbols.

EDIT2: Nevermind, I figured out the glitchy symbols by myself! ^^
Haha, with you guys helping me, I have been getting better at scripting!!!

I'm still having problems with moving both the boy and the pokemon at the same time though.
 
Last edited:
I got it to compile now because of what you told me, but nothing happens when I step on the script tile.

EDIT: I got it working by taking out the movements for the pokemon following the little boy. Is there a way I could have them move at the same time?

Also, if I press no after he asks if the dad researches fire pokemon it glitches into random symbols.

Can you take a screenshot of the script tile's information (the var number, var value, unknown etc)? I have no idea why taking out the Pokemon's movements would allow the script to run.

As for the second part, change the 'msgbox @notfire 0x6' line to 'goto @notfire'. You're treating the @notfire pointer as if was pointing to some text, when it is actually pointing to a new segment of the script. The game was trying to translate commands into text but that just leads to problems. You've also done the same thing with the @notwater and @notgrass pointers so don't forget to change those as well.

Also, just a tip: You don't have to keep writing 'waitmovement 1 waitmovement2'. You can replace all instances of those two lines with 'waitmovement 0x0' because the script will wait for both of them to finish. It just makes things a little bit shorter and neater :P
 
Excuse me, I was wondering if there was a way to delete ALL data from a ROM to start from scratch? That, or specifics? IE, to delete everything but trainer battles, which I can edit anyway? I want to start from scratch.
I'm using AM 1.92 and PKSVUI 2.1 as the script editor, and I'm using advance trainer to edit trainer battles.
 
Excuse me, I was wondering if there was a way to delete ALL data from a ROM to start from scratch? That, or specifics? IE, to delete everything but trainer battles, which I can edit anyway? I want to start from scratch.
I'm using AM 1.92 and PKSVUI 2.1 as the script editor, and I'm using advance trainer to edit trainer battles.

JPAN's clean patch for FR is what you are looking for. It gets rid of all scripts and frees up the space.
 
Dr.fuji, I got my script working exactly how I wanted it now. Thank you.

However I have a new question about scripting. setvar 0x1 sets the variable to happen just once. What would I type to make it happen over and over again until a certain flag was set? Would I simply not set a var? EDIT: i just figured out how to do what I needed. :) I think I'm getting the hang of basic scripting! Yay! I still would like to no if there is a special setvar that happens over and over again.
 
Last edited:
Status
Not open for further replies.
Back
Top