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

itman

Back to ROM hacking. :D
98
Posts
16
Years
  • Age 30
  • Seen Feb 5, 2014
#dynamic 0x800000

#org @start
applymovement 0x04 @move
waitmovement 0x0
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x5
compare LASTRESULT 0x1
if 0x1 goto @take
msgbox @2 0x6
checkflag 0x828
if 0x1 goto @start
release
end

#org @take
givepokemon 0x84 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
setflag 0x829
msgbox @6 0x6
msgbox @7 0x6
fadescreen 0x1
hidesprite 0x800F
fadescreen 0x0
setflag 0x8A0
release
end

#org @name
call 0x1A74EB
return

#org @done
release
end

#org @move
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org @1
= Hello.\nI am Proffessor Riley.\nyour pokemon was transfere from\nKanto..\pSo I am here to give it to you\nWill you take it?

#org @2
= You don't want you pokemon?

#org @3
= [black_fr]You received a DITTO!

#org @4
= [black_fr]Would you like to give a\nnickname to DITTO?

#org @5
= I also have a pokedex for you.

#org @6
= [black_fr]You received the Pokedex.

#org @7
= Your brother had sent a\npackage for you, although\lit appears to have ended up in\nResno town.\pYou may want to go fetch it.



I compile it and insert it, as i walk on the script nothing happens. did i miss something?

In A-map, click the script tile itself. Try changing the properties to this:
Unknown: 0003
Var number: 4052
 
10
Posts
11
Years
  • Seen Jul 9, 2014
I'm hacking FR, I copied the Old Man script (I'm using PKSV) to block you if you don't have a Pokedex and changed it a tiny bit, compiled it and now the game freezes when I trigger it.

#org 0x88005DC
'-----------------------------------
lockall
textcolor BLUE
msgbox 0x817DD03 ' I absolutely forbid ...
callstd MSG_NOCLOSE ' Non-closing message
closemsg
applymovement PLAYER 0x8165B0E ' walk_left end
pauseevent 0x0
releaseall
end


#org 0x817DD03
= I absolutely forbid you from\ngoing through here!\pThis is private property!

#org 0x8165B0E
M walk_left end


Are there any problems in the script?
Edit- If I set the variable number to the same as in the original FR/LG nothing happens when I trip it.
 
9
Posts
13
Years
  • Seen Dec 28, 2012
I'm not sure why but my I was practicing with a level script but I keep running to an error. The script plays just fine, the camera moves up three spots then down three spots, the issue comes up that whenever I enter the map, the script continues to run even though the variable (x4000) has been set to x01 and it should only run when its x00. I have another script on the map that also only runs when x4000 is equal to x00 and it doesn't run after the level script has been triggered so I'm not sure what exactly the error is since the variable is being set but the script runs again anyways.

Spoiler:


Edit: Found the answer reading through a level script thread, x4000 is always reset when you exit the map =p
 
Last edited:

AllyJacqui

The one and only -
67
Posts
11
Years
Okay, before i get judged. I'm trying to make the switch between Pokescript and XSE, but I wanted to finsih off a few scripts I started in Pokescript, and I ran into this one:

Spoiler:


Now, this works fine. Up until the end where it gives me a bunch of garbled mess. Aparently, the problem is common. But since I have NO knowledge of XSE, I have no idea where to get the offset after I decompile it, or where to put it. :/
Here's the decompiled version, if that's needed too.

Spoiler:


Please keep in mind I have NO knowledge of XSE, and this is literally the first time I've used it. Where do I get the offset after I decompiled? There's like ten 'newoffset' s and then, where do I put it? Under the advanced Header? Or on the script block? Both? Help? D":
 

Sudeki

Can you feel it?
322
Posts
14
Years
Are you trying to do that in XSE or Pokescript? Because it doesn't seem to be like a XSE script. And for where you put the script well that depends on how you want the script to be used. Are you wanting it to fire when you talk to a person? When you walk on a tile? When you enter a room? Although it looks as if you are wanting it to fire off as you enter the room. To fix that garbled text mess after the level script ends. You will need to do this to fix it :


Open the map in Advancemap, Go to the header tab. Make sure the "Professional Header view" is on. Then find the section for "Map Script offset", Take that offset put it in XSE click the "Level Script" button, and press decompile. Then look for where your variable is, I'm assuming you are using 5000 so find that. And you will see that advancemap changed it to "FFFF" simply change that FFFF to 0 and compile again.


If you are indeed trying to make an XSE scripts and such you can send me a PM and I will try to answer any questions you might have with it, instead of potentially flooding this thread with lots of posts.
 

