• 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 Conquest 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.
Hello, everyone! I was trying to make my first ScriptBox today, since I'm years out of practice, and am currently on Winter Break. I'm using XSE, as I figured it would be better to learn with a tool that is widely regarded as one of the better tools. I didn't compile anything yet, because there's a specific area where problems are bound to occur.

Spoiler:


Basically, what is supposed to happen is that the Person Event ID #4 moves down three spaces when the player steps on the ScriptBox, and commence a Trainer Battle, before saying something and leaving via fading screen and fading it back in. However, I'm struggling to figure out how to prevent the player from moving after the battle, as the player can move after the battle. The player needs to initiate Person Event ID #4 in order to make them disappear; how can I just have the script go on automatically with the textbox @afterbattle?

Use trainerbattle 0x1 instead of 0x0. This allows for an added pointer after the command which you can continue the script with :).
 
How do you use callasm in a setmaptile script? I'm using the check Pokemon routine and my script works fine when it's a person event but as a setmpatile script the game does some serious glitches.

Is there anyway to get round it?
 
So I feel this is the best place to ask this, I am writing an apricorn script in Firered
I have the whole script basically written down, although I have no clue how to create time based events (so the player needs to wait about 5-10 min rl time before he can receive the pokeball of choice)
I am no master of ASM so I was curious is this can be done with a scripting command?
 
How do you use callasm in a setmaptile script? I'm using the check Pokemon routine and my script works fine when it's a person event but as a setmpatile script the game does some serious glitches.

Is there anyway to get round it?

Didn't specify what hack you're doing but if EM, you can get around it with just script using this resource: Click here

I'm sure the program Trader Advanced works for FR if that's what you're hacking, you just need to find a script in the game that allows you to trade a pokemon (i think theres a guy near the beginning that wants like an onix for a bellsprout? idr)
But yeah, that's all script so it should work if you figure it out
 
Didn't specify what hack you're doing but if EM, you can get around it with just script using this resource: Click here

I'm sure the program Trader Advanced works for FR if that's what you're hacking, you just need to find a script in the game that allows you to trade a pokemon (i think theres a guy near the beginning that wants like an onix for a bellsprout? idr)
But yeah, that's all script so it should work if you figure it out

Yeah it's Emerald. I was saying the script worked fine, it was just in a level script format but I'm using it in a signpost event now so it works fine.

Thanks anyway
 
Spoiler:

Script:
Spoiler:

It seems weird, because all i changed was the professors name.

Edit: I think I fixed it, I'm testing now.
 
Spoiler:

Script:
Spoiler:

It seems weird, because all i changed was the professors name.

Edit: I think I fixed it, I'm testing now.

Don't know if you still want a response, but this is caused by the name being too long and overwriting too much in the rom.
Just use the dynamic offset at the top and repoint the string that you changed.
 
So for some reason this script here wont start. It's beefy

Spoiler:


Phew, ok so what's the problem? xD
 
So for some reason this script here wont start. It's beefy

Spoiler:


Phew, ok so what's the problem? xD

On my phone :c can't see any obvious problems. Is this a script tile? If so are the details filled in correctly in A-Map?

Does your script freeze the game or simply never activate? If the latter, perhaps your variable is already set.
 
Hi guys, I've decided to take up ROM hacking as a hobby. Getting my feet wet with my first script here... I can't figure out why my hidesprite command won't stay permanent. The idea is the player triggers the script, this NPC talks to you, leaves and is never on this same map for the rest of the game. But, as soon as my player moves a tile, the NPC pops up back on their starting tile.

Can anyone help me figure out why? Or find a work-around so the NPC stays hidden after this event happens?

In this case, the flag 0x20B is (supposed to be) applied to the NPC. I also have 020B as the Person ID in Advance Map.

Spoiler:

Thank you to anyone that spends even a minute trying to help!
 
Hi guys, I've decided to take up ROM hacking as a hobby. Getting my feet wet with my first script here... I can't figure out why my hidesprite command won't stay permanent. The idea is the player triggers the script, this NPC talks to you, leaves and is never on this same map for the rest of the game. But, as soon as my player moves a tile, the NPC pops up back on their starting tile.

Can anyone help me figure out why? Or find a work-around so the NPC stays hidden after this event happens?

In this case, the flag 0x20B is (supposed to be) applied to the NPC. I also have 020B as the Person ID in Advance Map.

Spoiler:

Thank you to anyone that spends even a minute trying to help!

If you saved on the same map where the NPC is located, then exit the map by going to another map (inside a house, outside the town/route, etc) and go back again and test if it's still happening.
 
As an aside, it looks like you're using two flags for no reason. If the person event is supposed to be hidden after being talked to the first time, the checkflag isn't needed as the script can never be executed again by the player. Plus, you can just use 0x20c as the person ID for the person event instead of 0x20b, and just set it after the hidesprite instead.

But yeah your problem is likely because of save states. I'd also check to make sure you using 1.1.1 for XSE and 1.9.2 for AMap, just in case.
 
If you saved on the same map where the NPC is located, then exit the map by going to another map (inside a house, outside the town/route, etc) and go back again and test if it's still happening.

Thank you soo much! You are right. I exited the map and the sprite had disappeared. I then restarted the game, saved inside of a house, went outside to trigger the event and it worked perfectly! You rock. :)

