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

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Lol, I do the same thing every other script, np.

I'm going to repost this question one last time. Does anyone know a command to display a trainer sprite, or just a general showpic command that will show the picture at a certain offset (aside from showpokepic)?
 

Capitalist Ness

can't stump the trump
69
Posts
15
Years
Does anybody know, what's the command for making sprite visible, after defeating the league? Im hacking Emerald.
I want to make the Wildbattle of Celebi, that's available after defeating Pokemon League. I know how to make the wildbattle but i don't know what's the command and where to put it.
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
To show a sprite, use the "showsprite" command, then clear whatever flag has been set to hide the sprite.
For instance:

showsprite 0x01
clearflag 0x0053
wildbattle...
I'm afraid I don't know enough about Emerald hacking to tell you anything specific about what you're attempting.
 

Resultz

All- round Poke-Whizz
583
Posts
14
Years
Hey i was just wndering where i went wrong with this trainerbattle script:
The sprite 'sees' me then runs to me, but then the screen just goes red and it crashes.
the script:
Code:
#Dynamic 0x21F202
#org 0x21F202
trainerbattle 0x0 0x002 0x0 0x821F115 0x821F1B2
msgbox 0x821F1E4 MSG_NORMAL '"Im not telling you anything!"
release
end


'---------
' Strings
'---------
#org 0x21F115
= What are you doing here, kid? \nThis town is ours \l and you can't take it back! \lNow run off home! \p.... \p.... \nWhat, you're still here? \lyou'll regret it!

#org 0x21F1B2
= We're team rage, We have \nstrength in numbers!

#org 0x21F1E4
= Im not telling you anything!

Im just wondering if its not the script if theres anything i couldve done wrong when inserting/compiling it.

I did another today which wors perfectly.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Hey i was just wndering where i went wrong with this trainerbattle script:
The sprite 'sees' me then runs to me, but then the screen just goes red and it crashes.
the script:
Code:
#Dynamic 0x21F202
#org 0x21F202
trainerbattle 0x0 0x002 0x0 0x821F115 0x821F1B2
msgbox 0x821F1E4 MSG_NORMAL '"Im not telling you anything!"
release
end


'---------
' Strings
'---------
#org 0x21F115
= What are you doing here, kid? \nThis town is ours \l and you can't take it back! \lNow run off home! \p.... \p.... \nWhat, you're still here? \lyou'll regret it!

#org 0x21F1B2
= We're team rage, We have \nstrength in numbers!

#org 0x21F1E4
= Im not telling you anything!

Im just wondering if its not the script if theres anything i couldve done wrong when inserting/compiling it.

I did another today which wors perfectly.

My guess is that the trainer ID that you used isn't valid. Try something other than '0x0002'.
On a separate note, why did you use the "dynamic" preprocessing directive if you didn't use any dynamic offsets? Unless, of course, this is a decompiled script.
 

Resultz

All- round Poke-Whizz
583
Posts
14
Years
@Colcolstyles, the truth is i'm new to scripting, so i was following what i'd seen with that respect.

Ive had a bit of a look myself and found out that that doesnt appear to be the problem.
the problem seems that whenever i batch compile a script in XSE, regardless of the different start offsets, each of the people i'm trying to change have exactly the same strings. i.e i'll compile one trainerbattle, and everyone of the 3 ive attempted today all appear to have been assigned the same strings, despite being different in battle.
then ill compile another, and the same thing happens, they all go on that script..

and with the dynamic offsets thing, what exactly do you mean?

