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

hinkage

Everyone currently in an argument with this member
384
Posts
13
Years
  • Age 28
  • Seen Apr 22, 2024
Then don't use an offset greater than 0xFFFFFF simple as that.... :)

If I DON'T use my expanded space, music gets corrupted. Emerald does that. Common knowledge.
 
29
Posts
15
Years
  • Seen Feb 10, 2013
If I DON'T use my expanded space, music gets corrupted. Emerald does that. Common knowledge.

How exactly would you use an offset above 0xFFFFFF? In the hex 'alphabet' it doesn't go past 'F,' sorry if I just don't understand it but it seems the only logical way to continue from that point would be for the program to go back to 0x1... etc...

(I actually do want to know this, because I plan on making my own hack from Emerald and I didn't even know you could expand the ROM :/)

ANYWAYS...

Kind of related to my issue above, I'm scripting a new beginning for the game. I'm not that far, but I found a program to change the starting location for the game and that worked out, so I have two questions:

1) Is there any way to remove the 'earthquake' animation and the stopping and pausing that happens in the truck from my new map? I cleared out all the map scripts but it still happens :/

2) I have a script:

Code:
#dynamic 0xE00000

#org @start
lockall
applymovement 0xFF @jump
waitmovement 0xFF
fadescreen 0x1
warpmuted 0x24 0x52 0xFF 0x06 0x06
fadescreen 0x0
releaseall
end

#org @jump
#raw 0x0C 0xFE

This is on a tile, and the tile isn't the actual problem... This is what happens:

My character jumps down into the 'hole' like he's supposed to and then the screen fades... like it's supposed to.

Here's the problem, after it fades it just crashes the game, not freezes but completely crashes.

The new map I'm trying to warp to is a 13x13 map overwriting the entrance to New Mauville, using the same tilesets as it. The whole map is just black tiles (Except for a sign), with script tiles making a circle around where the player warps to on the ground, there are 26 script tiles in the circle, so my thought is that there are way to many scripts in one map, but that's kind of a problem because I want the player to be able to 'play a part' in the entrance to the game.

I might add that I have absolutely no idea what the exit # is in the warp command, I just saw a few in-game scripts using that and it worked in my re-make of the 'getting out of the truck, talking to your mom, and going into the house' sequence.

Also, do scripts keep going after you warp? That would be really useful because I could make a whole 'cutscene,' but if not that sucks because then I have to use a level script just to frickin' fade the screen back to normal :/

Sorry for the novel, just have a lot of problems and I'm running on my phone's Wifi tethering (Stupid step dad disabled the cable) so I need to hit around 10-20 birds with one slow-moving stone lol.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Code:
#dynamic 0xE00000

#org @start
lockall
applymovement 0xFF @jump
waitmovement 0xFF
fadescreen 0x1
[B]warpmuted 0x24 0x52 0xFF 0x06 0x06[/B]
fadescreen 0x0
releaseall
end

#org @jump
#raw 0x0C 0xFE

From the looks of it, unless you have loads and loads of maps, you have put the map bank and map number in decimal, rather than hex.

Try:

warpmuted 0x18 0x34 0xFF 0x6 0x6
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
Hey everyone, sorry for making a second post. After posting a couple of days ago to try and get help with my script, I started doing a bit more looking around and was able to fix up my script a bit. I've managed to make it work a bit better by using applymovement (which involved me completely switching over to using XSE instead of PKSV), but now I'm stumped on how to fix another problem I have with the script. When I, say, go to a different room and come back, the sprite that vanished is there again. I thought that by having my flags set up I'd be able to stop this, but apparantly not. Can anybody point out what I'm doing wrong here?

Game: Pokemon Firered
Type: Movement/Person Event
Editor: XSE
Script:
Spoiler:
 
29
Posts
15
Years
  • Seen Feb 10, 2013
Ugh I feel sooo stupid, thank you soo much SwiftSign I'd still be stuck if not for you. :D


Thane, did you set the sprite's PID to the flag? Also, lmao @ "Magikarp, you failed me!"
 

tajaros

Hi I'm dawg
855
Posts
12
Years
Hey everyone, sorry for making a second post. After posting a couple of days ago to try and get help with my script, I started doing a bit more looking around and was able to fix up my script a bit. I've managed to make it work a bit better by using applymovement (which involved me completely switching over to using XSE instead of PKSV), but now I'm stumped on how to fix another problem I have with the script. When I, say, go to a different room and come back, the sprite that vanished is there again. I thought that by having my flags set up I'd be able to stop this, but apparantly not. Can anybody point out what I'm doing wrong here?

Game: Pokemon Firered
Type: Movement/Person Event
Editor: XSE
Script:
Spoiler:

Instead of using #raw 0x60 and applymovement to person event #2 try doing a "hidesprite" command so instead of using that use hidesprite 0x2 and input a flag so the person wont appear again... :)
 

