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

Help Thread: Script Help Thread

Status
Not open for further replies.
I'm hacking pokemon emerald and I made an event where a team aqua member blocks your path.
you battle him, he runs away and you can get trough, but I have a problem.
After the battle, he runs away like he's supposed to, his sprite also dissapears, but whenever you re-enter the map, the aqua member is on the path again...

Aqua member script: note: the person event ID was set to 1 (0001)
Spoiler:


Map script Script type: 03 (On entering map/on menu close)
Spoiler:


I'm trying to find out why the sprite doesn't want to be hidden when you enter the map for hours now...

The flag 0x5004 is highly unsafe: I recommend staying within the range of 0x200 to 0x2FF. Refer to this document for more information on safe flags and variables.

You also seem to be using an outdated syntax for XSE: I recommend updating to version 1.1.1 by downloading it here.

Your script itself seems to be fine, although the level script is unnecessary, as the game will automatically hide or show Person events depending on the status of their Person ID flag.

Finally, this post belongs in the Script Help Thread, so I've moved it there.
 
I wrote a level script that activates when walking out of a house. But when I walk out, instead of the script activating, the copyright screen appears(the first thing that pops up when you start the game).
Here's the script.
Spoiler:
 
I wrote a level script that activates when walking out of a house. But when I walk out, instead of the script activating, the copyright screen appears(the first thing that pops up when you start the game).
Here's the script.
Spoiler:

