• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Archive] Script help thread

Status
Not open for further replies.
Hey no problem. I like helping people!

Any more questions you have please feel free to ask them, no matter how simple.

That is the idea of the thread after all!
 
Well, i have another question:

it's about flags:

Let's say i used all the flags from 200-299. I heard that you weren't supposed to use 300
and was wondering what to use after i use them all up.
 
il ask again since no one anserd how do i make a legendairy pokemon battle with pokescript
 
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!

il ask again since no one anserd how do i make a legendairy pokemon battle with pokescript

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:


Good luck!
 
Last edited:
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.
 
Last edited:
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:


Good luck!


thanks i couldnt find this on any guide
 
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:


Try this one out too!
 
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?
 
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!

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!
 
Last edited:
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?
 
Last edited:
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
 
------------------------------------------------------------------------

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.
 
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?
 
Spoiler:

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)
 
dshayabusa, could you explain the followme script a bit more? I didn't really get how to do it. It would be appreciated, thankyou.
 
Headbutt Tree Script

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:


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
 
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.
 
Status
Not open for further replies.
Back
Top