The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page [Archive] Script help thread

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Closed Thread
 
Thread Tools
  #226   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:07 PM).
pokenar's Avatar
pokenar pokenar is offline
Lunatic Red Eyes
 
Join Date: Jan 2008
Age: 28
Gender: Male
Nature: Naive
Posts: 46
Quote:
Originally Posted by swampert22 View Post
Well thats a common misconception. Ive used flags right up over 1000 and they all work perfectly. There's nothing up there. If you've run out, start from 0x1001, you could really keep going untill 0x1999 safely, and what about adding in letters, like 0x101A, that also works!



It's pretty simple to make an overworld battle if you follow the many tutorials around here.

Here is a Celebi wildbattle to get you started.

Spoiler:

#org $legendary
lock
faceplayer
message $celebi
boxset 6
wildbattle 251 50 0
#raw 53
#raw <number of person in AdvanceMap>
#raw 00
setflag 0x1001
release
end

#org $celebi
$celebi 1 = Bibi!

When you've encoded it, assign it to a person and set the people ID to the flag set in the script. In this case it's 1001!

P.S. Sorry if this doesn't run smoothly, I just wrote it off the top of my head lol!


Good luck!

thanks i couldnt find this on any guide
__________________
It's been so long since I was here I still had a ShinyGold sig
  #227   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:10 PM).
Swampert 22's Avatar
Swampert 22 Swampert 22 is offline
Is making tools for you...
 
Join Date: Sep 2005
Location: Switzerland
Age: 32
Gender: Male
Nature: Brave
Posts: 393
Quote:
Originally Posted by itman1234 View Post
Another question:

What if i wanted a script to activate after i finished another event, but you pass that script along the way.
Example: i want to go to route 1, but when i get there, i have to go back to pallete town. On my way back (through a spot i passed before), someone walks over to you and battles. How would i get that to happen.

Also, how do i make sprites only appear during a certain script?
Example: the proffesor Oak script in Fire red, he's not on the map, but can still run over toyou.

My last question: is there a program that lets you view ingame scripts? if there was, that would really help.
Ah like the PokéDude on Route 29 in Johto. Basically you set the script to happen using several flags. The script checks a flag that you set later in the game. To make this easier to understand, consider this:

You walk over the spot at which the script happens on the way to Viridian City. It checks for a flag, (lets use 0x1001 again) and because it hasn't been set, nothing happens. Once completing the event in Viridian City the flag 0x1001 has been set by the event, so on the way back down, the script activates when you step on it. Then if you want the script to happen only once you need to add another set and check flag. Alternatively, you could clear the flag, but this could re-activate the event you did.

Look at this example.

Spoiler:

#org $begin
lock
checkflag 0x1001
if B_true goto $continue
release
end

#org $continue
checkflag 0x1002
if B_true goto $done
message $hi
boxset 6
setflag 0x1002
release
end

#org $hi
$hi 1 = Hello! \nHow was Viridian City?

#org $done
release
end


Try this one out too!
__________________

I've made some tools for Pokémon hacking! Please check out the thread... Swampert Tools Showcase

Head over to my thread to check out my latest tool, Pokémon Red/Blue Trainer Editor!

Visit my site for Pokémon ROM Hacking tools! Swampert Tools Homepage
  #228   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:13 PM).
+Sneasel™'s Avatar
+Sneasel™ +Sneasel™ is offline
It's a meeee, itman!
 
Join Date: May 2007
Location: None of your business!
Age: 29
Gender:
Nature: Lonely
Posts: 1,032
I'm sorry, but it's a bit weird.
How would that work?

I know it really isn't that hard to understand, but for some reason, i can't figure that out. Like for example, do i put that in the same event or a different one? and why is there lock but no faceplayer?
__________________
Intentions that were pure have turned obscure,
Seconds into hours, minutes into years.
Don't ask me why,
PLEASE DON'T CRY!
I can't tell you lies...

