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

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
I have a problem with free space.

I expanded my Emerald ROM to 32 MB. To avoid sound corruption, I have to use #dynamic 0xE3CF64 in scripts. However, when compiling in PKSV it assigns all offsets to 0x100001 no matter how big they are, and when compiling in XSE I get a "Not enough free space" error.

I tried HackMew's Free Space Finder, but it is dangerous because it can overwrite scripts if I'm not careful, so I can't use it.
How can I fix this? I don't know what to do. ;-;
There is plenty of free space in your 16MB rom already if you just put it in use. But this is basically one of the reasons I don't want to use dynamic pointers because I never know where they send the leftover data of my scripts.

What you could do is find a way to expand the rom data or start finding the leftover script data and remove it (because if your 16MB rom is almost filled up, you ought to have more than > 4MB of that kind of data already (just my assumption though)).
 

hinkage

Everyone currently in an argument with this member
384
Posts
13
Years
  • Age 28
  • Seen yesterday
There is plenty of free space in your 16MB rom already if you just put it in use. But this is basically one of the reasons I don't want to use dynamic pointers because I never know where they send the leftover data of my scripts.

What you could do is find a way to expand the rom data or start finding the leftover script data and remove it (because if your 16MB rom is almost filled up, you ought to have more than > 4MB of that kind of data already (just my assumption though)).

What... First of all: No, there isn't that much free space in Emerald. Second, using that free space still corrupts music. Don't ask me how, but it does.

I've also tried "#define X freespaceY" in PKSV, but it has the same problem.

...At this rate, it looks like I'm boned. ~Sound corruption all day~
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
What... First of all: No, there isn't that much free space in Emerald. Second, using that free space still corrupts music. Don't ask me how, but it does.

I've also tried "#define X freespaceY" in PKSV, but it has the same problem.

...At this rate, it looks like I'm boned. ~Sound corruption all day~
It looks like the game doesn't want you to use specific part of the rom area at all. There is gotta be a certain code for making the sound corruption to happen (because nothing happens by accident) if you use that part of the rom data for different things.

However, haven't you noticed when the sound corruption takes place ? In case you've (and make backups often), you can easily track down what's making it to happen if you make a patch file using the one "not corrupted" as unmodified rom file and the one with sound corruption as modified one. Then open the ips-file with a hex editor (the format for changing data in the rom is pretty simple:
3 bytes for "offset" + 2 bytes for "how many bytes to change" + "bytes to change" and this goes over and over again till the end of file (EOF).

In case you can't expand your rom data though, I'd advise you to start removing existing events, maps, scripts and text to make room for new things to add (and do everything from scratch).
*At least you can remove all useless text no problem (and scripts that way as well)
 

hinkage

Everyone currently in an argument with this member
384
Posts
13
Years
  • Age 28
  • Seen yesterday
It looks like the game doesn't want you to use specific part of the rom area at all. There is gotta be a certain code for making the sound corruption to happen (because nothing happens by accident) if you use that part of the rom data for different things.

However, haven't you noticed when the sound corruption takes place ? In case you've (and make backups often), you can easily track down what's making it to happen if you make a patch file using the one "not corrupted" as unmodified rom file and the one with sound corruption as modified one. Then open the ips-file with a hex editor (the format for changing data in the rom is pretty simple:
3 bytes for "offset" + 2 bytes for "how many bytes to change" + "bytes to change" and this goes over and over again till the end of file (EOF).

In case you can't expand your rom data though, I'd advise you to start removing existing events, maps, scripts and text to make room for new things to add (and do everything from scratch).
*At least you can remove all useless text no problem (and scripts that way as well)

I don't think you really understand...

The sound corruption occurs whenever you insert anything into Emerald's normal space. EVERYTHING makes it happen. There's no code, just stuff being overwritten. Removing events doesn't help, either.. The only way to avoid corruption is with this method: http://www.pokecommunity.com/showthread.php?t=217054
But, for some reason, script editors aren't letting me assign anything in the expanded 16 MB.
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
I don't think you really understand...

