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

Creating a Headbutt script in trees [4 n00bs]

iv0

145
Posts
10
Years
  • Age 32
  • Seen Sep 1, 2023
Introduction:
I made this tutorial for those who have difficulty with scripts. Sorry, but english is not my native language, and it's is my first tutorial made in other language. Tutorial made ​​for FR / LG.

What you need:
  • Advanced Map
  • XSE (1.0.0 version in preference).
  • Decimal to Hexadecimal converter (like this).

Let's start:​
Open your Advanced Map and choose the map to do it. Insert your tree to make it be headbutted.
Spoiler:

Edit the movement permission:
Spoiler:

Insert a new signpost, and edit as the same to image:
Spoiler:

Do the same thing of the image (you need to search a free space bytes to make your headbutt script, and yes, your offset value may be different):
Spoiler:

In the last click in "Open script", if open a window like that, it's all OK.
Copy and paste this in the XSE window (replace YOURFREESPACEVALUE to YOUR previous value of the tutorial, in a example my value is "71A4BC"):
Spoiler:

Let's choose yours Pokémons in the trees:
Replace the values in the functions "startwildbattle", example if I want a Togepi in level 2 holding a Oran Berry, my code is:
Code:
startwildbattle 0xAF 0x2 0x8B
Wait... What is AF (Pokémon) and 8D (Item ID) values? Keep calm... This is the decimal values converted to hexadecimal values. In a example:
If I want to replace the Togepi to a Caterpie (decimal number in dex is 10), my new value in script is A, like this:
Code:
startwildbattle 0xA 0x2 0x8B
You should apply it (decimal to hexadecimal) in all the values​​.
Example: if I want a Mewtwo in level 70 holding no item, my code is:
Code:
startwildbattle 0x96 0x46 0x0
If you don't undestand, see this:
Spoiler:

There are the itens ID (not converted):
Spoiler:

After choosing your Pokémons click in the Compile icon (
OodS6mT.png
), copy the new @startscript value and replace it to your Headbutt offset value (like it).
Now, save you rom in the Advanced Map, close XSE (is not necessary to save script) and Advanced Map.
Let's see the results:
Spoiler:


Extra:​
If you want to expand your numbers of Pokémons in the tree, let's see it:
Spoiler:


If you want the player may only use this after winning such GYM, put this code before "checkattack 0x1D" and after "lockall":
Spoiler:

There are the GYMS codes (only for FR/LF):
Spoiler:



Credits:​
diegoisawesome - for Item IDs.
Dartharon - for the headbutt script base.
karatekid552 - GYM flags.
 
Last edited:

Logan

[img]http://pldh.net/media/pokecons_action/403.gif
10,417
Posts
15
Years
You know could use special 0xAB and set the wild Pokémon in a-map right? Would save you a good deal of time.
 

iv0

145
Posts
10
Years
  • Age 32
  • Seen Sep 1, 2023
You know could use special 0xAB and set the wild Pokémon in a-map right? Would save you a good deal of time.
Yeah, but I not understand how this works exactly, and I prefer the Pokémon in the tree with custom item.
 

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
  • Age 24
  • Seen Nov 19, 2023
This is pretty cool, I was about to make a headbutt tree script myself soon, but I guess I won't have to now. Good job, very easy to understand tutorial.
 
9
Posts
12
Years
  • Seen Feb 21, 2016
Thanks for feedback. I have others tutorials in my mind to post ;p

Well, I'm interested. I want a lot of different moves having differing field effects for my hack, so this is cool.


Interested in seeing what else you can help me with. =]


Not only this, but now I truly understand the random command. I'm a real boneheaded, hands on learner. Once I get something, I retain it well, but very few people can describe things to me in a way that will make me understand, I always have to mess around myself to get that true sense for it.. My hack is gonna have eggs that could be TONS of different Pokémon from the region, so this helps IMMMENSELY. Thank you.
 
Last edited:
  • Like
Reactions: iv0

iv0

145
Posts
10
Years
  • Age 32
  • Seen Sep 1, 2023