im getting really quite confused here.
-when i open the script, do i have to open it with the rom in xse (have both the saved script and the rom in the top left box?
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
@Colcolstyles, the truth is i'm new to scripting, so i was following what i'd seen with that respect.

Ive had a bit of a look myself and found out that that doesnt appear to be the problem.
the problem seems that whenever i batch compile a script in XSE, regardless of the different start offsets, each of the people i'm trying to change have exactly the same strings. i.e i'll compile one trainerbattle, and everyone of the 3 ive attempted today all appear to have been assigned the same strings, despite being different in battle.
then ill compile another, and the same thing happens, they all go on that script..

and with the dynamic offsets thing, what exactly do you mean?

im getting really quite confused here.
-when i open the script, do i have to open it with the rom in xse (have both the saved script and the rom in the top left box?

Some explanations:

The #dynamic command is only used to locate an offset for you. If you have an offset already picked out, you don't need it. For instance:

Code:
#dynamic 0x800000
#org @start
msgbox @go msg_face
end

^ A simple script. The @start is a "blank" offset. The #dynamic command is saying to search for some free space for your script starting at offset 0x800000 (which is a good place to do it - I would not recommend inserting scripts at offsets in the 200000 or anywhere before 0x700000, because the game stores crucial data there, and if you accidentally overwrite it, you'll screw up the rom).

Now, if you happen to have an offset already picked out with enough space for your script, you'd just write:

Code:
#org 0x800000
msgbox @go msg_face
end

If the game is crashing, you might have written over some important data or something - I just checked what's there at those offsets - it's only a bunch of zeros, but those could be significant. You only want to overwrite FFs. An FF byte is free space, not 00.

I would get a new rom, and try compiling your script like this:

Code:
#dynamic 0x800000
#org @start
trainerbattle 0x0 0x002 0x0 @go @end
msgbox @final MSG_NORMAL '"Im not telling you anything!"
release
end


'---------
' Strings
'---------
#org @go
= What are you doing here, kid? \nThis town is ours \l and you can't take it back! \lNow run off home! \p.... \p.... \nWhat, you're still here? \lyou'll regret it!

#org @end
= We're team rage, We have \nstrength in numbers!

#org @final
= Im not telling you anything!
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Your explanation is good for the most part but I have a few nitpicks.

Now, if you happen to have an offset already picked out with enough space for your script, you'd just write:

Code:
#org 0x800000
msgbox @go msg_face
end

In this script, you use a dynamic offset ("@go") but you don't use the "dynamic" preprocessing directive. The script would look more like this:

Code:
#org 0x800000
msgbox 0x8740020 MSG_FACE
end

#org 0x740020
= Text goes here.

I included the '8' as part of the address of the text because that's how XSE displays addresses when you decompile a script. It's unnecessary when you're compiling.

If the game is crashing, you might have written over some important data or something - I just checked what's there at those offsets - it's only a bunch of zeros, but those could be significant. You only want to overwrite FFs. An FF byte is free space, not 00.

Keep in mind that '0x00' is considered "free space" in R/S/E. Although by definition, free space could be any value. "Free space" is just a section of a ROM that is not accessed by the unedited game or data that, if changed, would not affect the flow of the game at all unless changes to non free space were made. Well, at least that's how I would define it. :P
 
79
Posts
13
Years
  • Seen Aug 27, 2014
Question, im trying to make a script where four team rocket grunts walk simultaneously how would i go about that?
 
2
Posts
13
Years
  • Seen Nov 28, 2010
Question, im trying to make a script where four team rocket grunts walk simultaneously how would i go about that?
Just put 4 applymovement scripts next to each other. Then a waitmovement 0x0 underneath, unless you want the script to carry on while they're still moving.

I'm having trouble with a givepokemon script (surprise, surprise).
Using XSE 1.1.1 and Advance Map 1.92, and it's a Person Event (a pokeball) in Fire Red.

Here's the script I put in:
Spoiler:


Then after I compile it, close the script and open it again, this pops out:

Spoiler:


Bolded the important bits.
Basically, XSE deletes some of it and changes one of the givepokemon commands, and I can't work out why.

Any ideas?
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Keep in mind that '0x00' is considered "free space" in R/S/E. Although by definition, free space could be any value. "Free space" is just a section of a ROM that is not accessed by the unedited game or data that, if changed, would not affect the flow of the game at all unless changes to non free space were made. Well, at least that's how I would define it. :P

I didn't know that about R/S/E. Does XSE only search for FFs though anyway when looking for free space?

To me, though, it's easier just to think of FF as a free space byte. Wouldn't R/S/E even use 00, say in the images, like the sprites? But you're right, because you can replace most of the scripts that are in the game and have no problems, though I wouldn't consider that free space - maybe unimportant space. Free space (or replacing FF bytes) is just easier/safer, as I learned from experience.


Just put 4 applymovement scripts next to each other. Then a waitmovement 0x0 underneath, unless you want the script to carry on while they're still moving.

I'm having trouble with a givepokemon script (surprise, surprise).
Using XSE 1.1.1 and Advance Map 1.92, and it's a Person Event (a pokeball) in Fire Red.

Here's the script I put in:
Spoiler:


Then after I compile it, close the script and open it again, this pops out:

Spoiler:


Bolded the important bits.
Basically, XSE deletes some of it and changes one of the givepokemon commands, and I can't work out why.

Any ideas?

Yes, the offset you used for the givepokemon script doesn't have enough space after it. Pretty much, there is a script a few bytes away from the offset that you're using, and XSE is melding the new script with the old one. Just try another dynamic offset - changes in first spoiler in bold.
 

Resultz

All- round Poke-Whizz
583
Posts
14
Years
ah riht, thanks for that, i appreciate you guys going into so much detail for me.
so its safer to use offsets after 800000, how many approx is there after 800000?

and does anyone know what might be causing the string duplication?
 

KotovSyndrome_

Consumer of many asparagus.
57
Posts
15
Years
ah riht, thanks for that, i appreciate you guys going into so much detail for me.
so its safer to use offsets after 800000, how many approx is there after 800000?

and does anyone know what might be causing the string duplication?

Hundreds.. of thousands.
I wouldn't worry about running out or anything, and even if you do, you can double the ROM size with a ROM Expander.

I don't know about the string duplication sorry. :/
 
Last edited:

Andrut

Collecting dust since 1898
284
Posts
14
Years
I'm hacking Emerald. I have a problem with the Lavaridge Egg script. I want to swap Wynaut with Celebi. When i calculated the Hex Number of Celebi,i was surprised,because it came up with "FB". Then i swap the "164" with "0FB" and XSE cuts a part of it. When i test it it cames up with:
Option 1) The woman just doesn't give me the egg and says something about Day Care
Option 2) When i enter the map where the woman was by a warp, there is a sound "Tootootoodae" when you receive the item,and the screen is all black.
Script:
Spoiler:

I try to type the FB except 168, but XSE returns to the previous number. O_o
EDIT: Wait,it works with Mew. I'll try Celebi.
 
Last edited:

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I'm hacking Emerald. I have a problem with the Lavaridge Egg script. I want to swap Wynaut with Celebi. When i calculated the Hex Number of Celebi,i was surprised,because it came up with "FB". Then i swap the "164" with "0FB" and XSE cuts a part of it. When i test it it cames up with:
Option 1) The woman just doesn't give me the egg and says something about Day Care
Option 2) When i enter the map where the woman was by a warp, there is a sound "Tootootoodae" when you receive the item,and the screen is all black.
Script:
Spoiler:

I try to type the FB except 168, but XSE returns to the previous number. O_o

Since you are using a HEX number you have to use the prefix 0x.

For instance...
0xFB would be Celebi's number.
 

Andrut

Collecting dust since 1898
284
Posts
14
Years
I've wrote the OxFB,properly saved it but i move it to another location.The woman says things she says after giving the egg. >_< Should i put something more than the Script Offset to the new map?
EDIT: I surrender. This script drives me mad. T_T
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I've wrote the OxFB,properly saved it but i move it to another location.The woman says things she says after giving the egg. >_< Should i put something more than the Script Offset to the new map?
EDIT: I surrender. This script drives me mad. T_T

Are you saving the game after you test the script? Because it seems like the flag for that script is set. If you look in the first part of the script, there is a "checkflag 0x10A" command. When flag 10A is set, it will take you to the after message for receiving the egg. You can see that the "setflag 0x10A" command is near the end of the first script, after you receive the egg. Once you receive the egg, the script will always go to that message because that flag is set.

Now, if the problem is not that you've set that particular flag, then I'm not sure what the problem is.
 

Andrut

Collecting dust since 1898
284
Posts
14
Years
I don't know to do with that script. I'll just surrender,because this script does weird things like making the egg never hatch when i changed Celebi's steps to hatching to 60.
And yes, how can i change Mew's level in Faraway Island?
I think it is:
Spoiler:

but i just want to be sure...
 
Status
Not open for further replies.
Back
Top