• 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.

Xnenai

Developing Polyglot
34
Posts
14
Years
Fire Red
FireRed NATIONALDEX 0x16F
FireRed MENU PKMN 0x828
FireRed MENU POKEDEX 0x829
FireRed RUNNING SHOES 0x82F
FireRed BADGE 1 0x820
FireRed BADGE 2 0x821
FireRed BADGE 3 0x822
FireRed BADGE 4 0x823
FireRed BADGE 5 0x824
FireRed BADGE 6 0x825
FireRed BADGE 7 0x826
FireRed BADGE 8 0x827

Those are the flags that you need to get the pkmn menu etc. Just type setflag 0x###

As for your other question i dont know what you mean. .-.

Unless you simply mean how do you make the sprite disappear after already interacting with it. Then it would be something liek this.

checkflag 0x####
if 0x01 goto @____
hidesprite 0x## (the person event number in a map)
setflag 0x####

noteL setflag must be the same as checkflag.
I also dunno if this works copletely but thats how i Use it and it works for me so yea..
make sure to set the Person ID number to the flag numer you used.

basically, use flags...
 
Last edited:

Aro-kun

Pokemon trainer
152
Posts
15
Years
  • Age 32
  • Orre
  • Seen Jul 11, 2014
Thanks, but scripting is too hard >.> Where exactly in the lines of code do i put that?
"Ruby/Sapphire MENU PKMN 0x800"
 

Xnenai

Developing Polyglot
34
Posts
14
Years
Your using sapphire/Ruby? If so i gave you the wrong codes so wouldnt matter. As for where you put the lines of code, I wouldn't know, for some reason I don't understand XSE decompilations of scripts, but i guess I could try, someone more experienced sould do it tho.

#define RS_PKMNMENU 0x800
#define RS_POKEDEX 0x801
#define RS_POKENAV 0x802
#define RS_RUNNINGSHOES 0x860

#define RS_BADGE1 0x807
#define RS_BADGE2 0x808
#define RS_BADGE3 0x809
#define RS_BADGE4 0x80A
#define RS_BADGE5 0x80B
#define RS_BADGE6 0x80C
#define RS_BADGE7 0x80D
#define RS_BADGE8 0x80E


.-. ill see what i can do.

If you wanna be better at rom hacking, learning how to script would be a great benefit O_O learned that myself.
Spoiler:
 
Last edited:

Cinaed666

Geek.
24
Posts
14
Years
Hey guys, I'm looking for the offset of the script when you select a new game.. the one that starts with "welcome to the world of pokémon..." let's you select your gender, your name, etc..

So not the text offset, the script. If someone could pm it to me, that would be awesome.
 

Ki77y666

I'm with stupid ^
118
Posts
15
Years
Hey guys, I'm looking for the offset of the script when you select a new game.. the one that starts with "welcome to the world of pokémon..." let's you select your gender, your name, etc..

So not the text offset, the script. If someone could pm it to me, that would be awesome.
You need to edit that with a-text. You have to use the search function then save it to the ini and edit in a-text.
 

Cinaed666

Geek.
24
Posts
14
Years

You need to edit that with a-text. You have to use the search function then save it to the ini and edit in a-text.

But that way I can only edit what is being said.. I want to edit the script itself! Skipping the rival name sequence, and changing some of the shown sprites with others already in the rom...
 

Ki77y666

I'm with stupid ^
118
Posts
15
Years
But that way I can only edit what is being said.. I want to edit the script itself! Skipping the rival name sequence, and changing some of the shown sprites with others already in the rom...
Okay well I guess you have to wait for someone else to answer this question because I have now idea.
 

Zeffy

g'day
6,402
Posts
15
Years
  • Age 27
  • Seen Feb 7, 2024
But that way I can only edit what is being said.. I want to edit the script itself! Skipping the rival name sequence, and changing some of the shown sprites with others already in the rom...

Skipping the rival naming sequence can only be done via ASM. While changing the sprites in the intro can be edited via Unlz. Editing the text can be done via a HEX Editor or A-Text. There is no script for the intro, its programmed into the game and not scripted into the game.
 

x Necromorph x