As an aside, it looks like you're using two flags for no reason. If the person event is supposed to be hidden after being talked to the first time, the checkflag isn't needed as the script can never be executed again by the player. Plus, you can just use 0x20c as the person ID for the person event instead of 0x20b, and just set it after the hidesprite instead.

But yeah your problem is likely because of save states. I'd also check to make sure you using 1.1.1 for XSE and 1.9.2 for AMap, just in case.

Thank you for helping! You're right, I have an unnecessary flag. I took your suggestion and assigned 0x20C to the Person ID and got rid of 0x20B as a flag altogether.

Also I doubled checked and I am indeed using XSE 1.1.1 and am using AMap 1.9.5. Should I use 1.9.2? I got 1.9.5 from LU-HO's signature haha.
 
1.9.5 isn't terrible, but in general it's agreed that 1.9.2 is more stable and it basically has the same functionality with the exception of aesthetic niceties. The worst thing about 1.9.2 is that it doesn't support anything from the second half of a 32MB ROM, but if you've just started off I doubt that'd be much of a concern. 1.9.5 has a tendency to be associated with ROM corruptions is all. Though it likely was just save states messing up your script in this case, not the tools.
 
I am completely devastated.

I am working on my FireRed hack, Pokémon FlameGold; which replaces the Sevii Islands with a Johto post-game story.

I have created all the necessary maps and inserted them into the game.

My issue is that I have scripted as far as Azelea Town, however, whenever I try and add a new script now, I lose map files and/or previous scripts to corruption.

I suspected this may be an issue with available space left in the rom, however FSF is still yielding many free offsets.

Please help, once this is sorted, my game is only days away from completion.
 
I am completely devastated.

I am working on my FireRed hack, Pokémon FlameGold; which replaces the Sevii Islands with a Johto post-game story.

I have created all the necessary maps and inserted them into the game.

My issue is that I have scripted as far as Azelea Town, however, whenever I try and add a new script now, I lose map files and/or previous scripts to corruption.

I suspected this may be an issue with available space left in the rom, however FSF is still yielding many free offsets.

Please help, once this is sorted, my game is only days away from completion.
Well you could always just reinsert everything on a clean ROM, from the sounds of it it wouldn't be too hard given all you've done is maps and a few scripts. That's an odd problem though, there should be plenty of space left if that's really all you've done. Are you using 1.92 or 1.95?
 
Well you could always just reinsert everything on a clean ROM, from the sounds of it it wouldn't be too hard given all you've done is maps and a few scripts. That's an odd problem though, there should be plenty of space left if that's really all you've done. Are you using 1.92 or 1.95?

I'm on 1.92
I heard it was the least buggy.
Before I reinsert everything, is there any chance that it could be due to a script I've made before I hit the same problem again?

Plus I technically have a whole region's worth of maps in here (building insides and all) so I was wondering if maybe that was just too much for the game to deal with?

(...And many thanks for your reply btw! I've booked days off work to do this game so you can imagine my frustration!)
 
This is it

Spoiler:


The flag is in the Person ID number, the sprite number is the person event number (both Oak and the Aide that gives you the running shows are set with their person event number so I know I've got it right).

All I want is for Leaf to be hidden until another script calls for her to show up, but every time I tweak something and reload the ROM she's still there, blocking the second block in where I put her. Having the script offset in the offset area of the people event (which isn't a thing for other hidden sprites) doesn't make a difference, she's visible either way.

I've totally had scripts like this before in previous attempts at ROM hacking, so I have no freaking clue why this would be screwing up! Please help me before I kill people!

Not really though. Don't worry.
 
Last edited:
I'm on 1.92
I heard it was the least buggy.
Before I reinsert everything, is there any chance that it could be due to a script I've made before I hit the same problem again?

Plus I technically have a whole region's worth of maps in here (building insides and all) so I was wondering if maybe that was just too much for the game to deal with?

(...And many thanks for your reply btw! I've booked days off work to do this game so you can imagine my frustration!)
A script itself shouldn't be able to corrupt your ROM, unless you're trying to insert it over something important. Best advice I can give you is to keep constant backups, and since you mentioned FSF keep in mind you can use XSE's #dynamic command to automatically find free space when compiling the script. That should save you some time!

This is it

Spoiler:


The flag is in the Person ID number, the sprite number is the person event number (both Oak and the Aide that gives you the running shows are set with their person event number so I know I've got it right).

All I want is for Leaf to be hidden until another script calls for her to show up, but every time I tweak something and reload the ROM she's still there, blocking the second block in where I put her. Having the script offset in the offset area of the people event (which isn't a thing for other hidden sprites) doesn't make a difference, she's visible either way.

I've totally had scripts like this before in previous attempts at ROM hacking, so I have no freaking clue why this would be screwing up! Please help me before I kill people!

Not really though. Don't worry.
If you haven't inserted a flag extension hack of any kind the flag 1200 should not be used as it does not exist. 200 - 2FF are the only safe ones (with a few exceptions), try one of those and see if you're still having problems.
 
If you haven't inserted a flag extension hack of any kind the flag 1200 should not be used as it does not exist. 200 - 2FF are the only safe ones (with a few exceptions), try one of those and see if you're still having problems.

I've heard and seen in many places that there's 1200 and up and I've seen it working, plus there's someone who's specifically said not to use 200 - 2FF, so I guess I'll just give up! It wasn't gonna get anywhere anyways!
 
Status
Not open for further replies.
Back
Top