Script Help Thread (DO NOT REQUEST SCRIPTS) Page 277

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies

miksy91

Dark Energy is back in action! ;)

Male
Finland
Seen September 21st, 2022
Posted September 21st, 2022
1,480 posts
14.6 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)).
Pokémon Dark Energy
Some ROM hacking related stuff

hinkage

Everyone currently in an argument with this member: I really suggest you stop.

Seen October 3rd, 2021
Posted October 30th, 2020
378 posts
12.7 Years
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! ;)

Male
Finland
Seen September 21st, 2022
Posted September 21st, 2022
1,480 posts
14.6 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)
Pokémon Dark Energy
Some ROM hacking related stuff

hinkage

Everyone currently in an argument with this member: I really suggest you stop.

Seen October 3rd, 2021
Posted October 30th, 2020
378 posts
12.7 Years
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! ;)

Male
Finland
Seen September 21st, 2022
Posted September 21st, 2022
1,480 posts
14.6 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 ?
Pokémon Dark Energy
Some ROM hacking related stuff

Renegade

Time for real life...

Male
United States
Seen January 8th, 2015
Posted December 31st, 2014
995 posts
11.5 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!

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 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!
...
special 0x113
applymovement 0x7F @move1
waitmovement 0x0
special 0x114
...
That code will move the camera according to the movements set at @move1.
Seen June 20th, 2012
Posted June 11th, 2012
31 posts
11.9 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:

#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
Pokemon Purple: 10% Done ||||||||||
Dream Team -
Click Here for Pokemon: Purple Website!

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 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:

#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).

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
Oh, that's because the movements are wrong. Here's the fixed version:
#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
Seen February 10th, 2013
Posted January 27th, 2013
29 posts
14.1 Years
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:
'---------------
#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.

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 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:
'---------------
#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?

Renegade

Time for real life...

Male
United States
Seen January 8th, 2015
Posted December 31st, 2014
995 posts
11.5 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!

#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!

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 3 Days Ago
Posted March 24th, 2023
8,579 posts
16 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!

#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...?

Male
North, it's cold.
Seen July 14th, 2013
Posted November 18th, 2012
49 posts
11.6 Years
Hack Rom: FireRed
Script editor: XSE

Does someone know the command to stop an earthquake? I used the command special 0x136 to create an earthquake, but it doesn't stop even after the script ends. I assume that I've gonna have to put a pause command after the cry and then put the command that stops the earthquake.

Here's the script. And right now everything works perfectly except for the earthquake never stopping.
Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x1 goto @done
applymovement 0x1 @move
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move5
applymovement 0xFF @move2
waitmovement 0x0
msgbox @2 0x6
special 0x136
cry 0x19A 0x0
applymovement 0xFF @move
applymovement 0x1 @move
applymovement 0x2 @move
waitmovement 0x0
msgbox @3 0x6
applymovement 0xFF @move3
waitmovement 0x0
msgbox @4 0x6
applymovement 0x1 @move4
waitmovement 0x0
pause 0x100
applymovement 0xFF @move1
msgbox @5 0x6
release
end

#org @done
release
end

#org @move
#raw 0x0
#raw 0x62
#raw 0xFE

#org @1
= Elder: Oh \v\h01, I was wondering\nwhen you'd get here. Have a seat.

#org @move2
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x3
#raw 0xFE

#org @2
= Elder: Now, I bet you're wondering\nwhy I called you here.\p\v\h01: Well yeah. Everyone in the\nvillage is. It's not often that\lthe Elder asks to see someone in\lprivate.\pElder: Oh ho ho. Yes, I do suppose\nI shouldn't have made a big deal\labout it yesterday. And please,\lcall me Anita.\pAnita: So anyways, I called you\nhere to discuss the future.\lYou see, I hate to admit it but\ltime is moving on, and the farther\lit goes on the harder I find it to\lkeep up.\pYou \v\h01, you're strong,\nbrimming with engergy and bright\lideas.\p\v\h01: Anita...are you -\pAnita: Hush! Didn't your brother\nteach you not to interput when\lothers are talking?\pSo, as I was saying...\pYou're young, and exactly what the\nfuture needs. I want you too-