Super Saiyan 4
295
Posts
13
Years
Ok so I need this script to happen only once, Idk why I forgot how to do this lol, but anyway here is the script.

BTW, the entire script works, its just that when its over,Once I take a step, the prof and the other sprite reappear.
Spoiler:
 
126
Posts
14
Years
  • Seen Aug 5, 2013
Ok so I need this script to happen only once, Idk why I forgot how to do this lol, but anyway here is the script.

BTW, the entire script works, its just that when its over,Once I take a step, the prof and the other sprite reappear.
Spoiler:

Set the person ID for the things you want to stay invisible after the script runs to a flag that is set during the script.
 

Rabbit

where is my mind?
484
Posts
15
Years
I have a question about background/behavior bytes. Hopefully this is the right place for it.

I inserted a new map in Pokemon Emerald and decided to give it weather - cloudy with sun. The clouds are supposed to be reflected only in water. I noticed that the clouds are reflected in some other tiles, like the bottom tiles of trees and the bottoms of houses. These tiles have a background byte of 10. When I change the background byte to 00, the clouds are no longer reflected, but now the top of my character's head is under the tiles when he stands against trees or houses. (In both cases, the behavior byte is set to 00.) Is there a different behavior or background byte I should use in this situation?
 

Rabbit

where is my mind?
484
Posts
15
Years
See what the original ROM does? =|

Funny thing is, none of the maps in the original ROM seem to have weather - except for the underwater routes, they have 'underwater mist'. It's odd, because Route 119 is rainy in-game, but when I go to Header, it tells me the weather is 'regular weather'. I have a feeling that all the in-game weather is caused by a script. Route 120, for instance, is 'cloudy with sun' - but only for the lower half. The top half has no weather. That suggests the weather isn't an inherent map property.
 
Last edited:

Cinaed666

Geek.
24
Posts
14
Years
Hey, This is a stupid question maybe, but I'm looking for the command in PKSVUI for "hidesprite 0x2", I tried "disapear 0x2" but it recognizes neither of those. What is it?
 

Ninja Caterpie

AAAAAAAAAAAAA
5,979
Posts
16
Years
Funny thing is, none of the maps in the original ROM seem to have weather - except for the underwater routes, they have 'underwater mist'. It's odd, because Route 119 is rainy in-game, but when I go to Header, it tells me the weather is 'regular weather'. I have a feeling that all the in-game weather is caused by a script. Route 120, for instance, is 'cloudy with sun' - but only for the lower half. The top half has no weather. That suggests the weather isn't an inherent map property.

Man, this is harder than I've ever worked in actually looking into the ROM.

Taking Route 220 as an example - it has three weathers - clear, rain, and sun with cloudy reflections. Looking at the scripts shows nothing - there are a whole lot of scripts where the weather changes, but they're all pointing to $000000 and they don't run.

So what are they for?

Setting off the level script that runs a whole bunch of checks - namely, to find your position on the map, so it can set the weather; turning rain on, turning rain off, turning clouds on, etc. Try it yourself - open the route up in A-map and follow it down, then up, slowly, in the game. Note where the weather changes.

Also, Route 119 seems to be rather curious. Nowhere I can find does it tell it to rain, which I'm pretty sure we all remember it was when we played through it. Thing is, when I go back...it doesn't. It doesn't rain. It only rains that first time you visit the route, and I've got no idea how it does it.

Curious indeed, but I hope I've helped.
 
Last edited:

Quilava's Master

Shattered Dreams '13
694
Posts
16
Years
  • Seen Aug 14, 2023
Fire Red
Person/Battle Script

Code:
'---------------
#org 0x1A93C9
trainerbattle 0x0 0x59 0x0 0x8183560 0x81835A0
special2 LASTRESULT 0x39
compare LASTRESULT 0x1
if 0x1 goto 0x81A93F0
msgbox 0x81835B4 MSG_NORMAL '"Battling is easy.\nLosing is hard."
end

'---------------
#org 0x1A93F0
trainerbattle 0x5 0x59 0x0 0x81C149D 0x81835A0
msgbox 0x81835B4 MSG_NORMAL '"Battling is easy.\nLosing is hard."
end