Boyd

Beginning Scripter
6
Posts
12
Years
  • Seen Oct 6, 2022
Hey everyone, I'm having a little problem with changing Text Color in FireRed.

It seems that whenever I introduce a color change in a line of text, it just mashes all other text in the script together whenever I run the game... For example:

Code:
#org 0x8007F2
= [green_fr][player][black_fr]: Huh? Who are you?\nWhere am I?

Will turn into:
Code:
#org 0x8007F2
= [green_fr][player][black_fr]: Huh? Who are you?\nWhere am[orange_fr]Stranger[black_fr]: Aha! Good you are\nfinally here!\pI don't have too much time to\nexplain, meet me further in the\lforest and all will soon be cle[green_fr][player][black_fr]: What a weird guy!\nI wonder what this place is...\pShould I follow him?\nI guess I have no other choice...

The other text is two completely seperate messages within the same script that just seems to be thrown into this when I compile, and the same thing happens for the other 2 messages. In-game it is just a complete mess of random text...

If anyone knows how to fix this, or why this error occurs, that would be greatly appreciated! :) I can also post the whole code if needed to clarify, but like I said this only happened when I added color, it originally worked fine.

Thanks! -Boyd

P.S. Wasn't sure if this should be in "Script Help" or here, since it's still a quick question so sorry if I chose the wrong spot!
 
Last edited:

tajaros

Hi I'm dawg
855
Posts
12
Years
Hey everyone, I'm having a little problem with changing Text Color in FireRed.

It seems that whenever I introduce a color change in a line of text, it just mashes all other text in the script together whenever I run the game... For example:

Code:
#org 0x8007F2
= [green_fr][player][black_fr]: Huh? Who are you?\nWhere am I?
Will turn into:
Code:
#org 0x8007F2
= [green_fr][player][black_fr]: Huh? Who are you?\nWhere am[orange_fr]Stranger[black_fr]: Aha! Good you are\nfinally here!\pI don't have too much time to\nexplain, meet me further in the\lforest and all will soon be cle[green_fr][player][black_fr]: What a weird guy!\nI wonder what this place is...\pShould I follow him?\nI guess I have no other choice...
The other text is two completely seperate messages within the same script that just seems to be thrown into this when I compile, and the same thing happens for the other 2 messages. In-game it is just a complete mess of random text...

If anyone knows how to fix this, or why this error occurs, that would be greatly appreciated! :) I can also post the whole code if needed to clarify, but like I said this only happened when I added color, it originally worked fine.

Thanks! -Boyd

P.S. Wasn't sure if this should be in "Script Help" or here, since it's still a quick question so sorry if I chose the wrong spot!

This happened to me alot of times....
Try repointing the offsets and see if it works.... :)
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Hey everyone, I'm having a little problem with changing Text Color in FireRed.

It seems that whenever I introduce a color change in a line of text, it just mashes all other text in the script together whenever I run the game... For example:

Code:
#org 0x8007F2
= [green_fr][player][black_fr]: Huh? Who are you?\nWhere am I?

Will turn into:
Code:
#org 0x8007F2
= [green_fr][player][black_fr]: Huh? Who are you?\nWhere am[orange_fr]Stranger[black_fr]: Aha! Good you are\nfinally here!\pI don't have too much time to\nexplain, meet me further in the\lforest and all will soon be cle[green_fr][player][black_fr]: What a weird guy!\nI wonder what this place is...\pShould I follow him?\nI guess I have no other choice...

The other text is two completely seperate messages within the same script that just seems to be thrown into this when I compile, and the same thing happens for the other 2 messages. In-game it is just a complete mess of random text...

If anyone knows how to fix this, or why this error occurs, that would be greatly appreciated! :) I can also post the whole code if needed to clarify, but like I said this only happened when I added color, it originally worked fine.

Thanks! -Boyd

P.S. Wasn't sure if this should be in "Script Help" or here, since it's still a quick question so sorry if I chose the wrong spot!

After inserting the scripts into your ROM, are you opening them through Advance Map and trying to edit them from there? That's what I believe you are doing, which isn't good practice and is the reason why your commands are becoming garbled.

You need to have dynamic pointers (@talk, @move etc.) rather than static pointers (0x8801199, 0x880115A etc.) which you receive when you open a script from Advance Map. If you are working with static pointers, like you have shown by posting your scripts here straight from being opened in Advance Map, then you can't make them longer at all - This is because XSE will automatically overwrite what ever data you have at the address that you have specified with static pointers. Here is an example of what I'm talking about:

Code:
#org 0x80004E
lockall
applymovement 0x1 0x8800064
waitmovement 0x1
msgbox 0x8800067 0x2
releaseall
end

#org 0x800064
#raw 0x11
#raw 0xFE