There seems to be nothing wrong with your script (apart from the lack of checksound commands, but that won't cause your problem), so I'm going to assume your map - and perhaps your ROM - is corrupted. Have you tried putting the script on a clean ROM?
 
So I've been tearing my hair out trying to understand what's going wrong in the following level script:
Spoiler:

Everything works as expected, until after the camera has returned to its original position, when, instead of returning control to the player, a textbox containing an infinite loop of gibberish pops up. What in the world am I doing wrong here? Help appreciated.
 
So I've been tearing my hair out trying to understand what's going wrong in the following level script:
Spoiler:

Everything works as expected, until after the camera has returned to its original position, when, instead of returning control to the player, a textbox containing an infinite loop of gibberish pops up. What in the world am I doing wrong here? Help appreciated.

Fixes are in red. Also, on Advance Map, go to the map where you inserted your level script. Go to the [Header Tab] and press CTRL + H. Copy the [Map Script Offset] and paste it on the [Offset] box in XSE. Then, press the [Level Script] button beside the [Decompile] button. And then press the [Decompile] button. Scan the decompiled script for the [0xFFFF] and change it to [0x0], then press the [Compile] button. Afterwards, test your level script again.

Hope this helps~
 
Fixes are in red. Also, on Advance Map, go to the map where you inserted your level script. Go to the [Header Tab] and press CTRL + H. Copy the [Map Script Offset] and paste it on the [Offset] box in XSE. Then, press the [Level Script] button beside the [Decompile] button. And then press the [Decompile] button. Scan the decompiled script for the [0xFFFF] and change it to [0x0], then press the [Compile] button. Afterwards, test your level script again.

Hope this helps~

thankyouthankyouthankyouthankyou <3
Oh, the sweet, sweet satisfaction of finally getting everything to work properly. Thanks a heap.
 
What's up with this script? I got it from the second script in FireRed's start map (your room).

Spoiler:
I want to change the starting script when the game first loads up without breaking the game.
 
Last edited:
What's up with this script? I got it from the second script in FireRed's start map (your room).



I want to change the starting script when the game first loads up without breaking the game.

I think that's to make the player look at his TV. The variable is probably referenced elsewhere for something, but I don't recall it being important.
 
What's up with this script? I got it from the second script in FireRed's start map (your room).

Spoiler:
I want to change the starting script when the game first loads up without breaking the game.

This one is a type 4 level script, It makes the player face up when entering the map for the first time. If you want the player to face down, change 2 to 1.
 
That solves the first half, though what is the setvar? It sets a variable, but I'm not familiar with exactly what it's doing. I want to know if I should keep it or if it could mess up anything I add.
 
That solves the first half, though what is the setvar? It sets a variable, but I'm not familiar with exactly what it's doing. I want to know if I should keep it or if it could mess up anything I add.

You can simply found the variable (0x4056) in A-map before opening the level script. If the variable is set to 0, the event will happen. Vice versa.
 
On a related topic, how exactly do I get a header script in AdvanceMap to work? I'm trying to make this run once and only once:

Spoiler:
No matter what I do, I cannot get this script to load as a map script. It's supposed to enable the Pokemon Menu, Running Shoes, and give a team of 6 pokemon at level 50 with no items.
 
On a related topic, how exactly do I get a header script in AdvanceMap to work? I'm trying to make this run once and only once:

Spoiler:
No matter what I do, I cannot get this script to load as a map script. It's supposed to enable the Pokemon Menu, Running Shoes, and give a team of 6 pokemon at level 50 with no items.

What do you mean by header script? Is it level script. If it is, you might want to add a variable there. And, change the '50' to a hex number, unless you want a team of Level 80. Here's a guide on how to make one: https://www.google.com.ph/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB0QFjAA&url=http%3A%2F%2Fwww.pokecommunity.com%2Fshowthread.php%3Ft%3D191500&ei=DqjyVJTkEYLt8gW-ooKoBw&usg=AFQjCNELImslm46wp37nRc_MxdCq7md2bg&sig2=HCZP3-ITLcQtLhZvSQsEiw

On a related topic, how exactly do I get a header script in AdvanceMap to work? I'm trying to make this run once and only once:

Spoiler:
No matter what I do, I cannot get this script to load as a map script. It's supposed to enable the Pokemon Menu, Running Shoes, and give a team of 6 pokemon at level 50 with no items.

What do you mean by header script? Is it level script. If it is, you might want to add a variable there. And, change the '50' to a hex number, unless you want a team of Level 80. Here's a guide on how to make one: https://www.pokecommunity.com/showthread.php?t=191500#.VPOLtXzF-R4
 
Last edited by a moderator:
I have a question. I expanded the amount of Pokémon with G3HS (thanks karatekid) and I want to test my Genesect in-game (yes I started on 649 and I'm counting down lol). So I open up PKSV to write a little script. I made a man that gives you a Master Ball to capture Genesect and then you engage in battle with the 'mon. But when I compile, it says 'Unknown value in BATTLE (value must be integer)'. And when I try to let him give me the Pokémon, it says 'Unknown value in ADDPOKEMON (value must be integer)'.
Please help?! If you know a solution with XSE, that's fine too.
 
Last edited:
What do you mean by header script? Is it level script. If it is, you might want to add a variable there. And, change the '50' to a hex number, unless you want a team of Level 80.
Thanks for catching the decimal numbers, completely forgot. Whatever the script is called, I still don't understand what you mean. I've used variables in the past so I am familiar with how they work, so I'm confused as to how that will trigger the script. Do I need to addvar a specific variable? Create a new variable at a certain value?

Never used levels scripts before.
 
I have a question. I expanded the amount of Pokémon with G3HS (thanks karatekid) and I want to test my Genesect in-game (yes I started on 649 and I'm counting down lol). So I open up PKSV to write a little script. I made a man that gives you a Master Ball to capture Genesect and then you engage in battle with the 'mon. But when I compile, it says 'Unknown value in BATTLE (value must be integer)'. And when I try to let him give me the Pokémon, it says 'Unknown value in ADDPOKEMON (value must be integer)'.
Please help?! If you know a solution with XSE, that's fine too.

EDIT: Any mod please move this to the Script Help Thread, I accidentally posted it here.

Hi, addpokemon does work with values for expanded dexes. Make sure you're using the Pokemon's ID and not just the name. In the #defines there aren't name aliasing for your expanded mons.
 
Last edited:
Thanks for catching the decimal numbers, completely forgot. Whatever the script is called, I still don't understand what you mean. I've used variables in the past so I am familiar with how they work, so I'm confused as to how that will trigger the script. Do I need to addvar a specific variable? Create a new variable at a certain value?

Never used levels scripts before.

Variables or flags are used with scripts to allow them to only be activated once. A basic header script using [03] On entering map would suffice for the script you are trying to do. For this script to only activate once, though, you will need to use either a flag or a variable. For a flag, you could do:

Spoiler:


This will check to see if flag 0x900 is set. If it is, it will run a script that does nothing. Flag 900 is only set at the end of your script, so it will not be set the first time you enter the map, but the first time the script runs, it will be.

You could do a similar thing using a variable:

Spoiler:


The script will only activate if 4050 is set to 0001, which you do at the end of the script. Either way should cause the script to execute once and only once.
 
Hi, addpokemon does work with values for expanded dexes. Make sure you're using the Pokemon's ID and not just the name. In the #defines there aren't name aliasing for your expanded mons.

Probably it's written right between what you said, but where do I find the ID? Can I view it with G3HS or are there other tools for it? And I thought it should work when I write 'GENESECT', 'cause it does with 'MEW', 'PIKACHU', 'JIGGLYPUFF', etc.
 
Probably it's written right between what you said, but where do I find the ID? Can I view it with G3HS or are there other tools for it? And I thought it should work when I write 'GENESECT', 'cause it does with 'MEW', 'PIKACHU', 'JIGGLYPUFF', etc.

The ID number should be the species number. Rattata would be 0x13 (19 in decimal) for example.
 
Status
Not open for further replies.
Back
Top