• 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?".
  • 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.
72
Posts
10
Years
  • Age 33
  • Seen Dec 18, 2017
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.
 

Sniper

ふゆかい
1,412
Posts
10
Years
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.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
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.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
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.
 
5
Posts
10
Years
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.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
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.
 

zachatoo

Zachatoo
7
Posts
10
Years
  • Seen May 3, 2020
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:
6
Posts
10
Years
  • Age 29
  • Seen Jan 13, 2014
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.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
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.
 
72
Posts
10
Years
  • Age 33
  • Seen Dec 18, 2017
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:
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
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.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
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:
72
Posts
10
Years
  • Age 33
  • Seen Dec 18, 2017
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:

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
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
 
9
Posts
10
Years
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.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
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.
 
72
Posts
10
Years
  • Age 33
  • Seen Dec 18, 2017
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:

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
Just use a temporary variable?
0x8000-0x800B should work without destroying the player-facing and lastresult..
 
Status
Not open for further replies.
Back
Top