The sound corruption occurs whenever you insert anything into Emerald's normal space. EVERYTHING makes it happen. There's no code, just stuff being overwritten. Removing events doesn't help, either.. The only way to avoid corruption is with this method: http://www.pokecommunity.com/showthread.php?t=217054
There is stuff there that has to be 00's, just like Chaos Rush said in that tutorial. So there's also gotta be a code for checking whether that data has been modified or not if sound corruption occurs if this has been done.
If there wouldn't be, writing something to that part of rom area wouldn't affect the game in any way.
Maybe it's like additional header or something ?

Anyway, there is no need arguing about it. I may be wrong here but I can't really think of any other explanation. Those 00's have to be used for something so some code must check that data as well (maybe gamefreak designed something to be written there and dropped the idea later on ?).

But, for some reason, script editors aren't letting me assign anything in the expanded 16 MB.
This may sound like a dumb question but did you know that when pointing to the expanded rom area (16MB to 32MB) you need to use 09 as part of any pointer instead of 08 ?
 

Renegade

Time for real life...
995
Posts
12
Years
I'm having trouble finding out how to make a move camera script where the player stops moving but the camera pans to a certain location on the map. I pretty much know everything there is to know about Pokescript, but now I'm switching to XSE. Help? Thanks!
 
5,256
Posts
16
Years
I'm having trouble finding out how to make a move camera script where the player stops moving but the camera pans to a certain location on the map. I pretty much know everything there is to know about Pokescript, but now I'm switching to XSE. Help? Thanks!

Code:
...
special 0x113
applymovement 0x7F @move1
waitmovement 0x0
special 0x114
...

That code will move the camera according to the movements set at @move1.
 
31
Posts
12
Years
  • Seen Jun 20, 2012
I am trying to make it check if you have at least one Pokemon, and if so you can pass, and if not it sends you one block back/South. But whenever I step on the tile it has the script on it just freezes the game.

Here's the script:

#dynamic 0x899999
#org @check
setvar 0x8004 0x19
special2 0x800D 0x17C
compare 0x800D 0x1
if b_true goto @have
if b_false goto @donthave
#org @have
end
#org @donthave
msgbox @troll 0x6
waitmsgbox
pause 0x1E
applymovement MOVE_PLAYER 0x3 @movedown
waitmovement 0x0
end
#org @troll
= I don't have a Pokemon yet!\nBetter go talk to Oak!
#org @movedown
#raw 0x1 0x2 0x3 0x4 0xFE
 
5,256
Posts
16
Years
I am trying to make it check if you have at least one Pokemon, and if so you can pass, and if not it sends you one block back/South. But whenever I step on the tile it has the script on it just freezes the game.

Here's the script:

Oh my, there's quite a few things wrong with that script. Here's a version that will work, with annotations to explain:

Code:
#dynamic 0x800000 // You don't need to enter an arbitrary number, just enter this and XSE will find the right offset for you.

#org @start
countpokemon // this stores the amount of Pokémon in your party to LASTRESULT
compare LASTRESULT 0x1 // this checks if LASTRESULT is equal to one
if B_>= goto @have // if it's equal or larger than one, the script goes to @have
msgbox @troll 0x6 //otherwise, "@donthave" happens here - a separate part isn't needed.
applymovement MOVE_PLAYER @movedown // I removed the "waitmsgbox " and "pause 0x1E" commands - they seemed useless.
waitmovement 0x0
end

#org @have
end

#org @troll
= I don't have a Pokemon yet!\nBetter go talk to Oak!

#org @movedown
#raw 0x1 0x2 0x3 0x4 0xFE

Try that script, then make sure the script tile (the green square with a yellow "S" in Advance Map) is set up so that the "Unknown" is "$03" and the "Var Number" is "$4050" (or another variable that you never set).
 
31
Posts
12
Years
  • Seen Jun 20, 2012
Thank you so much for your help, it works, but it doesn't move the player down, it just makes him turn looking down.
 
5,256
Posts
16
Years
Oh, that's because the movements are wrong. Here's the fixed version:
Code:
#dynamic 0x800000