#org 0x800067
= Hello world!

In this fake script I have opened straight from Advance Map and cleaned up a little you see that I am using static pointers that tell me what offset parts of the script are assigned to. If I suddenly realised that the OW I'm moving needs to step upwards three more times and subsequently added three more 'raw 0x11's to his movements and then compiled the script again, this is what it would look like once I reload it:

Code:
#org 0x80004E
lockall
applymovement 0x1 0x8800064
waitmovement 0x1
msgbox 0x8800067 0x2
releaseall
end

#org 0x800064
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org 0x800067
= Ù\nllo world!

As you can see, the text in the message box has now been corrupted and is unusable, as the extra movement data that I added has overwritten three bytes of what was otherwise perfectly legible text. This is the problem with static offsets, you can't add any data that would otherwise expand the size of your script. It is good for quickly altering small things like changing values, variables used and stuff that won't lengthen your script, but it is otherwise improper for everyday scripting use.

Once you've finished writing a new script (with dynamic pointers, not static pointers from Advance Map), I would advise saving it as a .rbc file, which is as easy as going to 'File > Save As' and saving your script as you would any other program. This way you can open up your script in the future with your dynamic pointers already in place and reinsert it again if you need to lengthen it.
 

Boyd

Beginning Scripter
6
Posts
12
Years
  • Seen Oct 6, 2022
Oh okay yes I understand what you are saying, and Yeah as you can tell I'm a rookie :P

Thank you for your help in explaining this and for the quick reply, it makes sense as to why it wasn't working, it was driving me crazy! I've been trying to save the .rbc files as I go, so it shouldn't be too much trouble to fix it up. I'm just making a hack for the fun of it, and it's nice to have helpful people willing to give you a hand when you need it ;)

Thanks again!
- Boyd
 
1
Posts
11
Years
  • Seen Jul 11, 2012
Firstly, sorry for my bad grammar.

What the script to change the sprite of player during the game? Is it really possible?

Game: Fire Red

Thanks for helping.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Firstly, sorry for my bad grammar.

What the script to change the sprite of player during the game? Is it really possible?

Game: Fire Red

Thanks for helping.

Changing the sprite in FR needs ASM, or you can use a ROM patched with JPAN's FireRed Engine.
 
7
Posts
11
Years
  • Seen Jun 29, 2012
Game: Pokemon FireRed
Type: Movement
Editor: PKSV
Script:
Spoiler:


The issue here is that whenever I pass the script tile in game, it freezes. Am I missing something in the code or what?
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Game: Pokemon FireRed
Type: Movement
Editor: PKSV
Script:
Spoiler:


The issue here is that whenever I pass the script tile in game, it freezes. Am I missing something in the code or what?

Have you set the variable number as 4050 and the unknown as 3? In advance map.
 
21
Posts
11
Years
  • Seen Jul 26, 2012
Ok so I solved my original problems with my items, my flags were not reading so I had to 'remake' them, and have hit yet another snag hahaha.

When doing a pokemon battle for example Mewtwo when I defeat him he vanishes from map, if I run from the battle he vanishes from the map, but if I catch him then I can keep catching him... How do I fix this?

Copy of battle script:

#org 0x87405E5
'-----------------------------------
special INIT_STEPCOUNT
compare LASTRESULT 0x2
if == jump 0x81A7AE0 ' Equal To
special GET_STEPCOUNT
lock
faceplayer
checksound
cry MEWTWO 0x2
waitcry
pause 0x14
playsound 0x2 0x2
battle MEWTWO 5 NONE
setflag 0x807
special BATTLE_PIXELLATE
waitspecial
clearflag 0x807
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if == jump 0x8162558 ' Equal To
compare LASTRESULT 0x4
if == jump 0x8162561 ' Equal To
compare LASTRESULT 0x5
if == jump 0x8162561 ' Equal To
setflag 0x81
release
end

#org 0x81A7AE0
'-----------------------------------
release
end

#org 0x8162558
'-----------------------------------
setflag 0x232
jump 0x81A922D

#org 0x81A922D
'-----------------------------------
fadescreen FADEOUT_BLACK
disappear LASTTALKED
fadescreen FADEIN_BLACK
release
end

#org 0x8162561
'-----------------------------------
setvar 0x8004 0x96
jump 0x81A9236

#org 0x81A9236
'-----------------------------------
fadescreen FADEOUT_BLACK
disappear LASTTALKED
fadescreen FADEIN_BLACK
storepokemon 0x0 0x8004
msgbox 0x81A63C4 ' The \v\h02 flew away...
callstd MSG_NOCLOSE ' Non-closing message
release
' Release commands close any open messages
end


#org 0x81A63C4
= The \v\h02 flew away!
 

Boyd

Beginning Scripter
6
Posts
12
Years
  • Seen Oct 6, 2022