Don't click this!

PPH - A great hacking forum :)
  #229   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:15 PM).
ryan123456789019's Avatar
ryan123456789019 ryan123456789019 is offline
 
Join Date: Aug 2007
Posts: 87
can someone make me a script where someone follows though the whole game
  #230   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:29 PM). Edited January 14th, 2008 by Swampert 22.
Swampert 22's Avatar
Swampert 22 Swampert 22 is offline
Is making tools for you...
 
Join Date: Sep 2005
Location: Switzerland
Age: 32
Gender: Male
Nature: Brave
Posts: 393
Quote:
Originally Posted by itman1234 View Post
I'm sorry, but it's a bit weird.
How would that work?

I know it really isn't that hard to understand, but for some reason, i can't figure that out. Like for example, do i put that in the same event or a different one? and why is there lock but no faceplayer?
Yeah sorry, I know it's a bit hard to understand. It was just an example to show how to use the flags. You could add in whatever you want.

The reason there is no faceplayer is because there was no NPC to talk to the player in that example.

Look again at that script, just pay attention to what the flags are doing.

Flag 0x1001 is set when you do the event, for example in the first town.
Like collecting Oak's Parcel.

Because the script just ends if this flag is not set, when the player walks over the tile for the first time, on the way from Pallet Town, just after recieving a Pokémon, nothing happens.

On the way back down, because the player did the event and set the flag 0x1001, the script jumps to the point at which it does something. You could add a movement or wildbattle or whatever.

At the end of this the script sets another flag, 0x1002 which is added into the script before it's set (if that makes sense) to ensure that the event is not repeated. Alternatively the part that goes

checkflag 0x1002
if B_true goto $done

could be placed at the top of the script after the 'lock' command. That 0x1002 flag is set by the script on the route.

I hope you understand this because, I'm not very good at explaining stuff! If you're still having trouble i'll PM you a complete script to put into your game.

Right now though, I have to go to bed. It's getting late in England!

Quote:
Originally Posted by ryan123456789019 View Post
can someone make me a script where someone follows though the whole game
That's near on impossible to do, unless you're any good at ASM. Don't look at me because just looking at the ASM tutorials give me a headache.

You could always add in somebody to the players sprite, but they would follow you right from the beginning and it looks dodgy when you go round corners!
__________________

I've made some tools for Pokémon hacking! Please check out the thread... Swampert Tools Showcase

Head over to my thread to check out my latest tool, Pokémon Red/Blue Trainer Editor!

Visit my site for Pokémon ROM Hacking tools! Swampert Tools Homepage
  #231   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:43 PM).
ryan123456789019's Avatar
ryan123456789019 ryan123456789019 is offline
 
Join Date: Aug 2007
Posts: 87
where would i find his tutorial what is the name of the tutorial
  #232   Link to this post, but load the entire thread.  
Old January 14th, 2008 (1:46 PM).
+Sneasel™'s Avatar
+Sneasel™ +Sneasel™ is offline
It's a meeee, itman!
 
Join Date: May 2007
Location: None of your business!
Age: 29
Gender:
Nature: Lonely
Posts: 1,032
Quote:
Originally Posted by ryan123456789019 View Post
where would i find his tutorial what is the name of the tutorial
this is the script help thread, ask that in the simple questions thread.
__________________
Intentions that were pure have turned obscure,
Seconds into hours, minutes into years.
Don't ask me why,
PLEASE DON'T CRY!
I can't tell you lies...

Don't click this!

PPH - A great hacking forum :)
  #233   Link to this post, but load the entire thread.  
Old January 14th, 2008 (3:16 PM). Edited January 14th, 2008 by Thrace.
Thrace's Avatar
Thrace Thrace is offline
@tion
 