#org @start
countpokemon
compare LASTRESULT 0x1
if B_>= goto @have
msgbox @troll 0x6
applymovement MOVE_PLAYER @movedown
waitmovement 0x0
end

#org @have
end

#org @troll
= I don't have a Pokemon yet!\nBetter go talk to Oak!

#org @movedown
#raw 0x10 0xFE
 
29
Posts
15
Years
  • Seen Feb 10, 2013
Ugh, I need help again :(
I'm trying to figure out how to change two tiles in a map after you talk to some guy in a totally different map (Although this flag check is not implemented yet because the scripts aren't finished). I figured out that there is something called setmaptile, and I'm trying to use that in conjunction with script tiles in AdvanceMap.

I can't find any information on script tiles anywhere, so I'm just kind of guessing and checking, here's my problem:

I have my script:
Code:
'---------------
#org 0xE00EB8
lockall
checkflag 0x939
if 0x1 goto 0x8E00EEA
fadescreen 0x1
setmaptile 0x58 0x5 0xA7 0x0
setmaptile 0x58 0x4 0x9F 0x1
fadescreen 0x0
setflag 0x939
releaseall
end

'---------------
#org 0xE00EEA
releaseall
end

And I have some script tiles (They're the green boxes with an 'S' on them in AMap, mentioning this because I don't really know the name for them). I changed the script offset of each of the tiles to the offset of the above script, and I thought this was all I had to do. Now when I walk onto one of these tiles my game just freezes, almost like it gets to lockall but not ever to fadescreen, let alone releaseall lol.

Anyone know what's up?

EDIT: After reading the above post I saw he mentioned changing the unknown to 03 and the var to 4050, so I went and did that for all my scripting tiles, but now my game doesn't even freeze, it just... does nothing.

If it helps, I'm hacking Emerald.
 
Last edited:
31
Posts
12
Years
  • Seen Jun 20, 2012
Ok, it makes me move back down which is good, but it doesn't display the message box saying, "I don't have a Pokemon blah blah blah."
 
5,256
Posts
16
Years
Ok, it makes me move back down which is good, but it doesn't display the message box saying, "I don't have a Pokemon blah blah blah."
I'm stumped. It should work. Are you sure you copied the entire the script?
Ugh, I need help again :(
I'm trying to figure out how to change two tiles in a map after you talk to some guy in a totally different map (Although this flag check is not implemented yet because the scripts aren't finished). I figured out that there is something called setmaptile, and I'm trying to use that in conjunction with script tiles in AdvanceMap.

I can't find any information on script tiles anywhere, so I'm just kind of guessing and checking, here's my problem:

I have my script:
Code:
'---------------
#org 0xE00EB8
lockall
checkflag 0x939
if 0x1 goto 0x8E00EEA
fadescreen 0x1
setmaptile 0x58 0x5 0xA7 0x0
setmaptile 0x58 0x4 0x9F 0x1
fadescreen 0x0
setflag 0x939
releaseall
end

'---------------
#org 0xE00EEA
releaseall
end

And I have some script tiles (They're the green boxes with an 'S' on them in AMap, mentioning this because I don't really know the name for them). I changed the script offset of each of the tiles to the offset of the above script, and I thought this was all I had to do. Now when I walk onto one of these tiles my game just freezes, almost like it gets to lockall but not ever to fadescreen, let alone releaseall lol.

Anyone know what's up?

EDIT: After reading the above post I saw he mentioned changing the unknown to 03 and the var to 4050, so I went and did that for all my scripting tiles, but now my game doesn't even freeze, it just... does nothing.

If it helps, I'm hacking Emerald.
Perhaps flag 939 has been set? I'm not sure which flags are safe for Emerald, but maybe if you change the flag you'll get a result?
 
31
Posts
12
Years
  • Seen Jun 20, 2012
Thanks, but it still doesn't display the msgbox.

Thanks so much for the help by the way and sorry i'm a noob at scripting.
 
29
Posts
15
Years
  • Seen Feb 10, 2013