When doing a pokemon battle for example Mewtwo when I defeat him he vanishes from map, if I run from the battle he vanishes from the map, but if I catch him then I can keep catching him... How do I fix this?

Hey there, so I'm a beginner as well but I figured I could give some feedback and maybe help you get your problem fixed... I noticed that you Set and Clear flag 0x807 before then after the battle it looks like? What should happen (same goes for items) is that you set a flag before, and in Advance Map use that same flag number as the "Person ID" of that event, that way when the flag becomes set the event will no longer appear!

So to me it looks like you clear the flag to keep him there. I use XSE so some of this unfamiliar to me, but what you want to do is "hide" Mewtwo after the battle as well. Even if you set the flag but he is still onscreen, the event can continue. If you leave and come back to the area as of now, he will probably still show up...

Anyways, hope this wasn't too confusing and possibly solved your problem! Maybe someone who knows more about scripting will look at it and can help you out! By the way, I sent you a PM a few days ago in regards to your items problem >_>

Best of Luck!
-Boyd
 

Renegade

Time for real life...
995
Posts
12
Years
Hello. There is a problem in this script that I don't understand.

At the end of the script. When applymovement @m5 and @m6 are activated, they begin the way they are supposed to but when sprite 6 (on applymovement @m5) starts walking, he disappears almost immediately and the script ends. He is supposed to finish his movement script before disappearing.

I have a "waitmovement 0x0" command after the applymovement @m5 and @m6, so I don't understand why the sprite is disappearing before the "waitmovement 0x0" command.

Help please?

Code:
#dynamic 0x800020

#org @start
lock
applymovement 6 @m1
waitmovement 0x0
pause 0x10
applymovement 6 @m2
waitmovement 0x0
applymovement 0xFF @m3
applymovement 6 @m4
waitmovement 0x0
textcolor 0x0
message @t1 6
applymovement 6 @m5
applymovement 0xFF @m6
waitmovement 0x0
hidesprite 0x06
setflag 0x800
setvar 0x5000 0x1
release
end

#org @m6
#raw 0x0
#raw 0xFE

#org @m5
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @t1
= Mail Man: \v\h01, your mail\nis here!

#org @m4
#raw 0x13
#raw 0xFE

#org @m3
#raw 0x2
#raw 0xFE

#org @m2
#raw 0x22
#raw 0x22
#raw 0x3
#raw 0x62
#raw 0xFE

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

Thanks guys.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Hello. There is a problem in this script that I don't understand.

At the end of the script. When applymovement @m5 and @m6 are activated, they begin the way they are supposed to but when sprite 6 (on applymovement @m5) starts walking, he disappears almost immediately and the script ends. He is supposed to finish his movement script before disappearing.

I have a "waitmovement 0x0" command after the applymovement @m5 and @m6, so I don't understand why the sprite is disappearing before the "waitmovement 0x0" command.

Help please?

Code:
#dynamic 0x800020

#org @start
lock
applymovement 6 @m1
waitmovement 0x0
pause 0x10
applymovement 6 @m2
waitmovement 0x0
applymovement 0xFF @m3
applymovement 6 @m4
waitmovement 0x0
textcolor 0x0
message @t1 6
applymovement 6 @m5
applymovement 0xFF @m6
waitmovement 0x0
hidesprite 0x06
setflag 0x800
setvar 0x5000 0x1
release
end

#org @m6
#raw 0x0
#raw 0xFE

#org @m5
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @t1
= Mail Man: \v\h01, your mail\nis here!

#org @m4
#raw 0x13
#raw 0xFE

#org @m3
#raw 0x2
#raw 0xFE

#org @m2
#raw 0x22
#raw 0x22
#raw 0x3
#raw 0x62
#raw 0xFE

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

Thanks guys.

waitmovement 0x0 mean it waits any applymovement to finish, since @m6 is shorter the script continues after that one.. The easiest way to have them run in tandem would be to change it to pause 0x__ and fiddle with value.
 

Renegade

Time for real life...
995
Posts
12
Years


waitmovement 0x0 mean it waits any applymovement to finish, since @m6 is shorter the script continues after that one.. The easiest way to have them run in tandem would be to change it to pause 0x__ and fiddle with value.

Ah, I understand. Okay, thanks for your help!
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
Just wondering, would it be possible to use the same applymovement offset for multiple NPCs? Or does each one need it's own offset for it?

Edit: I'm also having an issue with compiling right now that I can't seem to figure out. Details on it below.

Game: Pokemon Firered
Type: Trigger
Editor: XSE
Script:
Spoiler:

Details: When I go to compile this, no errors pop up. But, when I close the window and open up the script again, the compiler gets rid of the second fadescreen for some reason. I have no idea why, and I've been unable to find out why this is happening by using google. :/
 
Last edited:
Status
Not open for further replies.
Back
Top