AllyJacqui

The one and only -
67
Posts
11
Years
Are you trying to do that in XSE or Pokescript? Because it doesn't seem to be like a XSE script.
I wrote it in Pokescript, and I had to decompile it in XSE.

Open the map in Advancemap, Go to the header tab. Make sure the "Professional Header view" is on. Then find the section for "Map Script offset", Take that offset put it in XSE click the "Level Script" button, and press decompile. Then look for where your variable is, I'm assuming you are using 5000 so find that. And you will see that advancemap changed it to "FFFF" simply change that FFFF to 0 and compile again.

I've already been through that stage, I had no FFFF for whatever reason and it stayed as 0. I thought that meant the script was all good, But apparently not. It still gives me the garbled text. Thats why i wondered if i had to get a new offset or something.

Just tried compiling it again, and now it freezes on the spot. Great, :/
 
34
Posts
13
Years
I went to edit the script for the Mt. Moon Helix Fossil in FireRed to change "HELIX FOSSIL" to "Helix Fossil" but when I try to compile it, a message pops up saying "Error 13 'Type mismatch' on line 12. Missing #define or parameter. Line: giveitem2 0x165 0x1 0x13E" and it won't let me compile the script. Any way to fix this?
 

KyX

10
Posts
11
Years
  • Seen Jul 6, 2020
Hi, i have a problem with a SetMapTile Script.

Spoiler:


The movement of some blocks doesn't apply correctly.

As you can see there are 10 blocks witch C movement flag (you can pass). but ingame i'st like having 01 (you can't pass).

Coords are corrects, i have checked them 2 times. I don't know whats going on.

I went to edit the script for the Mt. Moon Helix Fossil in FireRed to change "HELIX FOSSIL" to "Helix Fossil" but when I try to compile it, a message pops up saying "Error 13 'Type mismatch' on line 12. Missing #define or parameter. Line: giveitem2 0x165 0x1 0x13E" and it won't let me compile the script. Any way to fix this?

Seems that you didn't extracted all files from XSE ZIP. there are some .rbh files that need to be in the same dir of XSE.exe

Check it.
 
Last edited:

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Hi, i have a problem with a SetMapTile Script.

Spoiler:


The movement of some blocks doesn't apply correctly.

As you can see there are 10 blocks witch C movement flag (you can pass). but ingame i'st like having 01 (you can't pass).

Coords are corrects, i have checked them 2 times. I don't know whats going on.

The movement permission in the setmaptile command only has two settings: passable and impassable. Unfortunately it doesn't sync up with Advance Map's movement permissions because setting it to anything but 0x0 will prevent you from walking on it. So to have your tiles function they way you want them to, just change your 0xC values to 0x0.
 

DVK

Hack based-God
134
Posts
13
Years
Okay. So I have a simple give pokemon script in which a person is standing in the pokemon centre blocking the way to nurse joy. Once the script ends he moves out of the way and goes and sits down on the cushion. The problem is I don't know how to make the sprite stay there permanently after the script has finished. Any help would be great.
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
Okay. So I have a simple give pokemon script in which a person is standing in the pokemon centre blocking the way to nurse joy. Once the script ends he moves out of the way and goes and sits down on the cushion. The problem is I don't know how to make the sprite stay there permanently after the script has finished. Any help would be great.
Have 2 OWs. One that will block the entrance and another that will be placed on a cushion.
The one that will be standing on a cushion will some set flag in its ID and the blocking one will have this in its script:
clearflag 0x(flag of the cushion OW)
setflag 0x(flag of the blocking OW)
That will remove the blocking OW and make the cushion OW appear.
 
  • Like
Reactions: DVK
74
Posts
12
Years
  • Seen Nov 3, 2019
Hello everyone! I having two question of my script...

Have someone know how to checkpokemon like checkitem, checkpcitem, etc...
Here is my example script that I need to make a script to check player is caught Bulbasaur or not.
Example script:
#dynamic 0x800000
#org @example
lock
faceplayer
checkflag 0x828
if 0x1 goto @thanks
msgbox @help 0x6
wildbattle 0x1 0x8 0x0
(somethings check if player caught the Bulbasaur goto @caught, if uncaught goto
@uncaught)
end
#org @caught
msgbox @caught2 0x6
giveitem 0x1 0x1 MSG_OBTAIN
msgbox @good 0x6
release
end
#org @uncaught
msgbox @uncaught2 0x6
giveitem 0x2 0x1 MSG_OBTAIN
msgbox @good 0x6
release
end
#org @thanks
msgbox @how 0x6
release
end
#org @help
= Trainer! Please help me!\p The Bulbasaur attacking me!\nPlease defeat it!
#org @caught2
= Oh thanks you...\pWow you catched it!\nGood Job dude!\lThis is your prize,\ltake it!
#org @uncaught2
= Oh thanks you...\pThis is your prize,\ntake it!
#org @good
= Good luck, dude!
#org @how
= How are you, [player]?

