Script Help Thread (DO NOT REQUEST SCRIPTS) Page 290

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

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
Alright thanks.I'll try a different ofset then.
Use offset 800000 or something bigger.
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List
Male
Connecticut
Seen March 3rd, 2014
Posted March 1st, 2014
39 posts
10.9 Years
Ok i need help with my script. It is a level script and for some reason at the end of the script there japanese text starts popping up when the script is just supposed to end!
Here is my script:
#dynamic 0x6D2A3C
#org @start
setvar 0x4033 0x1
setflag 0x201
applymovement 0x3 @move
waitmovement 0x0
msgbox @1 0x6
applymovement 0x3 @move2
applymovement 0xFF @move2
waitmovement 0x0
msgbox @2 0x6
applymovement 0x3 @move3
applymovement 0xFF @move3
waitmovement 0x0
msgbox @3 0x6
applymovement 0x3 @move4
applymovement 0xFF @move4
waitmovement 0x0
msgbox @4 0x6
applymovement 0x3 @move5
waitmovement 0x0
msgbox @5 0x6
applymovement 0x3 @move6
waitmovement 0x0
fadescreen 0x1
fadescreen 0x0
release
end
#org @move
#raw 0x08
#raw 0x08
#raw 0xFE
#org @move2
#raw 0x01
#raw 0x03
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x01
#raw 0xFE
#org @move3
#raw 0x02
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x01
#raw 0x09 
#raw 0x09 
#raw 0x09 
#raw 0x09 
#raw 0x09 
#raw 0x02
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x01
#raw 0x09
#raw 0x09 
#raw 0x09 
#raw 0x01
#raw 0xFE
#org @move4
#raw 0x03
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x01
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x03
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x00
#raw 0x08 
#raw 0x08 
#raw 0x08 
#raw 0x08 
#raw 0x03
#raw 0x0B
#raw 0x0B
#raw 0x01
#raw 0xFE
#org @move5
#raw 0x56
#raw 0x02
#raw 0xFE
#org @move6
#raw 0x02
#raw 0x17
#raw 0x17
#raw 0x17
#raw 0x01
#raw 0x16
#raw 0x16
#raw 0x02
#raw 0x17
#raw 0x17
#raw 0x17
#raw 0x00
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x02
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0xFE
#org @1
= [PLAYER]! It's me dad!\pBefore you say anything abut my\nhair! The hair dresser screwed up\land gave me this emo cut!\pAnyway, i'm back! It is so nice to\nsee you [PLAYER]!\pI don't have much time but let me\nshow you around a little bit!\pFollow me.
#org @2 
= This in front of us is the\nPokemart.\pIn here you can buy and sell\nthings.\pThere is one of theese in almost\nevery town, city, or villige.
#org @3 
= This is the Pokemon Center.\pHere you can heal up all of your\ntired or fainted Pokemon back to\lfull health.\pIn the upstairs part of the\nPokemon center you can trade and\lconnect with people world wide!
#org @4 
= Right in front of us is a Pokemon\nGym.\pGym's consit of trainers that you\nmust battle to challenge the Gym\lLeader.\pThe Gym leader is a very powerful\ntrainer.\pEach gym usses a different type.\pFor example a gym might only use\nFighting types.\pOr a gym might use all electric\ntypes.\pWhen you beat a gym leader they\nwill usually give you a new TM.\lAnd shall always give you a badge\lto show you beat them.\pWhen you get all 8 badges you can\nenter the Pokemon League.\pThere you can battle the Elite 4\nand the champion.\pThey are the strongest trainers in\nall of the Arorian Region.\pIf you can beat the Elite 4 and\nthe champion without losing all\lyour Pokemon then your are truely\lthe Pokemon champion.
#org @5
= Will you look at the time!\pI have to go [PLAYER]!\nI'll see you soon.\lBye
Ok does anyone know how to fix this?

thanethane98

Self Proclaimed Expert

Seen November 16th, 2013
Posted July 1st, 2013
82 posts
10.9 Years
Ok does anyone know how to fix this?
Was there a lot of space at the offset you used? If not, there's a chance that the script may of run over into other data, and so it's putting that in the message box as well.
Back and ROM hacking again!

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
Ok, I updated the tile warp script, and now it's better, but as soon as I step on the tile the game freezes.
Does it have Unknown and Var set?
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List