Join Date: Jun 2007
Age: 32
Gender: Male
Posts: 1,048
Quote:
Originally Posted by Crashink View Post
To make a sprite dissapear you use #raw 0x53, but you don't put it in the movements commands. You put it after the the person walks off the screen, or in a battle situation, before they exit the screen.
And no, movements don't really work on my rom if they're after the applymovement, as I said. All the movements work fine, if I changed it to your way it just wouldn't work, none of my scripts worked like that. I'm using FireRed so some things might be different >_>. Also having 0x doesn't make a different, but I use it that way cause I learned that way ... Most of my scripts work fine so I don't think I need to read alot of tutorials..

Also, #raw is another way to write a command that isn't in the program. And sometimes it works better with that command. #raw commands are basically hex..

Hopefully that explains it a bit better..

About ending with a 0xFE in the suicune pointer I probably forgot it, but thats not where the problem appears >.>
And the setflag 0x208 was probably a typo, but again it's not where the problem appears.
Right, sorry I was a bit harsh. You said the problem was that the sprite wasn't disappearing? Well when using #raw 53 you need to put in the people number as well so it would look like this:

Code:
#raw 53
#raw <people no.>
#raw 00
------------------------------------------------------------------------

In a level script what does the condition part do? Is it a flag, where if it has been set the script is executed or something else?
__________________
  #234   Link to this post, but load the entire thread.  
Old January 14th, 2008 (4:46 PM).
/Circa's Avatar
/Circa /Circa is offline
a face in the clouds.
 
Join Date: Nov 2007
Location: Melbourne, Victoria
Gender: Male
Nature: Quiet
Posts: 881
Alright, thanks ;D. I've fixed up most of the script but now i'm trying to fix up the movements and why the script happens again: Here it is:

Code:
#org $begin
lock
checkflag 0x208
if b_true goto $done
message $wierd
$wierd 1 =Something wierd is going on...
boxset 6
applymovement 0x5 $battle1
pausemove 0
wildbattle 0x10 0x5 0x3
cry PKMN_MEW
#raw 0x53
#raw 0x5
#raw 0x00
message $another1
boxset 6
applymovement 0x3 $battle2
pausemove 0
message $another1
boxset 6
wildbattle 0x10 0x5 0x3
cry PKMN_MEW
#raw 0x53
#raw 0x3
#raw 0x00
applymovement 0x7 $battle3
pausemove 0
message $another1
boxset 6
wildbattle 0x10 0x5 0x3
cry PKMN_MEW
#raw 0x53
#raw 0x7
#raw 0x00
applymovement 0x6 $battle4
pausemove 0
message $another1
boxset 6
wildbattle 0x10 0x5 0x3
cry PKMN_MEW
#raw 0x53
#raw 0x6
#raw 0x00
applymovement 0x4 $battle5
pausemove 0
message $another1
boxset 6
wildbattle 0x10 0x5 0x3
cry PKMN_MEW
#raw 0x53
#raw 0x4
#raw 0x00
message $another4
$another4 1 =Huh?
boxset 6
applymovement 0x8 $suicune
pausemove 0
#raw 0x53
#raw 0x8
#raw 0x00
setflag 0x208
release
end

#org $another1
= Not another one!

#org $battle1
#raw 0x08
#raw 0x02
#raw 0xFE

#org $battle2
#raw 0x08
#raw 0x08
#raw 0x08
#raw 0x0A
#raw 0x0A
#raw 0xFE

#org $battle3
#raw 0x08
#raw 0x08
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0xFE

#org $battle4
#raw 0x08
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0xFE

#org $battle5
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0xFE

#org $suicune
#raw 0x08
#raw 0x08
#raw 0x08
#raw 0x08
#raw 0x08
#raw 0x08
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0x0A
#raw 0xFE

#org $done
release
end
__________________
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.
  #235   Link to this post, but load the entire thread.  
Old January 14th, 2008 (7:10 PM).
thethethethe thethethethe is offline
 
Join Date: Jun 2007
Location: Melbourne, Australia
Gender: Male
Posts: 1,104
Quote:
Originally Posted by dshayabusa View Post
------------------------------------------------------------------------