'---------
' Strings
'---------
#org 0x183560
= Hiyah!\nLet me test my Pokemon.

#org 0x1835A0
= I lost?

#org 0x1835B4
= Battling is easy.\nLosing is hard.

#org 0x1C149D
= Hey let's have a rematch!

Can someone help me with this script. I've tried about everything! The batle works perfectky but when i tried to rebattle it it gave me the message, "no trainers are in range..." though he was right here. I even tried editing an existing script with this original trainer (0x59 aka Youngster Josh, who loves his shorts) but again nothing! Am I missing something?
 

Rabbit

where is my mind?
484
Posts
15
Years
Man, this is harder than I've ever worked in actually looking into the ROM.

Taking Route 220 as an example - it has three weathers - clear, rain, and sun with cloudy reflections. Looking at the scripts shows nothing - there are a whole lot of scripts where the weather changes, but they're all pointing to $000000 and they don't run.

So what are they for?

Setting off the level script that runs a whole bunch of checks - namely, to find your position on the map, so it can set the weather; turning rain on, turning rain off, turning clouds on, etc. Try it yourself - open the route up in A-map and follow it down, then up, slowly, in the game. Note where the weather changes.

Also, Route 119 seems to be rather curious. Nowhere I can find does it tell it to rain, which I'm pretty sure we all remember it was when we played through it. Thing is, when I go back...it doesn't. It doesn't rain. It only rains that first time you visit the route, and I've got no idea how it does it.

Curious indeed, but I hope I've helped.

Holy crap, you're right! Route 119 doesn't have rain! XD It's funny how I didn't notice that until you pointed it out. If I knew the first thing about scripting, I would definitely look into this, but I don't, so...thanks for your help!

Anyway, I think I've figured out how Nintendo gets around this problem. Their trees have only one layer, the background. My trees have been block edited, so they have two layers, and that top layer is interfering with the player sprite's hair. There's no way around it. I guess I'll just have to choose a different weather effect.
 

Chad -

 
687
Posts
14
Years
  • Seen Aug 27, 2012
Fire Red
Person/Battle Script

Code:
'---------------
#org 0x1A93C9
trainerbattle 0x0 0x59 0x0 0x8183560 0x81835A0
special2 LASTRESULT 0x39
compare LASTRESULT 0x1
if 0x1 goto 0x81A93F0
msgbox 0x81835B4 MSG_NORMAL '"Battling is easy.\nLosing is hard."
end

'---------------
#org 0x1A93F0
trainerbattle 0x5 0x59 0x0 0x81C149D 0x81835A0
msgbox 0x81835B4 MSG_NORMAL '"Battling is easy.\nLosing is hard."
end


'---------
' Strings
'---------
#org 0x183560
= Hiyah!\nLet me test my Pokemon.

#org 0x1835A0
= I lost?

#org 0x1835B4
= Battling is easy.\nLosing is hard.

#org 0x1C149D
= Hey let's have a rematch!
Can someone help me with this script. I've tried about everything! The batle works perfectky but when i tried to rebattle it it gave me the message, "no trainers are in range..." though he was right here. I even tried editing an existing script with this original trainer (0x59 aka Youngster Josh, who loves his shorts) but again nothing! Am I missing something?

The script seems fine. No errors, as far as I see. Btw, you cannot re battle someone DIRECTLY after you battle him. You should wait a little bit, then use the seeker. I'm sure you know it. Sorry if I couldn't be of any help.

Chad -
 
780
Posts
14
Years
OK... I created a script, this:
#dynamic 0x800000

#org @start
msgbox @msg1 0x6
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
setflag 0x828
setflag 0x82F
setflag 0x829
giveitem 0xD 0x5 MSG_OBTAIN
giveitem 0x4 0x5 MSG_OBTAIN
special 0x16F
end



#org @msg1
= Renny: Take these [player]!

Now, that is meant to be a GREEN (You know, a script script) script in Advance Map. But, if I try it in VBA it will stay there, and activate again if you walk on to the same area again, even though the script is finished. Can somebody help? D:
 
Status
Not open for further replies.
Back
Top