Well, I'm interested. I want a lot of different moves having differing field effects for my hack, so this is cool.


Interested in seeing what else you can help me with. =]


Not only this, but now I truly understand the random command. I'm a real boneheaded, hands on learner. Once I get something, I retain it well, but very few people can describe things to me in a way that will make me understand, I always have to mess around myself to get that true sense for it.. My hack is gonna have eggs that could be TONS of different Pokémon from the region, so this helps IMMMENSELY. Thank you.

Thanks for feedback. Really rewarding to have a comment like that. I did not understand quite what you mean, can you talk more about your idea of the "diffent moves"?
 

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
  • Age 24
  • Seen Nov 19, 2023
Thanks for feedback. Really rewarding to have a comment like that. I did not understand quite what you mean, can you talk more about your idea of the "diffent moves"?

I think he means stuff like whirlpool where another move is used. If that's what he means then all he has to edit is checkattack and make a new script for those moves.
 

iv0

145
Posts
10
Years
  • Age 32
  • Seen Sep 1, 2023
I think he means stuff like whirlpool where another move is used. If that's what he means then all he has to edit is checkattack and make a new script for those moves.

Oh, my ♥♥♥♥ing language problems. xD
It's pretty easy to do it, I'm think better to organize it in a unique topic.
 

xGal

Mhm
241
Posts
12
Years
Well, I'm interested. I want a lot of different moves having differing field effects for my hack, so this is cool.


Interested in seeing what else you can help me with. =]


Not only this, but now I truly understand the random command. I'm a real boneheaded, hands on learner. Once I get something, I retain it well, but very few people can describe things to me in a way that will make me understand, I always have to mess around myself to get that true sense for it.. My hack is gonna have eggs that could be TONS of different Pokémon from the region, so this helps IMMMENSELY. Thank you.

I hope I understand what you mean by "different effect".

If you want Whirlpool for example, you can just replace everything from line 15 (msgbox @2) to line 34 (if 0x1 call @dontfound) with the new effect. For example, make a Whirlpool overworld sprite and then use hidesprite 0x[whirlpool sprite] (don't forget the setflag :P). Also, if you are a bit more advanced, you could edit a tile to make it look like a whirlpool and then set a script on it. (http://www.pokecommunity.com/showthread.php?t=310142).

And the most important thing - don't forget to edit the attack commands :).
 
9
Posts
12
Years
  • Seen Feb 21, 2016
xD


You guys are awesome. I will definitely be returning to this thread in a while.


I'm pretty new at this, if you can't tell. Always messed with the games, but used tools to do so mainly to edit the stats of mons and move power. Now, I have my own ideas I wanna implement. Thanks for all the help!
 

kearnseyboy6

Aussie's Toughest Mudder
300
Posts
15
Years
  • Seen Jun 22, 2019
Here is a dump of my honey script. You just need to modify the offsets.

Spoiler:
 
  • Like
Reactions: iv0

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
  • Age 24
  • Seen Nov 19, 2023
If anyone wants a headbutt script for Emerald:

#dynamic 0xE40000
#org @start
lockall
checkattack 0x1D
compare 0x800D 0x06
if 0x01 goto @dontknow
msgbox @2 0x5
compare 0x800D 0x1
if 0x1 goto @yes
releaseall
end

#org @yes
checkattack 0x1d
setanimation 0x0 LASTRESULT
bufferpartypokemon 0x0 LASTRESULT
bufferattack 0x1 0x1d
msgbox 0x8290771 MSG_KEEPOPEN '"[buffer1] used [buffer2]!"
doanimation 0x25
waitstate
random 0x2
compare LASTRESULT 0x1
if 0x1 goto @sucess
releaseall
end

#org @sucess
special 0xAE
waitstate
releaseall
end

#org @2
= This tree may contain a Pokémon.\nWant to use headbutt?

#org @dontknow
msgbox @1 0x6
releaseall
end

#org @1
= This tree looks like it could be\nheadbutted.

Mess with the offsets if you want, and add wild pokemon in the "Tree" area in A map.
 
Back
Top