In a level script what does the condition part do? Is it a flag, where if it has been set the script is executed or something else?
I'm assuming, you know you can you can assign a value up to 0xFFFF to a variable using setvar. So the condition is that value that you assign.
So as an example, I'd use the variable 0x7011 and the value that activates the script equals 2, and the script is found at 0x800000. So it would look like.
11 70 02 00 00 00 80 08 00 00
And just in case it's still not that clear I'll show a second example.
Variable = 0x5040; condition/Value = 0x128; script is at 0x7F935A
40 50 28 01 5A 93 7F 08 00 00
Does that explain the conditon, or did I just make it more confusing.
__________________
Gone.
  #236   Link to this post, but load the entire thread.  
Old January 14th, 2008 (7:28 PM).
Thrace's Avatar
Thrace Thrace is offline
@tion
 
Join Date: Jun 2007
Age: 32
Gender: Male
Posts: 1,048
Quote:
Originally Posted by thethethethe View Post
I'm assuming, you know you can you can assign a value up to 0xFFFF to a variable using setvar. So the condition is that value that you assign.
So as an example, I'd use the variable 0x7011 and the value that activates the script equals 2, and the script is found at 0x800000. So it would look like.
11 70 02 00 00 00 80 08 00 00
And just in case it's still not that clear I'll show a second example.
Variable = 0x5040; condition/Value = 0x128; script is at 0x7F935A
40 50 28 01 5A 93 7F 08 00 00
Does that explain the conditon, or did I just make it more confusing.
You explained it very well, thanks. Is it possible to assign a flag instead of a variable to the variable part of the level script?
__________________
  #237   Link to this post, but load the entire thread.  
Old January 15th, 2008 (5:53 PM).
Kurayamiblack's Avatar
Kurayamiblack Kurayamiblack is offline
 
Join Date: Dec 2007
Gender:
Posts: 26
Spoiler:

#org 0x800300
lock
faceplayer
setvar 0x8004 9
setvar 0x8005 2
special 0x174
checkflag 0x4B8
if 0x1 jump 0x162669
setvar 0x8004 9
setvar 0x8005 0
special 0x173
setvar 0x8004 9
setvar 0x8005 1
special 0x173
checkflag 0x844
if 0x0 jump 0x162641
checkflag 0x844
if 0x1 jump 0x16264A
setflag 0x3
setflag 0x5
checkflag 0x844
if 0x0 jump 0x162653
checkflag 0x844
if 0x1 jump 0x162653
clearflag 0x5
jump 0x162673

This is the script for the first opponent in the Elite 4 in Fire Red. I edited one value and the script offset.

I use DiamondCutter but for some reason, it won't apply this script to the game. Can someone help me? (I'm thinking it's something within the script)
  #238   Link to this post, but load the entire thread.  
Old January 15th, 2008 (9:41 PM).
/Circa's Avatar
/Circa /Circa is offline
a face in the clouds.
 
Join Date: Nov 2007
Location: Melbourne, Victoria
Gender: Male
Nature: Quiet
Posts: 881
dshayabusa, could you explain the followme script a bit more? I didn't really get how to do it. It would be appreciated, thankyou.
__________________
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.
  #239   Link to this post, but load the entire thread.  
Old January 16th, 2008 (11:24 AM).
Swampert 22's Avatar
Swampert 22 Swampert 22 is offline
Is making tools for you...
 
Join Date: Sep 2005
Location: Switzerland
Age: 32
Gender: Male
Nature: Brave
Posts: 393
Hey can anybody out there help me with this headbutt tree script. It runs fine right through until a wild Pokémon should appear.

Spoiler:
#org $start
#raw 0x7C 0x1D 0x00
compare LASTRESULT 0x6
if 1 goto $done
#raw 0x9D 0x00 0x0D 0x80
#raw 0x7F 0x00 0x0D 0x80
message $do
boxset 5
compare LASTRESULT 1
if 0x1 goto $continue
release
end