Have everyone know how to do it?

Other question, this script is making for DNS Day,Night and Season tools, I want to check week of day, but failed, can someone tell me why?
For Example:
#dynamic 0x800000
#org @dif
lock
faceplayer
comparefarbytetobyte 0x03005540 0x0
if 0x1 goto @sunday
comparefarbytetobyte 0x03005540 0x1
if 0x1 goto @monday
comparefarbytetobyte 0x03005540 0x2
if 0x1 goto @tuesday
comparefarbytetobyte 0x03005540 0x3
if 0x1 goto @wednesday
comparefarbytetobyte 0x03005540 0x4
if 0x1 goto @thursday
comparefarbytetobyte 0x03005540 0x5
if 0x1 goto @friday
comparefarbytetobyte 0x03005540 0x6
if 0x1 goto @saturday
release
end
#org @sunday
msgbox @sun 0x6
end
#org @monday
msgbox @mon 0x6
end
#org @tuesday
msgbox @tues 0x6
end
#org @wednesday
msgbox @wed 0x6
end
#org @thursday
msgbox @thurs 0x6
end
#org @friday
msgbox @fri 0x6
end
#org @saturday
msgbox @sat 0x6
end
#org @sun
= Today is Sunday.
#org @mon
= Today is Monday.
#org @tues
= Today is Tuesday.
#org @wed
= Today is Wednesday.
#org @thurs
= Today is Thursday.
#org @fri
= Today is Friday.
#org @sat
= Today is Saturday.

Answer me please... ><

PS: Sorry for my bad english... Thanks. :)
 
Last edited by a moderator:

Herpahermaderp

I liek Mudkipz
66
Posts
11
Years
  • Age 25
  • USA
  • Seen Jan 3, 2017
Hello everyone! I having two question of my script...

Have someone know how to checkpokemon like checkitem, checkpcitem, etc...
Here is my example script that I need to make a script to check player is caught Bulbasaur or not.
Example script:
#dynamic 0x800000
#org @example
lock
faceplayer
checkflag 0x828
if 0x1 goto @thanks
msgbox @help 0x6
wildbattle 0x1 0x8 0x0
(somethings check if player caught the Bulbasaur goto @caught, if uncaught goto
@uncaught)
end
#org @caught
msgbox @caught2 0x6
giveitem 0x1 0x1 MSG_OBTAIN
msgbox @good 0x6
release
end
#org @uncaught
msgbox @uncaught2 0x6
giveitem 0x2 0x1 MSG_OBTAIN
msgbox @good 0x6
release
end
#org @thanks
msgbox @how 0x6
release
end
#org @help
= Trainer! Please help me!\p The Bulbasaur attacking me!\nPlease defeat it!
#org @caught2
= Oh thanks you...\pWow you catched it!\nGood Job dude!\lThis is your prize,\ltake it!
#org @uncaught2
= Oh thanks you...\pThis is your prize,\ntake it!
#org @good
= Good luck, dude!
#org @how
= How are you, [player]?

Have everyone know how to do it?

Other question, this script is making for DNS Day,Night and Season tools, I want to check week of day, but failed, can someone tell me why?
For Example:
#dynamic 0x800000
#org @dif
lock
faceplayer
comparefarbytetobyte 0x03005540 0x0
if 0x1 goto @sunday
comparefarbytetobyte 0x03005540 0x1
if 0x1 goto @monday
comparefarbytetobyte 0x03005540 0x2
if 0x1 goto @tuesday
comparefarbytetobyte 0x03005540 0x3
if 0x1 goto @wednesday
comparefarbytetobyte 0x03005540 0x4
if 0x1 goto @thursday
comparefarbytetobyte 0x03005540 0x5
if 0x1 goto @friday
comparefarbytetobyte 0x03005540 0x6
if 0x1 goto @saturday
release
end
#org @sunday
msgbox @sun 0x6
end
#org @monday
msgbox @mon 0x6
end
#org @tuesday
msgbox @tues 0x6
end
#org @wednesday
msgbox @wed 0x6
end
#org @thursday
msgbox @thurs 0x6
end
#org @friday
msgbox @fri 0x6
end
#org @saturday
msgbox @sat 0x6
end
#org @sun
= Today is Sunday.
#org @mon
= Today is Monday.
#org @tues
= Today is Tuesday.
#org @wed
= Today is Wednesday.
#org @thurs
= Today is Thursday.
#org @fri
= Today is Friday.
#org @sat
= Today is Saturday.