#org @3
= Anita: That was!\p...No it couldn't be.

#org @move3
#raw 0x3
#raw 0xFE

#org @4
= \v\h01: Anita, do you know what\nthat was?\pAnita:...\nWait here, I'll check. Don't come\loutside until I get back.

#org @move4
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x60
#raw 0xFE

#org @move1
#raw 0x11
#raw 0xFE

#org @5
= \v\h01: Maybe I should see what's\nout there too...

#org @move5
#raw 0x2
#raw 0xFE
Hackers, Hacker everywhere.

Hacks I support:
FloralSky





destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 3 Days Ago
Posted March 24th, 2023
8,579 posts
16 Years
Hack Rom: FireRed
Script editor: XSE

Does someone know the command to stop an earthquake? I used the command special 0x136 to create an earthquake, but it doesn't stop even after the script ends. I assume that I've gonna have to put a pause command after the cry and then put the command that stops the earthquake.

Here's the script. And right now everything works perfectly except for the earthquake never stopping.
Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x1 goto @done
applymovement 0x1 @move
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move5
applymovement 0xFF @move2
waitmovement 0x0
msgbox @2 0x6
special 0x136
cry 0x19A 0x0
applymovement 0xFF @move
applymovement 0x1 @move
applymovement 0x2 @move
waitmovement 0x0
msgbox @3 0x6
applymovement 0xFF @move3
waitmovement 0x0
msgbox @4 0x6
applymovement 0x1 @move4
waitmovement 0x0
pause 0x100
applymovement 0xFF @move1
msgbox @5 0x6
release
end

#org @done
release
end

#org @move
#raw 0x0
#raw 0x62
#raw 0xFE

#org @1
= Elder: Oh \v\h01, I was wondering\nwhen you'd get here. Have a seat.

#org @move2
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x3
#raw 0xFE

#org @2
= Elder: Now, I bet you're wondering\nwhy I called you here.\p\v\h01: Well yeah. Everyone in the\nvillage is. It's not often that\lthe Elder asks to see someone in\lprivate.\pElder: Oh ho ho. Yes, I do suppose\nI shouldn't have made a big deal\labout it yesterday. And please,\lcall me Anita.\pAnita: So anyways, I called you\nhere to discuss the future.\lYou see, I hate to admit it but\ltime is moving on, and the farther\lit goes on the harder I find it to\lkeep up.\pYou \v\h01, you're strong,\nbrimming with engergy and bright\lideas.\p\v\h01: Anita...are you -\pAnita: Hush! Didn't your brother\nteach you not to interput when\lothers are talking?\pSo, as I was saying...\pYou're young, and exactly what the\nfuture needs. I want you too-

#org @3
= Anita: That was!\p...No it couldn't be.

#org @move3
#raw 0x3
#raw 0xFE

#org @4
= \v\h01: Anita, do you know what\nthat was?\pAnita:...\nWait here, I'll check. Don't come\loutside until I get back.

#org @move4
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x60
#raw 0xFE

#org @move1
#raw 0x11
#raw 0xFE

#org @5
= \v\h01: Maybe I should see what's\nout there too...

#org @move5
#raw 0x2
#raw 0xFE
I just tried it, but there was no earthquake animation...
Also, I read the Guide in XSE and in there, it states that special 0x136 is "Using Strength"...
And oh, minor thing, but you spelled "interrupt" wrong.

Seen February 10th, 2013
Posted January 27th, 2013
29 posts
14.1 Years
Well I tried removing the flag check completely to see if it was a flag and that had no effect. Here's the script with the flag check:

'---------------
#org 0xE00EB8
lockall
checkflag 0x271
if 0x1 goto 0x8E00EEA
fadescreen 0x1
setmaptile 0x58 0x5 0xA7 0x0
setmaptile 0x58 0x4 0x9F 0x1
fadescreen 0x0
setflag 0x271
releaseall
end

'---------------
#org 0xE00EEA
releaseall
end
I removed the check and set and it still wasn't doing anything.

As of right now nothing happens, it never locks or fades. Here are my tile settings:

Unknown: $03
Var number: $4050
Var value: $0000
Unknown: $00
Script offset: $00E00EB8