Crap I thought I responded, haha. Anyway, I tried changing the flag to check 271 and it still does nothing :(
 

Renegade

Time for real life...
995
Posts
12
Years
I'm having trouble with this long script. This is the first script I have made with XSE. The problem is: The script activates when I step onto a script box but the only things that happen are the movements. No talking appears in the script in-game. Help please? Thanks!

Code:
#dynamic 0x800000

#org @start
lock
special 0x113
applymovement 0x7F @m1
waitmovement 0x0
special 0x114
textcolor 0x0
msgbox @t1 6
pause 0x30
msgbox @t2 6
pause 0x30
applymovement 1 @m2
waitmovement 0x0
msgbox @t3 4
closeonkeypress
applymovement 2 @m3
applymovement 3 @m3
waitmovement 0x0
msgbox @t4 4
closeonkeypress
msgbox @t5 6
applymovement 2 @m3
applymovement 3 @m3
waitmovement 0x0
msgbox @t4 4
closeonkeypress
fadescreen 0x3
hidesprite 0x01
setflag 0x1200
hidesprite 0x02
setflag 0x1201
hidesprite 0x03
setflag 0x1202
warp 0x4 0x0 0xFF 0x02 0x06
setvar 0x6000 0x0001
end

#org @m1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org @t1
= Man: So, this is the place\nwhere it all started...

#org @t2
= Maybe I should begin here...\pNo, it'll have to wait. I can't\ndo this just yet... I must\lwait. But I should return to the\lHQ to settle where we should begin\lat.

#org @m2
#raw 0x0
#raw 0xFE

#org @t3
= Right! Let us head back to\nthe HQ at once!\pGRUNTS!

#org @m3
#raw 0x21
#raw 0xFE

#org @t4
= Grunts: SIR!

#org @t5
= Man: We are ready to departure!
 
Last edited:
29
Posts
15
Years
  • Seen Feb 10, 2013
If I know your problem I'll edit this post, but for now please put
Code:
 or [SPOILER] tags around that lol.
 

dr4g0n12(2)

INSURRECTION!!!!!
12
Posts
12
Years
  • Seen Dec 14, 2014
How does the "setmapfooter" command work, and how would I put it in a script?
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
I'm having trouble with this long script. This is the first script I have made with XSE. The problem is: The script activates when I step onto a script box but the only things that happen are the movements. No talking appears in the script in-game. Help please? Thanks!

Code:
#dynamic 0x800000

#org @start
lock
special 0x113
applymovement 0x7F @m1
waitmovement 0x0
special 0x114
textcolor 0x0
msgbox @t1 6
pause 0x30
msgbox @t2 6
pause 0x30
applymovement 1 @m2
waitmovement 0x0
msgbox @t3 4
closeonkeypress
applymovement 2 @m3
applymovement 3 @m3
waitmovement 0x0
msgbox @t4 4
closeonkeypress
msgbox @t5 6
applymovement 2 @m3
applymovement 3 @m3
waitmovement 0x0
msgbox @t4 4
closeonkeypress
fadescreen 0x3
hidesprite 0x01
setflag 0x1200
hidesprite 0x02
setflag 0x1201
hidesprite 0x03
setflag 0x1202
warp 0x4 0x0 0xFF 0x02 0x06
setvar 0x6000 0x0001
end

#org @m1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org @t1
= Man: So, this is the place\nwhere it all started...

#org @t2
= Maybe I should begin here...\pNo, it'll have to wait. I can't\ndo this just yet... I must\lwait. But I should return to the\lHQ to settle where we should begin\lat.

#org @m2
#raw 0x0
#raw 0xFE

#org @t3
= Right! Let us head back to\nthe HQ at once!\pGRUNTS!

#org @m3
#raw 0x21
#raw 0xFE

#org @t4
= Grunts: SIR!

#org @t5
= Man: We are ready to departure!

I just tested your script and it was working, even the texts.
I am assuming that the error is on your end.
Probably you inserted an invalid 'Unknown' and 'Var Number' on your script tile in A-Map, perhaps?
Or maybe your XSE isn't version 1.1...?
 
Status
Not open for further replies.
Back
Top