Answer me please... ><

PS: Sorry for my bad english... Thanks. :)

Ok, for the Bulbasaur thing, you have to use this bit of code there:
setvar 0x8004 0x1 special2 0x800D 0x17C compare 0x800D 0x0
if 0x1 goto @(pointer for uncaught)
compare 0x800D 0x1
if 0x1 goto @(pointer for caught)
 
6
Posts
11
Years
  • Seen Dec 4, 2012
GAME: Pokémon Ruby
SCRIPT EDITOR: Pokéscript OR XSE
TYPE: Time script / Set time script

Hey everyone, I would like to know if there is a command to check the time in R/S/E. Say, you want something to happen but only from 12 PM to 3 PM, and the command will check the time before executing. Also, I cannot seem to get a working set clock script in the first place, but if there isn't any way to check the time in a script, then i wont bother with it. Here is the Set time script i wrote (It's in pokescript, i am just beginning with XSE) :

Spoiler:


I get this:
i1291.photobucket.com/albums/b543/RedDogHacks/Pokemonerror.png

Once i've returned to the room from this screen, I am unable to move and the music glitches out.
Any help or information appreciated!

EDIT: one more random thing
Is there any way to stop the "Save file corrupt" message? It's never said that before, but now it's starting to.
 
Last edited:
5
Posts
11
Years
  • Seen Feb 1, 2014
I'm trying to write a script in which a man will say "statement 1", give an item (in this case a Soothe Bell), and say "statement 2", but I followed the tutorials and got this. The man just straight off gives the Soothe Bell without saying Stmt 1 directly before and Stmt 2 directly after (though he does say Stmt 2 if you talk to him again).

SCRIPT (XSE):

#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x201
if 0x1 goto @nomore
msgbox @talk1 0x6
giveitem 0xB8 0x1 0x0
setflag 0x201
release
end
#org @nomore
msgbox @talk2 0x6
callstd 0x2
release
end
#org @talk1
= Hey, you're my first visitor! I'm\nso happy. Here, please take this\litem as a reward. I don't really\lhave any use for it.
#org @talk2
= The Soothe Bell raises a pokemon's\nhappiness. Some pokemon will even\levolve when they max their\lhappiness towards you.

Please help out if you can find any errors. I'm a total noob at this. :(
 

Herpahermaderp

I liek Mudkipz
66
Posts
11
Years
  • Age 25
  • USA
  • Seen Jan 3, 2017
I'm trying to write a script in which a man will say "statement 1", give an item (in this case a Soothe Bell), and say "statement 2", but I followed the tutorials and got this. The man just straight off gives the Soothe Bell without saying Stmt 1 directly before and Stmt 2 directly after (though he does say Stmt 2 if you talk to him again).

SCRIPT (XSE):

#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x201
if 0x1 goto @nomore
msgbox @talk1 0x6
giveitem 0xB8 0x1 0x0
setflag 0x201
release
end
#org @nomore
msgbox @talk2 0x6
callstd 0x2
release
end
#org @talk1
= Hey, you're my first visitor! I'm\nso happy. Here, please take this\litem as a reward. I don't really\lhave any use for it.
#org @talk2
= The Soothe Bell raises a pokemon's\nhappiness. Some pokemon will even\levolve when they max their\lhappiness towards you.

Please help out if you can find any errors. I'm a total noob at this. :(

You should try using a flag greater than 1000, 201 is a flag currently being used by the game and may cause glitches in it. That's why people have XSE tutorials on PC.
 

tajaros

Hi I'm dawg
855
Posts
11
Years
You should try using a flag greater than 1000, 201 is a flag currently being used by the game and may cause glitches in it. That's why people have XSE tutorials on PC.

Actually using flag beyond 0x900 is not a great Idea just use Jpan's engine so you can safely use flags 1-2FF.

Also why do you need Callstd 0x2? just remove it and changed that flag maybe to 200 and you are good. :)
 
4
Posts
11
Years
  • Seen Dec 29, 2016
There are other ways to define class related battle music, which are less flexible, but are guaranteed to work.

First of all, thank you so much for your help.
Second,
What are these other, less flexible methods? I want to change musics for specific custom Trainer Classes, so it's less about areas and more about one time changes.
 
Status
Not open for further replies.
Back
Top