iLoveHate

Hmmmmmm.... :D

Male
Holland :D
Seen November 27th, 2015
Posted October 11th, 2013
35 posts
10.7 Years
Hmm Haia, I got a question, i hope you someone of you can aswer it.
Ive been scripting for a while now and almost made my home town complete, I need to resue some1 and he gives me a pokemon bla bla bla. but my question is what if i die in that first battle? is my whole game screwed up? and im planning to make a battle against my rival with lvl 5 pokes, what is he/she defeats me? what do i have to do to prevent this? :S
It would be nice if i can rebattle or something but doing the whole conversation again.

Thanks in advance all.
Male
Seen February 26th, 2014
Posted December 18th, 2012
13 posts
11.3 Years
I'm a bit new to scripting and I'm having trouble with this one.
I'm writing in XSE for a FireRed hack. The script is fired off by a trigger/"green S" tile.

What I want to happen is, after the right flags are set, have a person walk toward the player, say something, then initiate a battle. I've looked at the scripts for the Giovanni Silph Co. battle as well as the Pokemon Tower rival battle for comparison but can't see where the important differences are. My script is below (the overuse of #raw 62 is just filler from debugging).

The trigger behaves well enough before I have the flag set, so that works, at least. But once I set the flag, everything just freezes. Nobody moves, and no battle begins. I tried attaching the script to a person event, but that makes the person move without initiating the battle.

Spoiler:
'-----------------------
#org 0x8004F8
checkflag 0x1000
if 0x0 goto @end
checkflag 0x1010
if 0x1 goto @end
lock
applymovement MOVE_PLAYER 0x88004F6
applymovement 0x1 0x880036E
waitmovement 0x0
pause 0x5
msgbox 0x8800374 '"asdf..."
callstd 0x4
setvar LASTTALKED 0x1
trainerbattle 0x3 0x1 0x0 0x88003DF
msgbox 0x88003F4 '"asdf..."
callstd 0x4
closeonkeypress
fadescreen 0x1
setflag 0x1010
hidesprite 0x1
hidesprite 0x2
hidesprite 0x3
fadescreen 0x0
release
end

'-----------------------
#org @end
release
end


'-----------
' Movements
'-----------
#org 0x8004F6
#raw 62 'Exclamation Mark (!)

#org 0x80036E
#raw 62 'Exclamation Mark (!)
#raw D 'Step Up (Slow)
#raw F 'Step Right (Slow)
#raw 1 'Face Up
#raw 62 'Exclamation Mark (!)


'---------
' Strings
'---------
#org 0x800374
= asdf

#org 0x8003DF
= asdf

#org 0x8003F4
= asdf
Male
Seen January 28th, 2018
Posted December 6th, 2015
736 posts
13.9 Years
This is a question for all you Emerald hackers on the site.

What I want to do is move the camera during an event, then move it back. I am well aware that (in FR at least) this requires a special "lock" and "release" command, as well as the standard applymovement 0x7F.

Does anybody know if Emerald requires these "lock" and "release" specials, and if so, which specials they are?

ETA: Never mind, I found out which specials they are. In Emerald, it's special 0x116 and 0x117 instead of 0x113 and 0x114 like on RS and FRLG.
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Female
Seen August 28th, 2012
Posted August 23rd, 2012
5 posts
10.7 Years
Yay, I failed at a basic script again -_- This time I tried following a youtube tut (Hack Tutorials: Script Lesson One). I followed the tutorial exactly using Pokescript (I know its outdated, but i've been having no more luck with XSE, so I'm willing to try anything. Instead of getting a message box that says hello, I'm getting a choice between "buy" or "quit", neither of which I can select, and I can't back away either. Does anyone know what I'm doing wrong? I'm fairly sure it isn't my rom, I downloaded a new one to try this on.

Notepad Code

Spoiler:
#org $script
lock
faceplayer
message $talk
$talk 1 = Hello.
boxset 6
release
end

iLoveHate

Hmmmmmm.... :D

Male
Holland :D
Seen November 27th, 2015
Posted October 11th, 2013
35 posts
10.7 Years
Yay, I failed at a basic script again -_- This time I tried following a youtube tut (Hack Tutorials: Script Lesson One). I followed the tutorial exactly using Pokescript (I know its outdated, but i've been having no more luck with XSE, so I'm willing to try anything. Instead of getting a message box that says hello, I'm getting a choice between "buy" or "quit", neither of which I can select, and I can't back away either. Does anyone know what I'm doing wrong? I'm fairly sure it isn't my rom, I downloaded a new one to try this on.

Notepad Code

Spoiler:

#org $script
lock
faceplayer
message $talk
$talk 1 = Hello.
boxset 6
release
end
NinjaLizzard i read you are using pokescript cuz you dont have more luck with XSE, but i can tell you this: downloads XSE 1.1.1 and look for any helpin the Diegoisawesome mega-huge xse tutorial, im kinda beginner but that tutorial helped me a lot. then the script would be:
Spoiler:

#dynamic 0x800000

#org @script
lock
faceplayer
msgbox @talk 0x6
release
end

#org @talk
= Haia


isnt this easier, the 0x6 is the same as boxset 6. it is al explained in the tutorial. if you sdont know how to get xse 1.1.1 pm me oki? REally XSE is far more easier

Can some1 help me?
My problem: Over and over again battling with a Weedle.
Its like this: You start, walk somewhere and then you have to rescue prof oak by killing the weedle. he says thank you and its done. but it can also happen if you you fail against the weedle. then you go back to you mommy and go to prof oak again over and over again until you defeat that weedle. my problem is when i killed the weedle and walk over the tile again its okej, no worries. But when i walk in house and go out again and walk over the tile again it starts the battle again.

I hope you guys understand me. I also made a video for the problem and i put the scripts in the disription, i also will put the script here.

Video: i cant post url yet but the video link is in my Visitor message so you only have to press on my name and the link will show up i guess

Script for starter and killing weedle:
Spoiler:
#dynamic 0x800000

#org @start
setvar 0x5002 0x2
goto @script
end

#org @script
checkflag 0x5005
if 0x1 goto @done
compare 0x5002 0x0
if 0x1 goto @lefttile
compare 0x5002 0x1
if 0x1 goto @middletile
compare 0x5002 0x2
if 0x1 goto @righttile
end

#org @final
msgbox @finally 0x4
closeonkeypress
setflag 0x5006
release
end

#org @finally
= Thank you for saving me!

#org @done
release
end

#org @lefttile
applymovement 0x02 @movetotheleft
waitmovement 0x0
goto @cont
end

#org @middletile
applymovement 0x02 @movetothemiddle
waitmovement 0x0
goto @cont
end

#org @righttile
applymovement 0x02 @movetotheright
waitmovement 0x0
goto @cont
end

#org @cont
msgbox @help 0x4
closeonkeypress
setflag 0x5005
goto @choose
end

#org @help
= Help me please, a wild weedle is\nattacking me. Take one of my\lpoke


#org @choose
msgbox @3starters 0x4
closeonkeypress
goto @bulba
end

#org @3starters
= You can choose Bulbasaur,\nCharmander or Squirtle. Give it a\lname if you want and fight that\lweedle!

#org @bulba
hidepokepic
showpokepic 0x1 0x0A 0x03
msgbox @bulbasaur 0x5
compare LASTRESULT 0x1
if 0x0 goto @char
hidepokepic
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @gotbu 0x4
waitfanfare
closeonkeypress
msgbox @nick1 0x5
compare LASTRESULT 0x1
if 0x1 goto @callpok
setflag 0x828
goto @further
end

#org @char
hidepokepic
showpokepic 0x4 0x0A 0x03
msgbox @charmander 0x5
compare LASTRESULT 0x1
if 0x0 goto @squir
hidepokepic
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @gotch 0x4
waitfanfare
closeonkeypress
msgbox @nick2 0x5
compare LASTRESULT 0x1
if 0x1 goto @callpok
setflag 0x828
goto @further
end

#org @squir
hidepokepic
showpokepic 0x7 0x0A 0x03
msgbox @squirtle 0x5
compare LASTRESULT 0x1
if 0x0 goto @bulba
hidepokepic
givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @gotsq 0x4
waitfanfare
closeonkeypress
msgbox @nick3 0x5
compare LASTRESULT 0x1
if 0x1 goto @callpok
setflag 0x828
goto @further
end

#org @further
msgbox @lol 0x4
closeonkeypress
msgbox @cry 0x6
cry 0xD 0x0
wildbattle 0xD 0x3 0x0
goto @final
end

#org @cry
= Wee-ee-eedlee

#org @lol
= Now attack that weedle!

#org @squirtle
= Your last choice is a Squirtle, do\nyou want a Squirtle?

#org @gotsq
= You received a Squirtle!

#org @nick3
= Do you want to give Squirtle a\nnickname?

#org @charmander
= Maybe the Charmander?

#org @gotch
= You received a Charmander!

#org @nick2
= Do you want to give Charmander a\nnickname?

#org @callpok
call 0x1A74EB
setflag 0x828
goto @further
end

#org @bulbasaur
= Take the Bulbasaur?

#org @gotbu
= You received a Bulbasaur!

#org @nick1
= Do you want to give Bulbasaur a\nnickname?

#org @movetotheleft
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x1D
#raw 0xFE

#org @movetothemiddle
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x1D
#raw 0xFE

#org @movetotheright
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x6
#raw 0x1F
#raw 0x1F
#raw 0x4
#raw 0x1D
#raw 0x1D
#raw 0xFE


And the script for when you didnt kill the weedle:
I think something is wrong in this one:
Spoiler:
#dynamic 0x800000

#org @start
lock
checkflag 0x5006
if 0x1 goto @end
checkflag 0x828
if 0x1 goto @battle
release
end

#org @end
release
end

#org @battle
msgbox @weedle 0x4
closeonkeypress
msgbox @cry 0x6
cry 0xD 0x0
wildbattle 0xD 0x3 0x0
goto 0x801C4A (That is @final in script 1)
end

#org @weedle
= Make it quick plz

#org @cry
= Wee-ee-edle



Thanks in advance, could you pm/vp me the solution?
Male
Connecticut
Seen March 3rd, 2014
Posted March 1st, 2014
39 posts
10.9 Years
Ok i need help with my script. It is a level script and for some reason at the end of the script there japanese text starts popping up when the script is just supposed to end!
Here is my script:
#dynamic 0x6D2A3C
#org @start
setvar 0x4033 0x1
setflag 0x201
applymovement 0x3 @move
waitmovement 0x0
msgbox @1 0x6
applymovement 0x3 @move2
applymovement 0xFF @move2
waitmovement 0x0
msgbox @2 0x6
applymovement 0x3 @move3
applymovement 0xFF @move3
waitmovement 0x0
msgbox @3 0x6
applymovement 0x3 @move4
applymovement 0xFF @move4
waitmovement 0x0
msgbox @4 0x6
applymovement 0x3 @move5
waitmovement 0x0
msgbox @5 0x6
applymovement 0x3 @move6
waitmovement 0x0
fadescreen 0x1
fadescreen 0x0
release
end
#org @move
#raw 0x08
#raw 0x08
#raw 0xFE
#org @move2
#raw 0x01
#raw 0x03
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x01
#raw 0xFE
#org @move3
#raw 0x02
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x0A 
#raw 0x01
#raw 0x09 
#raw 0x09 
#raw 0x09 
#raw 0x09 
#raw 0x09 
#raw 0x02
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x01
#raw 0x09
#raw 0x09 
#raw 0x09 
#raw 0x01
#raw 0xFE
#org @move4
#raw 0x03
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x01
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x03
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x00
#raw 0x08 
#raw 0x08 
#raw 0x08 
#raw 0x08 
#raw 0x03
#raw 0x0B
#raw 0x0B
#raw 0x01
#raw 0xFE
#org @move5
#raw 0x56
#raw 0x02
#raw 0xFE
#org @move6
#raw 0x02
#raw 0x17
#raw 0x17
#raw 0x17
#raw 0x01
#raw 0x16
#raw 0x16
#raw 0x02
#raw 0x17
#raw 0x17
#raw 0x17
#raw 0x00
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x02
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0x17 
#raw 0xFE
#org @1
= [PLAYER]! It's me dad!\pBefore you say anything abut my\nhair! The hair dresser screwed up\land gave me this emo cut!\pAnyway, i'm back! It is so nice to\nsee you [PLAYER]!\pI don't have much time but let me\nshow you around a little bit!\pFollow me.
#org @2 
= This in front of us is the\nPokemart.\pIn here you can buy and sell\nthings.\pThere is one of theese in almost\nevery town, city, or villige.
#org @3 
= This is the Pokemon Center.\pHere you can heal up all of your\ntired or fainted Pokemon back to\lfull health.\pIn the upstairs part of the\nPokemon center you can trade and\lconnect with people world wide!
#org @4 
= Right in front of us is a Pokemon\nGym.\pGym's consit of trainers that you\nmust battle to challenge the Gym\lLeader.\pThe Gym leader is a very powerful\ntrainer.\pEach gym usses a different type.\pFor example a gym might only use\nFighting types.\pOr a gym might use all electric\ntypes.\pWhen you beat a gym leader they\nwill usually give you a new TM.\lAnd shall always give you a badge\lto show you beat them.\pWhen you get all 8 badges you can\nenter the Pokemon League.\pThere you can battle the Elite 4\nand the champion.\pThey are the strongest trainers in\nall of the Arorian Region.\pIf you can beat the Elite 4 and\nthe champion without losing all\lyour Pokemon then your are truely\lthe Pokemon champion.
#org @5
= Will you look at the time!\pI have to go [PLAYER]!\nI'll see you soon.\lBye
Can somebody please Help me with this!?!?

marcin

Male
Behind you
Seen April 1st, 2013
Posted February 10th, 2013
4 posts
13.9 Years
Use offset 800000 or something bigger.


I used offset 830000.Now the view radius works correctly,but instead of saying something,the screen turns red and the game freezes.
I have XSE 1.0.0,so I'm going to try downloading XSE 1.1.1 and then tell you guys what happens.


Sceptile is the absolute best Pokemon of all time.
Female
Seen August 28th, 2012
Posted August 23rd, 2012
5 posts
10.7 Years
I'm back to my second problem I was having with my basic script. I have XSE 1.1.1, and using FSF, I found an offset. Using this offset in my script (in the spoiler below), I compile it, and copy the offset into Advance Map. Then when I test my ROM, my character walks up one tile and then the whole screen goes black, when all I'm trying to do is talk to an NPC. Is there anyone who has any idea what I'm doing wrong, and what I can do to fix it?

Spoiler:
#dynamic 0x481E00
#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= I love these flowers!


EDIT: I think I may have discovered part of the problem, even if I don't know the solution. Is the script offset # suppose to change when you switch back and forth between maps? Like, if I switch to a different map, and then come back, the code is different.

miksy91

Dark Energy is back in action! ;)

Male
Finland
Seen September 21st, 2022
Posted September 21st, 2022
1,480 posts
14.6 Years
I'm back to my second problem I was having with my basic script. I have XSE 1.1.1, and using FSF, I found an offset. Using this offset in my script (in the spoiler below), I compile it, and copy the offset into Advance Map. Then when I test my ROM, my character walks up one tile and then the whole screen goes black, when all I'm trying to do is talk to an NPC. Is there anyone who has any idea what I'm doing wrong, and what I can do to fix it?

Spoiler:
#dynamic 0x481E00
#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= I love these flowers!


EDIT: I think I may have discovered part of the problem, even if I don't know the solution. Is the script offset # suppose to change when you switch back and forth between maps? Like, if I switch to a different map, and then come back, the code is different.
The #dynamic 0x481E00 there means that the script editor tries to calculate free space in ROM where to input your script data starting at offset 0x481E00. Best way to understand what it means is by having a backup of the original rom file and a hex editor (any hex editor will do, there are plenty of them around).

Compile your script data and open that offset it shows with a hex editor in both compiled rom and your backup rom. That way, you can see what the XSE did while compiling the script, and where #dynamic 0x481E00 lead the script data.

Otherwise, I believe your problem is the fact that XSE thinks you've found free space for inserting the script data in rom, and put it there although there wasn't free space for it. There is a of free space in the end of the rom; starting somewhere at 0x730000 (this is also something you may want to check with a hex editor to see what the rom looks like and all the room you've left for inserting your own data without replacing any existing data) I believe but can't remember for sure as I never hack FR.

So after doing all this, start with your backup rom and compile the script in free rom area.
Pokémon Dark Energy
Some ROM hacking related stuff
Male
United Kingdom
Seen July 9th, 2016
Posted July 7th, 2016
8 posts
10.8 Years
I'm trying to get a sprite to check the player for the EARTHBADGE (which I have renamed the HYDROBADGE) and then disappear if the player has it. I've tried writing my own script, but the only thing that happens is the game freezes when you attempt to talk the sprite. Can somebody please fix the error(s) in my script, and tell me what I need to change.

Here's my script:
'-----------------------
#org 0x2D8438
lock
faceplayer
checkflag 0x827
if 0x0 goto 0x2D8458
if 0x1 goto 0x2D8448
end

'-----------------------
#org 0x2D8458
callstd 0x4
msgbox 0x2D8478
release
end

'-----------------------
#org 0x2D8448
msgbox 0x2D8468
waitmsgbox
fanfare 0x101
waitfanfare
waitkeypress
release
hidesprite 0x3
end

'---------
' Strings
'---------
#org 0x2D8478
= Sorry, I can't let you through\nuntil you have defeated FYFE.\pThere are some tough trainers\nalong this ROAD!

#org 0x2D8468
= Well done for defeating FYFE!\pYou may pass now!

iLoveHate

Hmmmmmm.... :D

Male
Holland :D
Seen November 27th, 2015
Posted October 11th, 2013
35 posts
10.7 Years

I'm trying to get a sprite to check the player for the EARTHBADGE (which I have renamed the HYDROBADGE) and then disappear if the player has it. I've tried writing my own script, but the only thing that happens is the game freezes when you attempt to talk the sprite. Can somebody please fix the error(s) in my script, and tell me what I need to change.
Haia vespertine, maybe i can help.

this was your script i see
Spoiler:

'-----------------------
#org 0x2D8438
lock
faceplayer
checkflag 0x827
if 0x0 goto 0x2D8458
if 0x1 goto 0x2D8448
end

'-----------------------
#org 0x2D8458
callstd 0x4
msgbox 0x2D8478
release
end

'-----------------------
#org 0x2D8448
msgbox 0x2D8468
waitmsgbox
fanfare 0x101
waitfanfare
waitkeypress
release
hidesprite 0x3
end

'---------
' Strings
'---------
#org 0x2D8478
= Sorry, I can't let you through\nuntil you have defeated FYFE.\pThere are some tough trainers\nalong this ROAD!

#org 0x2D8468
= Well done for defeating FYFE!\pYou may pass now!


First off, are you using XSE? i recommend xse 1.1.1
what was the offset number? was in above 800000

maybe you can try this:

Spoiler:

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x827
if 0x0 goto @notyet
msgbox @welldone 0x4
closeonkeypress
fanfare 0x101
waitfanfare
fadescreen 0x1
hidesprite 0x07
setflag 0x101
fadescreen 0x0
release
end

#org @welldone
= Well done for defeating FYFE!\pYou may pass now!

#org @notyet
msgbox @no 0x4
closeonkeypress
release
end

#org @no
= Sorry, I can't let you through\nuntil you have defeated FYFE.\pThere are some tough trainers\nalong this ROAD!


A little explanation:
#dynamic 0x800000[b: looking for offset 800000 or higher.
checkflag 0x827: I guess that has to be the hydrobadge.
msgbox @welldone 0x4: the 0x4 is the same ass callstd 4 alwats use 'closeonkeypress' after using the 0x4
hidesprite: is the person event no
setflag 0x101: im using this 1 to make the sprite dis-appear forever so it wont re-appear when you walk. the 0x1 is the person ID
fadescreen: i guess that isnt hard to find out.



I hope it helped, i just tested it. it worked for me, but be sure using xse with this script above. if you want xse 1.1.1 and cant find the download just ask me oki?
Male
United Kingdom
Seen July 9th, 2016
Posted July 7th, 2016
8 posts
10.8 Years
Hi there, thank you so much for your help! When I use your script however the messagebox does not pop up, and the sprite just disappears and then reappears once you walk through it (without saying the messages or whatever). The fanfare does play however. This is what my script is after I made the necessary alterations (sprite number etc):

#dynamic 0x2D84E4

#org @start
lock
faceplayer
checkflag 0x827
if 0x0 goto @notyet
msgbox @welldone 0x4
closeonkeypress
fanfare 0x101
waitfanfare
fadescreen 0x1
hidesprite 0x3
setflag 0x301
fadescreen 0x0
release
end

#org @welldone
= Well done for defeating FYFE!\pYou may pass now!

#org @notyet
msgbox @no 0x4
closeonkeypress
release
end

#org @no
= Sorry, I can't let you through\nuntil you have defeated FYFE.\pThere  are some tough trainers\nalong this ROAD!
I edited lines;
0013: hidesprite 0x1 to hidesprite 0x3 (as the sprite's number is 3)
0014: setflag 0x101 to setflag 0x301 (as the sprite's number is 3)

Can you please tell me what I have done to cause an error? Thanks for your help!

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
0014: setflag 0x101 to setflag 0x301 (as the sprite's number is 3)
Um... you don't need to care about OW's number when you are assigning a flag o.O
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List

tajaros

Hi I'm dawg

Age 24
Male
Philippines
Seen August 7th, 2015
Posted April 15th, 2013
855 posts
11.1 Years
anyone know how to make a mughshot before a battle? i know you neeed to make some kind of script for it. like before battling it shows both trainers pic with a vs sign.
I think you need to do this... :)

http://www.pokecommunity.com/showthread.php?t=240183

It's really hard cause you need ASM to do that, cause there's no such command in XSE... :)
Male
Seen October 15th, 2018
Posted October 28th, 2012
17 posts
12.5 Years
Alright, I'm kind of having the same problem as EHero except I'm using Emerald. Everything works fine until the nicknaming part where nothing happens. I'm pretty sure I'm using the wrong script for nicknaming because I don't know what the offset for the nicknaming script in Emerald is. Could anyone help me? I know my pointers are a bit confusing... xD

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x860
if 0x1 goto @gipokemon1
msgbox @hallo 0x5
compare LASTRESULT 0x1
if 0x1 goto @gepokemon1
msgbox @hallo2 0x6
release
end

#org @gepokemon1
givepokemon 0x199 0x64 0x1 0x0 0x0 0x0
fanfare 0x13E
msgbox @hallo3 0x4
waitfanfare
closeonkeypress
setflag 0x860
msgbox @hallo4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @hallo5
msgbox @hallo6 0x6
release
end

#org @hallo5
call 0x1A74EB
return

#org @gipokemon1
msgbox @hallo7 0x6
release
end

#org @hallo
= I found this Jirachi in space! Do\nyou want it? O:

#org @hallo2
= Okay, but this is your only chance\nto get this amazing pokemon!

#org @hallo3
= [black_fr]You received a Jirachi!

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

#org @hallo6
= You made a good choice my friend.\n(:

#org @hallo7
= I don't have anymore Jirachis.\nSorry! ):


Edit:
Alright, having another problem with wildbattle. Script will be below. I have a charizard sitting in my character's room and have a Lv. 100 Swampert in my front slot with the Pokemon Menu enabled. I have the charizard's sprite set to Person ID 0200 and Movement type as Look Around. However, when I try to interact with the charizard and it just beeps and no text or anything happens. I can only think of two problems; 1. I screwed up in scripting or 2. I can't cause a battle because it's in the player's room. Can anyone help me out with this as well?

Spoiler:
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @danke 0x6
cry 0x6 0x0
wildbattle 0x6 0x1E 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @danke
= CHARIZARD: Meep.
Would really like help with this if anyone could! Thanks.
Currently playing through: Pokemon Flora Sky

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
Would really like help with this if anyone could! Thanks.
probably replace the "gosub" with "call"...

for the second one, I think you probably gave charizard the wrong offset in a-map.