#org $done
message $hiding
boxset 6
release
end

#org $do
$do 1 = There may be a Pokémon hiding \nin this tree... \pWould you like to use Headbutt?

#org $continue
message $use
boxset 6
#raw 0x68
#raw 0x9C 0x25 0x00
#raw 0x27
jump 0x1BE06F <offset of Tree data>

#org $hiding
$hiding 1 = There may be a Pokémon hiding \nin this tree...

#org $use
$use 1 = \v\h02 used \v\h03!


It just crashes after this. Obviously its the command or offset of tree data. I've tried making the script jump to the offset of the tree data on that particular route, but that didn't work either.

If anybody knows how to make this work, it would be greatly appreciated.

Thanks
__________________

I've made some tools for Pokémon hacking! Please check out the thread... Swampert Tools Showcase

Head over to my thread to check out my latest tool, Pokémon Red/Blue Trainer Editor!

Visit my site for Pokémon ROM Hacking tools! Swampert Tools Homepage
  #240   Link to this post, but load the entire thread.  
Old January 16th, 2008 (4:00 PM).
Thrace's Avatar
Thrace Thrace is offline
@tion
 
Join Date: Jun 2007
Age: 32
Gender: Male
Posts: 1,048
Quote:
Originally Posted by Crashink View Post
dshayabusa, could you explain the followme script a bit more? I didn't really get how to do it. It would be appreciated, thankyou.
Sorry about that I pretty much just copied and pasted my own script. Really the main thing you need in a followme script is just to not have a pausemove after the person leading but after the person who is following. ie:

applymovement 0xff $follow
applymovement 0x01 $follow
pausemove 0

The rest is just positioning the hero or follower so that the hero is directly in front of the person following.
__________________
  #241   Link to this post, but load the entire thread.  
Old January 16th, 2008 (4:04 PM).
pokeglitch86 pokeglitch86 is offline
 
Join Date: Jul 2007
Gender:
Nature: Adamant
Posts: 28
Does anybody know the flag for the ability to surf?
  #242   Link to this post, but load the entire thread.  
Old January 16th, 2008 (4:21 PM).
/Circa's Avatar
/Circa /Circa is offline
a face in the clouds.
 
Join Date: Nov 2007
Location: Melbourne, Victoria
Gender: Male
Nature: Quiet
Posts: 881
Quote:
Originally Posted by dshayabusa View Post
Sorry about that I pretty much just copied and pasted my own script. Really the main thing you need in a followme script is just to not have a pausemove after the person leading but after the person who is following. ie:

applymovement 0xff $follow
applymovement 0x01 $follow
pausemove 0

The rest is just positioning the hero or follower so that the hero is directly in front of the person following.

Thanks, I understand now :D
But wouldn't it be the other way around, so you'd have 0xFF after 0x1 because wouldn't that make someone follow the hero?
__________________
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.
  #243   Link to this post, but load the entire thread.  
Old January 16th, 2008 (6:02 PM).
Thrace's Avatar
Thrace Thrace is offline
@tion
 
Join Date: Jun 2007
Age: 32
Gender: Male
Posts: 1,048
Quote:
Originally Posted by pokeglitch86 View Post
Does anybody know the flag for the ability to surf?
It's a special:
special 0x161

Quote:
Originally Posted by Crashink View Post
Thanks, I understand now :D
But wouldn't it be the other way around, so you'd have 0xFF after 0x1 because wouldn't that make someone follow the hero?
Yeah, you're right I just thought you wanted it that way.
__________________
  #244   Link to this post, but load the entire thread.  
Old January 17th, 2008 (2:35 PM).
pokeglitch86 pokeglitch86 is offline
 
Join Date: Jul 2007
Gender:
Nature: Adamant
Posts: 28
Thank you.

