• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Mortalis

[css-div="background-color:#4e9dda;text-align:cent
345
Posts
13
Years
Okay, firstly, I'd use 0x800000 for my offset. Not that what you have is unsafe or anything, it's just that you're skipping quite a bit of free space there. Also, it'd probably be better to get rid of lock, faceplayer and release, and simply replace msgbox @hello 0x6 to msgbox @hello 0x2 for a plain NPC script.

Anyway, onto your problem. Are you sure you've pasted the offset you receive from XSE when you hit compile next to the @start box and pasted it into the Script Offset box when you select the person event, and saved afterwards?

Alright, will do. Thanks.
Oh, that's probably what I'm doing wrong. Thanks, I'll go try that now. Didn't know I had to copy + past anything.
 
26
Posts
13
Years
  • Seen Nov 24, 2010
For some reason if you click yes, then it gives you the message you would get for no. No matter what I click whether its Yes or No, it always gives me the message for no. The script I'm using is this one from destinedjagold.


Try this script...
Code:
#dynamic 0x18D300

#org @start
lock
faceplayer
checkflag 0x1210
if 0x01 goto @after
textcolor 0x00
msgbox @pie 0x5
if 0x1 goto [COLOR=Red]@okay[/COLOR]
if 0x0 goto @dont
release
end

#org @pie
= Do you want to know the operation?

#org @dont
textcolor 0x00
msgbox @idk 0x5
if 0x1 goto [COLOR=Red]@sure[/COLOR]
if 0x0 goto [COLOR=Red]@out[/COLOR]
release
end

#org @idk
= You already know? Then do you want\nto know how to leave from the\lnorth or east?

[COLOR=Red]#org @sure
message @well 0x6
release
end[/COLOR]

#org @well
= Well you can't leave from the\neast, but you can leave from the\lnorth if I give you an item to\lshow to the guard.

[COLOR=Red]#org @out
message @good 0x6
release
end[/COLOR]

#org @good
= Good you know everything. Now get\nback to work soldier!
[COLOR=Red]
#org @okay
message @op 0x6
release
end[/COLOR]

#org @op
= Our Operation is to invade\nViridian City, but there's this\llittle punk that's stopping us.\lHer name is May and she defended\lagainst Magma and Aqua in Hoenn\land she's ready to defend Kanto.\pBeat her and I will allow you to\nleave this god forsaken place.

#org @after
msgbox @shoes1 0x6
fanfare 0x13E
textcolor 0x01
msgbox @shoes 0x4
waitfanfare
setflag 0x82F
textcolor 0x00
msgbox @sweet 0x2
end

#org @shoes1 
= Good job soldier!\pFor your service, I'll give you\n an item\lto show to the guard. They're\lspecially made from our crafter,\lColonel Raysie!

#org @shoes
= \v\h01 recieved the running shoes!

#org @sweet
= Now get your pokemon ready for\nPumpkin City!
 

Teh Blazer

Divider of Zero
776
Posts
15
Years
Quick question here: How does one use the [buffer] command? What is it used for and how do you personally use it?
 

colcolstyles

Yours truly
1,588
Posts
15
Years
For some reason if you click yes, then it gives you the message you would get for no. No matter what I click whether its Yes or No, it always gives me the message for no. The script I'm using is this one from destinedjagold.

Try this (changes in blue):
Code:
#dynamic 0x18D300

#org @start
lock
faceplayer
checkflag 0x1210
if 0x01 goto @after
textcolor 0x00
msgbox @pie 0x5
[COLOR="blue"]compare LASTRESULT B_TRUE[/COLOR]
if 0x1 goto [COLOR="Red"]@okay[/COLOR]
[COLOR="blue"]compare LASTRESULT B_FALSE[/COLOR]
if 0x1 goto @dont
release
end

#org @pie
= Do you want to know the operation?

#org @dont
textcolor 0x00
msgbox @idk 0x5
[COLOR="blue"]compare LASTRESULT B_TRUE[/COLOR]
if 0x1 goto [COLOR="Red"]@sure[/COLOR]
[COLOR="blue"]compare LASTRESULT B_FALSE[/COLOR]
if 0x1 goto [COLOR="Red"]@out[/COLOR]
release
end

#org @idk
= You already know? Then do you want\nto know how to leave from the\lnorth or east?

[COLOR="Red"]#org @sure
message @well 0x6
release
end[/COLOR]

#org @well
= Well you can't leave from the\neast, but you can leave from the\lnorth if I give you an item to\lshow to the guard.

[COLOR="Red"]#org @out
message @good 0x6
release
end[/COLOR]

#org @good
= Good you know everything. Now get\nback to work soldier!
[COLOR="Red"]
#org @okay
message @op 0x6
release
end[/COLOR]

#org @op
= Our Operation is to invade\nViridian City, but there's this\llittle punk that's stopping us.\lHer name is May and she defended\lagainst Magma and Aqua in Hoenn\land she's ready to defend Kanto.\pBeat her and I will allow you to\nleave this god forsaken place.

#org @after
msgbox @shoes1 0x6
fanfare 0x13E
textcolor 0x01
msgbox @shoes 0x4
waitfanfare
setflag 0x82F
textcolor 0x00
msgbox @sweet 0x2
end

#org @shoes1 
= Good job soldier!\pFor your service, I'll give you\n an item\lto show to the guard. They're\lspecially made from our crafter,\lColonel Raysie!

#org @shoes
= \v\h01 recieved the running shoes!

#org @sweet
= Now get your pokemon ready for\nPumpkin City!

Quick question here: How does one use the [buffer] command? What is it used for and how do you personally use it?

Depends on what, exactly, you're buffering. You can buffer the names of pokémon, attacks, even your own custom strings. There are a number of commands associated with the buffers (such as bufferpokemon, bufferitem, bufferstring, etc.). The one that you use depends on the contents of the buffer. The commands exist to improve the efficiency of your scripts. For example, instead of the following code:

Code:
...
// 0x5000 contains the ID number of the player's starter
compare 0x5000 PKMN_BULBASAUR
if 0x1 goto @bulbasaur
compare 0x5000 PKMN_CHARMANDER
if 0x1 goto @charmander
compare 0x5000 PKMN_SQUIRTLE
if 0x1 goto @squirtle

...

#org @bulbasaur
msgbox @bulbatext 0x4

...

#org @charmander
msgbox @chartext 0x4

...

#org @squirtle
msgbox @squirtext 0x4

...

#org @bulbatext
= Your BULBASAUR is so cute!

#org @chartext
= Your CHARMANDER is so cute!

#org @squirtext
= Your SQUIRTLE is so cute!
...

... you could use something like this:

Code:
...
// 0x5000 contains the ID number of the player's starter
bufferpokemon 0x0 0x5000    // Stores the number in 0x5000 into buffer1
msgbox @text 0x4
...

#org @text
= Your [buffer1] is so cute!
...

Isn't that just so much easier? :)
 

Orinjmate

The Orinj of the Mate
120
Posts
13
Years
I'm not sure if it's because I used Chaos Rush's Emerald Clean-Up Patch but none of my scripts work... I've tried compiling them onto different offsets.
Here is one of the scripts:-
Spoiler:
 

Mortalis

[css-div="background-color:#4e9dda;text-align:cent
345
Posts
13
Years
Alright, I'm still having problems with a basic script;

The script I'm writing;

#dynamic 0x800000

#org @start
msgbox @hellothere 0x2
release
end

#org @hellothere
= Hello. This doesn't\nwork.
So, I write that script in XSE after setting up the sprite & such in Advanced Map. After I click compile, I copy the @start offset and paste it to the sprite's offset on Advanced Map. I then save on Advanced Map and go to test it out on the rom.

My problem is that when I approach the character in game, I click 'A' and all it does is make that 'bing' noise. Help?
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Alright, I'm still having problems with a basic script;

The script I'm writing;

So, I write that script in XSE after setting up the sprite & such in Advanced Map. After I click compile, I copy the @start offset and paste it to the sprite's offset on Advanced Map. I then save on Advanced Map and go to test it out on the rom.

My problem is that when I approach the character in game, I click 'A' and all it does is make that 'bing' noise. Help?

The script looks fine (though the 'release' command is redundant) so the problem probably lies elsewhere. However, your whole process seems solid to me. Are you sure that you're testing the same ROM that you have open in AdvanceMap and XSE (and that you have the same ROM open in both)?
 

Mortalis

[css-div="background-color:#4e9dda;text-align:cent
345
Posts
13
Years
The script looks fine (though the 'release' command is redundant) so the problem probably lies elsewhere. However, your whole process seems solid to me. Are you sure that you're testing the same ROM that you have open in AdvanceMap and XSE (and that you have the same ROM open in both)?

I did play on the same rom, but I found the problem. It's weird, because what I used should have worked. I just inserted a 'callstd 0x2' instead of 'msgbox @hello 0x2'. It's weird, because using msgbox with 0x2 should have worked but ... guess not.

Thanks though.
 
63
Posts
13
Years
  • Seen Dec 6, 2023
Okay, I've got some problem with setting rematches in Emerald
Every rematch uses this style of coomand
Code:
trainerbattle 0x2 0xB7 0x0 0x829B449 0x829B480 0x81F2A33
special2 LASTRESULT 0x3C
compare LASTRESULT 0x1
if 0x1 goto 0x81F2A52
[...]
#org 0x1F2A52
trainerbattle 0x5 0xB7 0x0 0x829B547 0x829B59D
okay, 0x2 is the kind of battle (doesn't matter here, 0x2 is for a common trainer that allows 3 pointers instead of the usual 2 from 0x0), 0xB7 is the battle ID, 0x0 as filler (every battle has it[?]) then the 3 pointers are the @before, @after and @later
then we've got the special2, which I don't know how it works, which points somewhere else.
The adress it goes to has a 0x5 (rematch), but calls the same battle as the first one. However, it calls one of the later battles (in this example, 0xB8, 0xB9, 0xBA or 0xBB).

Can someone give me a hand this time? As you may see, there are 4 battles here, which goes in order (there is some check, somewhere, that calls the first rematch avaliable, or repeat the last one if all of them were already used.) What I want to do is change these battles, for adding rematch trainers, and removing rematches from some (like, one common trainer with a single rematch, and gym leaders with more than the usual four).
in short: what does special2 0x3c do, and how to change it?
 
26
Posts
13
Years
  • Seen Nov 24, 2010
I have a question about a script...In my town I want to have a script box that makes you go to a Rocket and then you say Yes or No to whether you want to proceed. Simple enough. What I'm wondering about though is that the camera will shift to the protest, which I'm fine with, but then I want to have different people talking such as "Woo!" "Yeah" after each other with May continuously preaching. Its not like I want them all on the same screen at once, but I want to know how the script will work, like if I have to make different offsets for each person, etc.
 

Draknir

The God of Fire
121
Posts
15
Years
I am having trouble with making a script that gives a Jirachi Egg in Emerald.

This is the script as I have put it in:
Spoiler:


But this is what the script shows when I reopen it using Advance Map
Spoiler:


So exactly where am I screwing up?
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I have a question about a script...In my town I want to have a script box that makes you go to a Rocket and then you say Yes or No to whether you want to proceed. Simple enough. What I'm wondering about though is that the camera will shift to the protest, which I'm fine with, but then I want to have different people talking such as "Woo!" "Yeah" after each other with May continuously preaching. Its not like I want them all on the same screen at once, but I want to know how the script will work, like if I have to make different offsets for each person, etc.

Since it is just a single continuous script you don't need to have offsets for the protesting people (If you're not going to be speaking to them afterwards like any other regular person). If I'm imagining it as you describe it, you will have everything on the one script and you won't be able to use or interact with any others.

You can't have two people talking at the same time from different text boxes, so if you want someone preaching and the crowd applauding or whatever, you will have to interweave the speech and the audience in the script, which isn't very hard - Think about recieving your Pokemon from Professor Oak and how your rival and the professor are talking to each other in the same script, and are unable to speak at the same time as the other.
 

Draknir

The God of Fire
121
Posts
15
Years
Yes I have, and it only shows bits and pieces of it. The Jirachi Egg is added to the party, but then the event is repeatable.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I am having trouble with making a script that gives a Jirachi Egg in Emerald.

This is the script as I have put it in:
Spoiler:


But this is what the script shows when I reopen it using Advance Map
Spoiler:


So exactly where am I screwing up?

While I work with XSE, the random line '\h6A\h5A\h0F \h91\h0D\h9C\h08\h09\h06\h6C\h02\h6A\h5A\h0F \h25y\h8A\h08\h09\h06\h6C\h02 \h01 \h403 \h8A\h12' is most likely there because your script was incorrectly inserted/ edited and is now conflicting with the data of the ROM or another script.

Yes I have, and it only shows bits and pieces of it. The Jirachi Egg is added to the party, but then the event is repeatable.

You've got the command 'checkflag 0x200' in the @code2 part of your script, but I can't see where you have set that flag in the script. Even if you did have the flag set, it would display the 'Excuse me.\nI found this egg' text before you reached the checkflag command, which would be really strange.

Anyway, the script should look more like this:

Code:
#dyn 0x740000
#org @start
lock
faceplayer
[B][COLOR=red]checkflag 0x200[/COLOR][/B]
[B][COLOR=red]if 0x1 jump @end[/COLOR][/B]
msgbox @text ' Excuse me.\nI found...
callstd MSG_YESNO
...
 
#org @code2
lock
[B][COLOR=red]setflag 0x200[/COLOR][/B]
giveegg Jirachi
countpokemon
 
26
Posts
13
Years
  • Seen Nov 24, 2010
I made this script below, where the person walks over to you and gives you the pokemon. I tested it and everything works fine except that when it asks you if you want to nickname it, it goes to the nickname part and it says Charmander instead of Snubbull and it has the Charmander sprite. It only gives you the option to nickname the first pokemon in your party I think, in my case Charmander. How do I fix this?

Game: FireRed
Type: Trigger
Editor: XSE
Script:
Spoiler:
 
Last edited:

colcolstyles

Yours truly
1,588
Posts
15
Years
I made this script below, where the person walks over to you and gives you the pokemon. I tested it and everything works fine except that when it asks you if you want to nickname it, it goes to the nickname part and it says Charmander instead of Snubbull and it has the Charmander sprite. It only gives you the option to nickname the first pokemon in your party I think, in my case Charmander. How do I fix this?

Game: FireRed
Type: Trigger
Editor: XSE
Script:
Spoiler:

The pokémon that is displayed on the nicknaming screen is dependent on the value stored in variable '0x8004'. Try inserting this right before calling the nicknaming function:

Code:
countpokemon
subvar LASTRESULT 0x1
copyvar 0x8004 LASTRESULT
 
Status
Not open for further replies.
Back
Top