Now does anybody know how to make the screen fade black and then fade back again like when the rockets dissapear.
  #245   Link to this post, but load the entire thread.  
Old January 17th, 2008 (3:13 PM).
+Sneasel™'s Avatar
+Sneasel™ +Sneasel™ is offline
It's a meeee, itman!
 
Join Date: May 2007
Location: None of your business!
Age: 29
Gender:
Nature: Lonely
Posts: 1,032
fadescreen 0, am i correct?
Thats what i use, like for a wild pokemon battle.
__________________
Intentions that were pure have turned obscure,
Seconds into hours, minutes into years.
Don't ask me why,
PLEASE DON'T CRY!
I can't tell you lies...

Don't click this!

PPH - A great hacking forum :)
  #246   Link to this post, but load the entire thread.  
Old January 18th, 2008 (6:55 AM).
Binary's Avatar
Binary Binary is offline
え?
 
Join Date: Aug 2007
Age: 28
Posts: 3,977
No,
You've got to make the team rockets sprites to disappear,
Quote:
#raw 53
#raw <people no.>
#raw 00
That also makes the screen fade and come back again, while the rockets sprites also disappear
well thats what I think XD

~C3LEBI
__________________
  #247   Link to this post, but load the entire thread.  
Old January 18th, 2008 (7:15 AM).
WaterSplash's Avatar
WaterSplash WaterSplash is offline
Common
 
Join Date: Jan 2008
Location: Wherever I am, I am
Age: 30
Gender: Male
Nature: Serious
Posts: 70
I know this isn't the simple questions thread, but that thread is closed, so.......

Is there any way to change the data of the pokedex through scripting?
__________________

Berries Grow, Birds Fly, Sun Shines, and Brotha...I Splash People.
  #248   Link to this post, but load the entire thread.  
Old January 18th, 2008 (9:34 AM). Edited January 18th, 2008 by pokeglitch86.
pokeglitch86 pokeglitch86 is offline
 
Join Date: Jul 2007
Gender:
Nature: Adamant
Posts: 28
c3libi will that work with pokescript.
I used fadescreen 0 and it didn't in like 3x the speed it was suppose to.

EDIT: I just tried the ability to surf special thing. By surf I meant lik what it does when you get the 6th badge on fr and lg. So does anybody know?
And on the subject does anybody know how to make pokemon and pokedex show up on the start menu?
  #249   Link to this post, but load the entire thread.  
Old January 18th, 2008 (4:51 PM).
Thrace's Avatar
Thrace Thrace is offline
@tion
 
Join Date: Jun 2007
Age: 32
Gender: Male
Posts: 1,048
Quote:
Originally Posted by pokeglitch86 View Post
EDIT: I just tried the ability to surf special thing. By surf I meant lik what it does when you get the 6th badge on fr and lg. So does anybody know?
And on the subject does anybody know how to make pokemon and pokedex show up on the start menu?
Flags:
0x205 for the 5th badge
0x828 for Pokemon menu
0x829 for Pokedex

special 0x16F for national dex
__________________
  #250   Link to this post, but load the entire thread.  
Old January 18th, 2008 (5:03 PM).
ShyRayq's Avatar
ShyRayq ShyRayq is offline
Unprofessional Unprofessional
 
Join Date: Aug 2007
Gender: Male
Nature: Adamant
Posts: 1,855
could anyone tell me how to do a gymleader script in fr anf lg?
__________________
3DS Friend Code: 5069-3944-3902
IGN: Peter; (X, Y, OR, AS, S, M, US, UM)
Friend Safari: (Fighting) Throh, Meditite, Breloom
Living Pokedex Complete: Y, C, R, LG, E, D, Pl, HG, B, B2, X, Y, OR, AS, M, UM, LGP, Sw, LA
Big thanks especially to DestinedJagold, Xerneas_X, Elements1, ~RNC~ and ThePoke Man

PM me if you want to trade, or add my FC.
Closed Thread

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:24 AM.